Need help in configuration for moving to llvm compiler from gcc

154 views
Skip to first unread message

Komal Maheshwari

unread,
Jun 14, 2022, 6:47:25 AM6/14/22
to android-llvm

My kernel code is based on 5.4 version. And I was using arm/arm-linux-androideabi-4.9  and aarch64/aarch64-linux-android-4.9 folder from https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/ on Android-P to compile kernel.

To use clang compiler, I updated this macro LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN in my build.config to use llvm compiler as prebuilts-master/clang/host/linux-x86/clang-r416183b1/bin but I hit below error.

What is the right way to use llvm as a cross compiler?

Do I need to do additional configurations?

 

 

scripts/Kconfig.include:36: linker 'arm-linux-androidkernel-ld' not found

make[2]: *** [/local/mnt/workspace/ckiran/kernel-5.4-AndroidT/private/msm-qcom-cw/scripts/kconfig/Makefile:90: vendor/monaco_defconfig] Error 1

make[1]: *** [/local/mnt/workspace/ckiran/kernel-5.4-AndroidT/private/msm-qcom-cw/Makefile:608: vendor/monaco_defconfig] Error 2

make[1]: Leaving directory '/local/mnt/workspace/ckiran/kernel-5.4-AndroidT/out/android-msm-monaco-5.4/private/msm-qcom-cw'

make: *** [Makefile:183: sub-make] Error 2

Nick Desaulniers

unread,
Jun 14, 2022, 2:29:56 PM6/14/22
to Komal Maheshwari, android-llvm
On Tue, Jun 14, 2022 at 3:47 AM Komal Maheshwari
<kmah...@qti.qualcomm.com> wrote:
>
> My kernel code is based on 5.4 version. And I was using arm/arm-linux-androideabi-4.9 and aarch64/aarch64-linux-android-4.9 folder from https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/ on Android-P to compile kernel.

android-9 on a 5.4 kernel is a curious combo.

Have you pinned the revision of the SHA for those folders to a SHA
from android-9? Otherwise those folders should now be empty on the
master branch, which might be why the linker is no longer found.

>
> To use clang compiler, I updated this macro LINUX_GCC_CROSS_COMPILE_PREBUILTS_BIN in my build.config to use llvm compiler as prebuilts-master/clang/host/linux-x86/clang-r416183b1/bin but I hit below error.
>
> What is the right way to use llvm as a cross compiler?
>
> Do I need to do additional configurations?

It looks like we should be able to build aarch64 with `LLVM=1` as long
as you're using clang-13 or newer.

>
>
>
>
>
> scripts/Kconfig.include:36: linker 'arm-linux-androidkernel-ld' not found
>
> make[2]: *** [/local/mnt/workspace/ckiran/kernel-5.4-AndroidT/private/msm-qcom-cw/scripts/kconfig/Makefile:90: vendor/monaco_defconfig] Error 1
>
> make[1]: *** [/local/mnt/workspace/ckiran/kernel-5.4-AndroidT/private/msm-qcom-cw/Makefile:608: vendor/monaco_defconfig] Error 2
>
> make[1]: Leaving directory '/local/mnt/workspace/ckiran/kernel-5.4-AndroidT/out/android-msm-monaco-5.4/private/msm-qcom-cw'
>
> make: *** [Makefile:183: sub-make] Error 2
>
> --
> You received this message because you are subscribed to the Google Groups "android-llvm" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to android-llvm...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-llvm/a402ec57-d3ee-4e98-b960-3476a4487128n%40googlegroups.com.



--
Thanks,
~Nick Desaulniers
Reply all
Reply to author
Forward
0 new messages