author: Tor Vic <torvic9@mailbox.org> 2021-06-13 13:07:49 +0000
committer: Kees Cook <keescook@chromium.org> 2021-06-14 14:52:38 -0700
commit: 0236526d76b87c1dc2cbe3eb31ae29be5b0ca151
parent: 2398ce80152aae33b9501ef54452e09e8e8d4262
Commit Summary:
Diffstat:
1 file changed, 4 insertions, 1 deletion
diff --git a/Makefile b/Makefile
index 144d4f8b7eb3..51a1b6b2c2ab 100644
--- a/Makefile
+++ b/Makefile
@@ -929,11 +929,14 @@ CC_FLAGS_LTO += -fvisibility=hidden
# Limit inlining across translation units to reduce binary size
KBUILD_LDFLAGS += -mllvm -import-instr-limit=5
-# Check for frame size exceeding threshold during prolog/epilog insertion.
+# Check for frame size exceeding threshold during prolog/epilog insertion
+# when using lld < 13.0.0.
ifneq ($(CONFIG_FRAME_WARN),0)
+ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 130000; echo $$?),0)
KBUILD_LDFLAGS += -plugin-opt=-warn-stack-size=$(CONFIG_FRAME_WARN)
endif
endif
+endif
ifdef CONFIG_LTO
KBUILD_CFLAGS += -fno-lto $(CC_FLAGS_LTO)