aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-06-11 16:29:53 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-06-11 16:29:53 -0700
commit548843c096d08b6c24d2aa1b73783da37c96bb0a (patch)
tree3496914c5a726afcf5c46a2e07088d291d284a0c
parente65b7914b2abfff4fde9dcca22bbab99fab5ba05 (diff)
parent2398ce80152aae33b9501ef54452e09e8e8d4262 (diff)
downloadlinux-548843c096d08b6c24d2aa1b73783da37c96bb0a.tar.gz
Merge tag 'clang-features-v5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull clang LTO fix from Kees Cook: "Clang 13 fixed some IR behavior for LTO, but this broke work-arounds used in the kernel. Handle changes to needed LTO flags in Clang 13 (Tor Vic)" * tag 'clang-features-v5.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: x86, lto: Pass -stack-alignment only on LLD < 13.0.0
-rw-r--r--arch/x86/Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 307529417021a..cb5e8d39cac15 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -200,8 +200,9 @@ endif
KBUILD_LDFLAGS += -m elf_$(UTS_MACHINE)
ifdef CONFIG_LTO_CLANG
-KBUILD_LDFLAGS += -plugin-opt=-code-model=kernel \
- -plugin-opt=-stack-alignment=$(if $(CONFIG_X86_32),4,8)
+ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 130000; echo $$?),0)
+KBUILD_LDFLAGS += -plugin-opt=-stack-alignment=$(if $(CONFIG_X86_32),4,8)
+endif
endif
ifdef CONFIG_X86_NEED_RELOCS