This is a note to let you know that I've just added the patch titled Makefile: lto: Pass -warn-stack-size only on LLD < 13.0.0 to the 5.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: makefile-lto-pass-warn-stack-size-only-on-lld-13.0.0.patch and it can be found in the queue-5.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 0236526d76b87c1dc2cbe3eb31ae29be5b0ca151 Mon Sep 17 00:00:00 2001 From: Tor Vic <torvic9@xxxxxxxxxxx> Date: Sun, 13 Jun 2021 13:07:49 +0000 Subject: Makefile: lto: Pass -warn-stack-size only on LLD < 13.0.0 From: Tor Vic <torvic9@xxxxxxxxxxx> commit 0236526d76b87c1dc2cbe3eb31ae29be5b0ca151 upstream. Since LLVM commit fc018eb, the '-warn-stack-size' flag has been dropped [1], leading to the following error message when building with Clang-13 and LLD-13: ld.lld: error: -plugin-opt=-: ld.lld: Unknown command line argument '-warn-stack-size=2048'. Try: 'ld.lld --help' ld.lld: Did you mean '--asan-stack=2048'? In the same way as with commit 2398ce80152a ("x86, lto: Pass -stack-alignment only on LLD < 13.0.0") , make '-warn-stack-size' conditional on LLD < 13.0.0. [1] https://reviews.llvm.org/D103928 Fixes: 24845dcb170e ("Makefile: LTO: have linker check -Wframe-larger-than") Cc: stable@xxxxxxxxxxxxxxx Link: https://github.com/ClangBuiltLinux/linux/issues/1377 Signed-off-by: Tor Vic <torvic9@xxxxxxxxxxx> Reviewed-by: Nathan Chancellor <nathan@xxxxxxxxxx> Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx> Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx> Link: https://lore.kernel.org/r/7631bab7-a8ab-f884-ab54-f4198976125c@xxxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/Makefile +++ b/Makefile @@ -913,11 +913,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) Patches currently in stable-queue which might be from torvic9@xxxxxxxxxxx are queue-5.12/makefile-lto-pass-warn-stack-size-only-on-lld-13.0.0.patch