[PATCH 1/2] ARM: Require linker to support KEEP within OVERLAY for DCE
Rob Landley
rob at landley.net
Fri Jul 4 12:15:18 PDT 2025
On 3/13/25 03:48, Linus Walleij wrote:
> On Tue, Mar 11, 2025 at 8:43 PM Nathan Chancellor <nathan at kernel.org> wrote:
>
>> ld.lld prior to 21.0.0 does not support using the KEEP keyword within an
>> overlay description, which may be needed to avoid discarding necessary
>> sections within an overlay with '--gc-sections', which can be enabled
>> for the kernel via CONFIG_LD_DEAD_CODE_DATA_ELIMINATION.
>>
>> Disallow CONFIG_LD_DEAD_CODE_DATA_ELIMINATION without support for KEEP
>> within OVERLAY and introduce a macro, OVERLAY_KEEP, that can be used to
>> conditionally add KEEP when it is properly supported to avoid breaking
>> old versions of ld.lld.
I bisected the 6.15 armv7l build break my mkroot project hit to this
commit (e7607f7d6d81):
LD .tmp_vmlinux1
Segmentation fault
make[2]: *** [scripts/Makefile.vmlinux:77: vmlinux] Error 139
make[1]: ***
[/home/landley/toybox/clean/root/build/armv7l-tmp/linux/Makefile:1226:
vmlinux] Error 2
make: *** [Makefile:251: __sub-make] Error 2
The toolchain in question was built from gcc 11.4.0 and binutils 2.33.1
which were the newest versions supported by
https://github.com/richfelker/musl-cross-make when the still-current
musl release (1.2.5) came out.
You can grab a binary toolchain to smoketest with from
https://landley.net/bin/toolchains/latest/armv7l-linux-musleabihf-cross.tar.xz
and build using the attached miniconfig ala:
for i in distclean allnoconfig ""
do
CROSS_COMPILE=armv7l-linux-musleabihf- make ARCH=arm \
KCONFIG_ALLCONFIG=linux-miniconfig -j4 $i
done
This _just_ seems to affect armv7l: armv5l and aarch64 still build fine.
Rob
P.S. Rich has since added newer gcc version support to MCM, but:
A) the binutils in MCM is still stuck at the old version and if you
upgrade the gcc without the binutils it hits
https://lkml.org/lkml/2023/8/9/890
B) I'm waiting for musl-1.2.6 before updating the toolchain.
-------------- next part --------------
# make ARCH=arm allnoconfig KCONFIG_ALLCONFIG=linux-miniconfig
# make ARCH=arm -j $(nproc)
# boot zImage console=ttyAMA0
# architecture independent
CONFIG_PANIC_TIMEOUT=1
CONFIG_NO_HZ_IDLE=y
CONFIG_HIGH_RES_TIMERS=y
CONFIG_RD_GZIP=y
CONFIG_BINFMT_ELF=y
CONFIG_BINFMT_SCRIPT=y
CONFIG_BLK_DEV=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_BLK_DEV_LOOP=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_USE_FOR_EXT2=y
CONFIG_VFAT_FS=y
CONFIG_FAT_DEFAULT_UTF8=y
CONFIG_MISC_FILESYSTEMS=y
CONFIG_NLS_CODEPAGE_437=y
CONFIG_NLS_ISO8859_1=y
CONFIG_SQUASHFS=y
CONFIG_SQUASHFS_XATTR=y
CONFIG_SQUASHFS_ZLIB=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_NET=y
CONFIG_NETDEVICES=y
CONFIG_NET_CORE=y
CONFIG_NETCONSOLE=y
CONFIG_PACKET=y
CONFIG_UNIX=y
CONFIG_INET=y
CONFIG_IPV6=y
CONFIG_ETHERNET=y
CONFIG_COMPAT_32BIT_TIME=y
CONFIG_EARLY_PRINTK=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
# architecture specific
CONFIG_MMU=y
CONFIG_SOC_DRA7XX=y
CONFIG_VDSO=y
CONFIG_CPU_IDLE=y
CONFIG_KERNEL_MODE_NEON=y
CONFIG_ARCH_MULTI_V7=y
CONFIG_ARCH_VIRT=y
CONFIG_ARCH_OMAP2PLUS_TYPICAL=y
CONFIG_ARCH_ALPINE=y
CONFIG_ARM_THUMB=y
CONFIG_ARM_CPUIDLE=y
CONFIG_ARM_LPAE=y
CONFIG_ATA=y
CONFIG_ATA_SFF=y
CONFIG_ATA_BMDMA=y
CONFIG_ATA_PIIX=y
CONFIG_ATA_GENERIC=y
CONFIG_VIRTIO_MENU=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_MMIO=y
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_HCTOSYS=y
CONFIG_RTC_DRV_PL031=y
CONFIG_PATA_PLATFORM=y
CONFIG_PATA_OF_PLATFORM=y
CONFIG_PCI=y
CONFIG_PCI_HOST_GENERIC=y
# architecture extra
More information about the linux-arm-kernel
mailing list