Skip to content

Error linking kernel/futex.o #325

@nathanchance

Description

@nathanchance

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:

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.

Metadata

Metadata

Labels

[ARCH] arm32This bug impacts ARCH=arm[BUG] linuxA bug that should be fixed in the mainline kernel.[CONFIG] allyesconfigIssue affects allyesconfig on certain architectures[FIXED][LINUX] 5.15This bug was fixed in Linux 5.15

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions