mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
kbuild: prevent CC_FLAGS_LTO self-bloating on recursive rebuilds
CC_FLAGS_LTO gets initialized only via +=, never with := or =.
When building with CONFIG_TRIM_UNUSED_KSYMS, Kbuild may perform
several kernel rebuilds to satisfy symbol dependencies. In this
case, value of CC_FLAGS_LTO is concatenated each time, which
triggers a full rebuild.
Initialize it with := to fix this.
Fixes: dc5723b02e ("kbuild: add support for Clang LTO")
Signed-off-by: Alexander Lobakin <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
This commit is contained in:
1 parent
112b6a8e03
commit
2b86895205
1 file changed
+2
-2
@@ -895,10 +895,10 @@ endif
|
||||
|
||||
ifdef CONFIG_LTO_CLANG
|
||||
ifdef CONFIG_LTO_CLANG_THIN
|
||||
CC_FLAGS_LTO += -flto=thin -fsplit-lto-unit
|
||||
CC_FLAGS_LTO := -flto=thin -fsplit-lto-unit
|
||||
KBUILD_LDFLAGS += --thinlto-cache-dir=$(extmod-prefix).thinlto-cache
|
||||
else
|
||||
CC_FLAGS_LTO += -flto
|
||||
CC_FLAGS_LTO := -flto
|
||||
endif
|
||||
CC_FLAGS_LTO += -fvisibility=hidden
|
||||
|
||||
|
||||
Reference in new issue
Block a user