Hello,
i am trying to cross compile a nexus5 kernel with clang but at the end i get one error.
The steps i did were
git clone http://git.linuxfoundation.org/llvmlinux.git
cd llvmlinux
cd targets/vexpress
make kernel-shell-for-build
cd …/…/
cd targets
cd nexus5
make
Than i applied all necessary patches.
The build command looks like this
make ARCH=arm CROSS_COMPILE=/home/stefan/llvmlinux/arch/arm/toolchain/linaro/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf- -l4 -j5 GCC_TOOLCHAIN=/home/stefan/llvmlinux/arch/arm/toolchain/linaro/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux KBUILD_OUTPUT=/home/stefan/llvmlinux/targets/nexus5/build/kernel-clang HOSTCC=“/home/stefan/llvmlinux/toolchain/clang/head/install/bin/clang” CC="/home/stefan/llvmlinux/toolchain/clang/head/install/bin/clang "
drivers/built-in.o: In function __video_do_ioctl': /home/stefan/llvmlinux/targets/nexus5/src/android_kernel_nexus5/drivers/media/video/v4l2-ioctl.c:1604: undefined reference to
__aeabi_memclr4’
make[1]: *** [.tmp_vmlinux1] Error 1
make: *** [sub-make] Error 2
So does clang already support aeabi. Why does it fail?
Kind regards
Stefan
Hello,
i am trying to cross compile a nexus5 kernel with clang but at the end i
get one error.
The steps i did were
git clone http://git.linuxfoundation.org/llvmlinux.git
cd llvmlinux
cd targets/vexpress
make kernel-shell-for-build
cd ../../
cd targets
cd nexus5
make
Than i applied all necessary patches.
The build command looks like this
make ARCH=arm
CROSS_COMPILE=/home/stefan/llvmlinux/arch/arm/toolchain/linaro/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux/bin/arm-linux-gnueabihf-
-l4 -j5
GCC_TOOLCHAIN=/home/stefan/llvmlinux/arch/arm/toolchain/linaro/gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux
KBUILD_OUTPUT=/home/stefan/llvmlinux/targets/nexus5/build/kernel-clang
HOSTCC="/home/stefan/llvmlinux/toolchain/clang/head/install/bin/clang"
CC="/home/stefan/llvmlinux/toolchain/clang/head/install/bin/clang "
drivers/built-in.o: In function `__video_do_ioctl':
/home/stefan/llvmlinux/targets/nexus5/src/android_kernel_nexus5/drivers/media/video/v4l2-ioctl.c:1604:
undefined reference to `__aeabi_memclr4'
make[1]: *** [.tmp_vmlinux1] Error 1
make: *** [sub-make] Error 2
So does clang already support aeabi. Why does it fail?
The issue isn't clang. It properly generated code for a hosted AEABI
compliant environment. In fact, the error is indicating the problem: you
don't have an implementation for __aeabi_memclr4. Where does the
implementation come from? Since you are building a kernel, you are in a
freestanding environment, and the functionality that is normally provided
by the C runtime (libc) is not present. You need to provide an
implementation yourself.