Nico Feulner
Nico Feulner

Reputation: 185

android kernel compiling error for arm64 (msm8996)

I'm trying to compile my custom kernel for an arm64 android device having an msm8996 SOC. I cloned my Kernel on GitHub just to make sure I have a fully clean code. Then I exported these:

export PATH=/home/nico/Downloads/kernel/aarch64-linux-android-4.9/bin:$PATH
export CROSS_COMPILE=aarch64-linux-android-
export ARCH=arm64
export SUBARCH=arm64

Keep in mind that the msm8996 has two dual-core clusters which are both arm64. I tried compiling using the stock gcc 4.9 toolchain which is shiped with the Cyanogenmod sources and then I tried it using two of the UberTC 4.9 toolchains which can be found here: https://bitbucket.org/UBERTC/ aarch64-linux-android-4.9-kernel and aarch64-linux-android-4.9 (I dunno exactly what's the difference between those two). Every time I retried building my kernel I performed a

make mrproper

and also deleted the ccache folder. Then I performed a

make cm_pme_defconfig

and finally a

make -j2

I also tried the same procedure with

make -j1

I couldn't find anyone else who got the same error so I decided to post it here. Here's the error message in my terminal:

In file included from drivers/net/ethernet/msm/rndis_ipa_trace.h:81:0,
                 from drivers/net/ethernet/msm/rndis_ipa.c:32:
include/trace/define_trace.h:83:43: fatal error: ./rndis_ipa_trace.h:
No such file or directory
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
                                           ^
compilation terminated.

Furthermore here's my kernel on my GitHub https://github.com/nico151999/android_kernel_htc_msm8996

I really need your help though the solution to the problem may be quite obvious. Thanks a lot in advance ;)

Upvotes: 4

Views: 6149

Answers (4)

João Pedro
João Pedro

Reputation: 5

I stumbled with the same problem as soon as I started working with Linux Kernel v3.18 - LineageOS source for Moto G5 (Qualcomm SD 430) at a few places.

Patch the file "drivers/net/ethernet/msm/rndis_ipa_trace.h" @ line 15

- #define TRACE_INCLUDE_FILE rndis_ipa_trace
+ #define TRACE_INCLUDE_FILE ../drivers/net/ethernet/msm/rndis_ipa_trace

and the file "drivers/platform/msm/ipa/ipa_v2/ipa_trace.h" @ line 15

- #define TRACE_INCLUDE_FILE ipa_trace
+ #define TRACE_INCLUDE_FILE ../drivers/platform/msm/ipa/ipa_v2/ipa_trace

Both changes were made to be less invasive and avoid modifying the file at "include/traces", which may be used by others C files. This is a more local solution than a general change. And also, does not need to worry with absolute paths for the files, the "#include" call has is root at "/path/to/source/linux/.", so if you use a relative path knowing it will start from there, the changes may work.

Upvotes: 0

Lucas. B
Lucas. B

Reputation: 11

I'm having the same problem.

It seems that you can modify "TRACE_INCLUDE_PATH" in the file "rndis_ipa_trace.h" for each directory. And, directories to be modified are included in the build error message.

As I proceeded with the build, I could find problems on the following path, and I proceeded with the build by referring to the solutions of the others above.

drivers/clk/qcom/mdss/rndis_ipa_trace.h & drivers/platform/msm/ipa/ipa_v2/rndis_ipa_trace.h

Thank you for your guide =)

Upvotes: 0

Khode_Erfan
Khode_Erfan

Reputation: 184

actually based on this commit i found global answer take look :

diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h b/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
index d70abdf..7f7e452 100644
--- a/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
+++ b/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
@@ -131,5 +131,5 @@ TRACE_EVENT(

 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_PATH ../../drivers/platform/msm/ipa/ipa_v2
 #include <trace/define_trace.h>

do this ("../../") to other TRACE_INCLUDE_PATH

Upvotes: 6

Fengwei Yin
Fengwei Yin

Reputation: 31

I hit the exactly same issue with Qualcomm kernel. Generally, adding CFLAGS_trace.o := -I$(src) to correct Makefile could fix this build issue. But it didn't work for me. So I used a very bold method. Patch is like following:

diff --git a/drivers/net/ethernet/msm/rndis_ipa_trace.h b/drivers/net/ethernet/msm/rndis_ipa_trace.h
index c0fc573..c18046b 100644
--- a/drivers/net/ethernet/msm/rndis_ipa_trace.h
+++ b/drivers/net/ethernet/msm/rndis_ipa_trace.h
@@ -77,5 +77,5 @@ TRACE_EVENT(

 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_PATH /opt/work/qcom/kernel/drivers/net/ethernet/msm/
 #include <trace/define_trace.h>
diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h b/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
index d70abdf..7f7e452 100644
--- a/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
+++ b/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
@@ -131,5 +131,5 @@ TRACE_EVENT(

 /* This part must be outside protection */
 #undef TRACE_INCLUDE_PATH
-#define TRACE_INCLUDE_PATH .
+#define TRACE_INCLUDE_PATH /opt/work/qcom/kernel/drivers/platform/msm/ipa/ipa_v2/
 #include <trace/define_trace.h>

Upvotes: 3

Related Questions