Skip to content

Commit aaeed6e

Browse files
nathanchancePeter Zijlstra
authored andcommitted
x86/Kconfig: Do not allow CONFIG_X86_X32_ABI=y with llvm-objcopy
There are two outstanding issues with CONFIG_X86_X32_ABI and llvm-objcopy, with similar root causes: 1. llvm-objcopy does not properly convert .note.gnu.property when going from x86_64 to x86_x32, resulting in a corrupted section when linking: ClangBuiltLinux#1141 2. llvm-objcopy produces corrupted compressed debug sections when going from x86_64 to x86_x32, also resulting in an error when linking: ClangBuiltLinux#514 After commit 41c5ef3 ("x86/ibt: Base IBT bits"), the .note.gnu.property section is always generated when CONFIG_X86_KERNEL_IBT is enabled, which causes the first issue to become visible with an allmodconfig build: ld.lld: error: arch/x86/entry/vdso/vclock_gettime-x32.o:(.note.gnu.property+0x1c): program property is too short To avoid this error, do not allow CONFIG_X86_X32_ABI to be selected when using llvm-objcopy. If the two issues ever get fixed in llvm-objcopy, this can be turned into a feature check. Signed-off-by: Nathan Chancellor <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 83a44a4 commit aaeed6e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/x86/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2864,6 +2864,11 @@ config IA32_AOUT
28642864
config X86_X32_ABI
28652865
bool "x32 ABI for 64-bit mode"
28662866
depends on X86_64
2867+
# llvm-objcopy does not convert x86_64 .note.gnu.property or
2868+
# compressed debug sections to x86_x32 properly:
2869+
# https://github.com/ClangBuiltLinux/linux/issues/514
2870+
# https://github.com/ClangBuiltLinux/linux/issues/1141
2871+
depends on $(success,$(OBJCOPY) --version | head -n1 | grep -qv llvm)
28672872
help
28682873
Include code to run binaries for the x32 native 32-bit ABI
28692874
for 64-bit processors. An x32 process gets access to the

0 commit comments

Comments
 (0)