Re: [PATCH 02/22] kbuild: add support for Clang LTO
From: Sami Tolvanen <samitolvanen@google.com>
Date: 2020-06-24 21:29:12
Also in:
linux-arch, linux-kbuild, linux-pci, lkml
From: Sami Tolvanen <samitolvanen@google.com>
Date: 2020-06-24 21:29:12
Also in:
linux-arch, linux-kbuild, linux-pci, lkml
On Wed, Jun 24, 2020 at 01:53:52PM -0700, Nick Desaulniers wrote:
On Wed, Jun 24, 2020 at 1:32 PM Sami Tolvanen [off-list ref] wrote:quoted
diff --git a/Makefile b/Makefile index ac2c61c37a73..0c7fe6fb2143 100644 --- a/Makefile +++ b/Makefile@@ -886,6 +886,22 @@ KBUILD_CFLAGS += $(CC_FLAGS_SCS) export CC_FLAGS_SCS endif +ifdef CONFIG_LTO_CLANG +ifdef CONFIG_THINLTO +CC_FLAGS_LTO_CLANG := -flto=thin $(call cc-option, -fsplit-lto-unit)The kconfig change gates this on clang-11; do we still need the cc-option check here, or can we hardcode the use of -fsplit-lto-unit? Playing with the flag in godbolt, it looks like clang-8 had support for this flag.
True, we don't need cc-option here anymore. I'll remove it, thanks.
quoted
+KBUILD_LDFLAGS += --thinlto-cache-dir=.thinlto-cacheIt might be nice to have `make distclean` or even `make clean` scrub the .thinlto-cache? Also, I verified that the `.gitignore` rule for `.*` properly ignores this dir.
Sure, distclean sounds appropriate to me. Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel