nathanchance / android-kernel-clang

Information on compiling Android kernels with Clang
291 stars 83 forks source link

Build error with Clang + msm-3.18 Kernel #24

Open PruthviDns opened 3 years ago

PruthviDns commented 3 years ago

Hi Nathan,

i tried to follow steps mentioned and tried to build Kernel with Clang and im getting build error related to Linker attaching the snapshot and make command from log

change

error log and Make command https://pastebin.com/K5kXM606

can you please help me to fix this issue

thanks and Regards, Pruthvi

nathanchance commented 3 years ago

Can you point me to your kernel source?

PruthviDns commented 3 years ago

Hi Nathan,

i have downloaded from below link repo init -u git://codeaurora.org/platform/manifest.git -b release -m LA.UM.7.5.r1-04500-8x96.0.xml

nathanchance commented 3 years ago

Did you add any patches on top of it? That is what I am trying to see because that kernel by itself does not support building with clang. The make command also looks different from the one that you took a photo of above so I am also trying to figure out where that is coming from.

PruthviDns commented 3 years ago

HI Nathan ,

i haven't added any patches on top of the kernel downloaded from the repo.

to explain you in a nutshell - i have a working Android-9 source with kernel-msm3.18 (repo link is mentioned above), i want to upgrade the Android version to 10 , so i merged kernel,Vendor , device folders from the repo link to aosp 10 source and trying to build.

while doing the above , i encountered error saying that Android GCC has been deprecated and Clang must be used. hence i tried to compile Kernel with Clang (Changes i did to Make command is shown in Photo in above commands)

if i'm wrong in any steps , please suggest me because i'm doing this task in the blind

One stupid question: can i replace kernel from repo ( git://codeaurora.org/platform/manifest.git -b release -m LA.UM.7.5.r1-04500-8x96.0.xml) with your kernel (https://github.com/nathanchance/android-kernel-clang/tree/msm-3.18-android-10) and can build sucessfully without breaking any functionality?

nathanchance commented 3 years ago

while doing the above , i encountered error saying that Android GCC has been deprecated and Clang must be used.

You could technically modify that manifest to point GCC to the android-9.0.0_r1 tags, where that warning does not exist. Fundamentally, GCC still works fine for older kernels. Google is just requiring that devices that ship with newer versions of Android to compile their kernels with clang.

hence i tried to compile Kernel with Clang (Changes i did to Make command is shown in Photo in above commands)

if i'm wrong in any steps , please suggest me because i'm doing this task in the blind

If you are building the kernel inline, you probably need something like this:

https://source.codeaurora.org/quic/la/kernel/msm-4.14/commit/?id=0cc35b1bfadb4b1f49b8a8566e44f6de0cabe841

along with whatever other fixes there are here:

https://source.codeaurora.org/quic/la/kernel/msm-4.14/log/AndroidKernel.mk?h=LA.UM.8.1.r1-17100-sm8150.0

Note, Google actually builds their kernels out of tree then just builds with the prebuilts, that might be something to try as well.

One stupid question: can i replace kernel from repo ( git://codeaurora.org/platform/manifest.git -b release -m LA.UM.7.5.r1-04500-8x96.0.xml) with your kernel (https://github.com/nathanchance/android-kernel-clang/tree/msm-3.18-android-10) and can build sucessfully without breaking any functionality?

Maybe? No idea unfortunately but it is worth a shot I suppose.