I'm using Ubuntu 20.04 and compiling the kernel for Pixel 3XL (crosshatch).
Adding LD=ld.gold to my script command doesn't fix the issue and gives the same error. Also, LLVMgold.so is inside the clang directory here: ~/KERNEL_DIRECTORY/linux-x86/clang-r353983c/lib64 (this is the path I'm using for LD_LIBRARY_PATH). I've copied LLVMgold.so to /usr/local/lib and other recommended locations with no luck. As always, thank you for reading and if you need more information, I'll be happy to share it with you.
Error:
AR arch/arm64/lib/lib.a
EXPORTS arch/arm64/lib/lib-ksyms.o
/home/jherwig/KERNEL_DIRECTORY/aarch64-linux-android-4.9/bin
/aarch64-linux-android-ld.gold: error: LLVMgold.so: could not load plugin
library: LLVMgold.so: cannot open shared object file: No such file or
directory
make[2]: *** [../scripts/Makefile.build:591: arch/arm64/lib/lib-ksyms.o] Error 1
make[1]: *** [/home/jherwig/KERNEL_DIRECTORY/crosshatch-msm-10
/Makefile:1123: arch/arm64/lib] Error 2
make[1]: Leaving directory '/home/jherwig/KERNEL_DIRECTORY /crosshatch-msm-10/out'
make: *** [Makefile:152: sub-make] Error 2
Script command with path:
rm -rf out && export PATH=~/WORKING_DIRECTORY/out/host/linux-x86/bin:/usr/bin:$PATH && export
DTC_EXT=dtc && export PATH=~/KERNEL_DIRECTORY/linux-x86/clang-r353983c/bin:$PATH && export
CLANG_TRIPLE=aarch64-linux-gnu- && export CROSS_COMPILE=~/KERNEL_DIRECTORY/aarch64-linux-
android-4.9/bin/aarch64-linux-android- && export CROSS_COMPILE_ARM32=~/KERNEL_DIRECTORY/arm-
linux-androideabi-4.9/bin/arm-linux-androideabi- && LD_LIBRARY_PATH=~/KERNEL_DIRECTORY/linux-
x86/clang-r353983c/lib64:$LD_LIBRARY_PATH && DEFCONFIG="b1c1_defconfig" && make O=out CC=clang
ARCH=arm64 $DEFCONFIG && make ARCH=arm64 CC=clang NM=llvm-nm OBJCOPY=llvm-objcopy O=out
ld.gold version:
jherwig@jh:~/KERNEL_DIRECTORY/crosshatch-msm-10$ /home/jherwig/KERNEL_DIRECTORY/aarch64-linux-
android-4.9/bin/aarch64-linux-android-ld.gold -v
GNU gold (binutils-2.27-bd24d23f 2.27.0.20170315) 1.12
ld.gold accepts plugins:
jherwig@jh:~/KERNEL_DIRECTORY/crosshatch-msm-10$ /home/jherwig/KERNEL_DIRECTORY/aarch64-linux-
android-4.9/bin/aarch64-linux-android-ld.gold -plugin
/home/jherwig/KERNEL_DIRECTORY/aarch64-linux-android-4.9/bin/aarch64-linux-android-ld.gold:
-plugin: missing argument
/home/jherwig/KERNEL_DIRECTORY/aarch64-linux-android-4.9/bin/aarch64-linux-android-ld.gold: use
the --help option for usage information