Skip to contentSkip to conversation

ARM: Make UNWINDER_ARM depend on ld.bfd or ld.lld 11.0.0+

PATCH In review Nathan Chancellor 2 participants 2 messages Mar 11, 2021 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Make UNWINDER_ARM depend on ld.bfd or ld.lld 11.0.0+

When linking aspeed_g5_defconfig with ld.lld 10.0.1, the following error occurs:

ld.lld: error: .tmp_vmlinux.kallsyms1:(.ARM.exidx+0x34D98): relocation R_ARM_PREL31 out of range: 2135538592 is not in [-1073741824, 1073741823]

This was resolved in ld.lld 11.0.0 but the minimum supported version of ld.lld for the kernel is 10.0.1. Prevent CONFIG_UNWINDER_ARM from being selected in this case so that the problematic sections cannot be created.

---
 arch/arm/Kconfig.debug | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/Kconfig.debug +2 -0
index 9e0b5e7f12af..64c1f8a46ab5 100644
@@ -66,6 +66,8 @@ config UNWINDER_FRAME_POINTER
 config UNWINDER_ARM
 	bool "ARM EABI stack unwinder"
 	depends on AEABI && !FUNCTION_GRAPH_TRACER
+	# https://github.com/ClangBuiltLinux/linux/issues/732
+	depends on !LD_IS_LLD || LLD_VERSION >= 110000
 	select ARM_UNWIND
 	help
 	  This option enables stack unwinding support in the kernel

base-commit: a38fd8748464831584a19438cbb3082b5a2dab15

Signature · 1 line
2.31.0.rc1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Nathan Chancellor

When linking aspeed_g5_defconfig with ld.lld 10.0.1, the following error occurs:

ld.lld: error: .tmp_vmlinux.kallsyms1:(.ARM.exidx+0x34D98): relocation R_ARM_PREL31 out of range: 2135538592 is not in [-1073741824, 1073741823]

This was resolved in ld.lld 11.0.0 but the minimum supported version of ld.lld for the kernel is 10.0.1. Prevent CONFIG_UNWINDER_ARM from being selected in this case so that the problematic sections cannot be created.

Quoted 4 lines

Thanks for the patch. We discussed at the kernelCI meeting yesterday and the clangbuiltlinux meeting today continuing coverage for kernel builds with clang-10, so this is still worthwhile IMO at least for randconfig testing not to select known broken configs when using older tools. We can rip it out once we bump the minimum supported version of clang.

Quoted 20 lines
---
 arch/arm/Kconfig.debug | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/Kconfig.debug +2 -0
index 9e0b5e7f12af..64c1f8a46ab5 100644
@@ -66,6 +66,8 @@ config UNWINDER_FRAME_POINTER
 config UNWINDER_ARM
        bool "ARM EABI stack unwinder"
        depends on AEABI && !FUNCTION_GRAPH_TRACER
+       # https://github.com/ClangBuiltLinux/linux/issues/732
+       depends on !LD_IS_LLD || LLD_VERSION >= 110000
        select ARM_UNWIND
        help
          This option enables stack unwinding support in the kernel

base-commit: a38fd8748464831584a19438cbb3082b5a2dab15 --

Signature · 2 lines
Thanks,
~Nick Desaulniers