scripts/mod: disable LTO for empty.c
authorSami Tolvanen <samitolvanen@google.com>
Fri, 11 Dec 2020 18:46:28 +0000 (10:46 -0800)
committerKees Cook <keescook@chromium.org>
Thu, 14 Jan 2021 16:21:09 +0000 (08:21 -0800)
With CONFIG_LTO_CLANG, clang generates LLVM IR instead of ELF object
files. As empty.o is used for probing target properties, disable LTO
for it to produce an object file instead.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20201211184633.3213045-12-samitolvanen@google.com
scripts/mod/Makefile

index 78071681d924225d7b6083de13c7c58b031fe07d..c9e38ad937fd4549ceb716e05067f0339005ee56 100644 (file)
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 OBJECT_FILES_NON_STANDARD := y
+CFLAGS_REMOVE_empty.o += $(CC_FLAGS_LTO)
 
 hostprogs-always-y     += modpost mk_elfconfig
 always-y               += empty.o