I just created a gcc11 crosscompiler with crosstool-ng for "arm-unknown-eabi" to compile my kernel (android for msm8974 chipset), but at some point of the linking, the LD gives this error about EABI versions, but the target file doesn't even exists. These are the components of the crosstool toolchain:
- binutils-2.34.tar.xz
- gcc-git-46a58c77.tar.bz2
- gettext-0.20.1.tar.xz
- gmp-6.2.0.tar.xz
- isl-0.22.tar.xz
- libiconv-1.16.tar.gz
- mpc-1.1.0.tar.gz
- mpfr-4.0.2.tar.xz
- ncurses-6.2.tar.gz
- newlib-3.3.0.tar.gz
The full command that gives the error is this:
- /root/x-tools/arm-unknown-eabi/bin/arm-unknown-eabi-ld -EL -r -o drivers/gpu/built-in.o drivers/gpu/drm/built-in.o drivers/gpu/ion/built-in.o
- /root/x-tools/arm-unknown-eabi/bin/arm-unknown-eabi-ld: error: source object drivers/gpu/ion/built-in.o has EABI version 5, but target drivers/gpu/built-in.o has EABI version 0
- /root/x-tools/arm-unknown-eabi/bin/arm-unknown-eabi-ld: failed to merge target specific data of file drivers/gpu/ion/built-in.o
Looking at these files:
- drivers/gpu/built-in.o: cannot open `drivers/gpu/built-in.o' (No such file or directory)
- drivers/gpu/drm/built-in.o: ELF 32-bit LSB relocatable, ARM, version 1 (ARM), not stripped
- drivers/gpu/ion/built-in.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped
The real target (drivers/gpu/built-in.o) doesn't even exist. The DRM one (which doesnt show as EABI5) is there although very small (320 bytes, I think it's created by AR?).
With another toolchains everything goes nicely with this exact same kernel code, Makefile, etc. I was using musl gcc 10 before.