Re: [build fail] v6.11-rc2 from "ARM: 9404/1: arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION"

From: Harith George
Date: Wed Aug 07 2024 - 07:22:33 EST




On 07-08-2024 15:40, Arnd Bergmann wrote:
Obviously 'ld' should not segfault, so there is at least one bug
there, possibly also a kernel bug that triggered this. Can you
try with newer binutils? This should hopefully either solve your
problem or produce a more useful error message if there is still a
kernel problem.

Any of the binary toolchains below should work in general,
the latest one is the gcc-14.2/binutils-2.43 version I uploaded
to kernel.org the other day.

So, I tested with 3 more gcc builds.

gcc14.2 (x86_64-gcc-14.2.0-nolibc-arm-linux-gnueabi.tar.xz) and gcc9.5 (x86_64-gcc-9.5.0-nolibc-arm-linux-gnueabi.tar.xz) from https://mirrors.edge.kernel.org/pub/tools/crosstool/index.html
works and in both these ld does not segfault and build completes.

But gcc9.3 (armv7-eabihf--musl--stable-2020.08-1.tar.bz2) from (https://toolchains.bootlin.com/releases_armv7-eabihf.html) resulted in the same LD segfault below.

+ arm-buildroot-linux-musleabihf-ld -EL -z noexecstack --no-undefined -X --pic-veneer -z norelro --build-id=sha1 --orphan-handling=warn --script=./arch/arm/kernel/vmlinux.lds --strip-debug -o .tmp_vmlinux1 --whole-archive vmlinux.a init/version-timestamp.o --no-whole-archive --start-group arch/arm/lib/lib.a lib/lib.a --end-group .tmp_vmlinux0.kallsyms.o
scripts/link-vmlinux.sh: line 49: 3802905 Segmentation fault ${ld} ${ldflags} -o ${output} ${wl}--whole-archive ${objs} ${wl}--no-whole-archive ${wl}--start-group ${libs} ${wl}--end-group ${kallsymso} ${btf_vmlinux_bin_o} ${ldlibs}
make[2]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 139
make[1]: *** [/home/amol/hgg/mainline/linux/Makefile:1156: vmlinux] Error 2


Thanks,
Warm Regards,
Harith