-
Notifications
You must be signed in to change notification settings - Fork 15
Description
I was going to resend the patch that fixes #287 but as I was trying to come up with some testing steps for people, I ran into this error with an arm allyesconfig build (little endian):
arm-linux-gnueabi-ld: kernel/futex.o:(.text.fixup+0x5c): relocation truncated to fit: R_ARM_JUMP24 against `.init.text'
make[2]: *** [/linux-next/Makefile:1021: vmlinux] Error 1
make[1]: *** [/linux-next/Makefile:296: __build_one_by_one] Error 2
I need the following patches to avoid other link/build errors:
- https://lore.kernel.org/lkml/20190122233749.42220-1-trong@android.com/
- https://lore.kernel.org/lkml/20181215212304.19390-1-natechancellor@gmail.com/
- https://raw.githubusercontent.com/nathanchance/patches/c313b2fa0efb/linux/build-hax/0003-DO-NOT-UPSTREAM-ARM-Don-t-select-HAVE_FUNCTION_TRACE.patch
It doesn't appear to be a kernel regression because it goes all the way back to v4.19 which I know I had building with ld.bfd
but I switched to ld.lld
a few weeks ago and have had no issues with linking since then.
Unfortunately, I don't have time today to try and see if LLVM or binutils is the issue (even with the new server I am renting with a Ryzen 7, it takes 15-20 minutes a build clean), hence opening this issue. I've been reproducing in our Docker container (to eliminate any environment related issues) with the following commands:
git clone -b arm-link-fail-v5.0 git://github.com/nathanchance/linux
cd linux
docker run --interactive --mount type=bind,source="${PWD}",target=/"$(basename "${PWD}")",readonly --rm --tty --workdir /"$(basename "${PWD}")" clangbuiltlinux/ubuntu
cat <<EOF > /build.sh
rm -rf /out && mkdir -p /out
echo "CONFIG_CPU_BIG_ENDIAN=n" >> /out/le.config
time make -j"$(nproc --all)" ARCH=arm CC="ccache clang-9" HOSTCC="ccache clang-9" CROSS_COMPILE=arm-linux-gnueabi- KCONFIG_ALLCONFIG=/out/le.config O=/out allyesconfig vmlinux
EOF
bash /build.sh
binutils has never been upgraded in our Docker container so it seems unlikely that it is the cause of the regression, making it look like Clang is probably the issue. Will keep the issue updated with my findings.