Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Kbuild: enable TRIM_UNUSED_KSYMS again, with some guarding

In commit 5cf0fd591f2e ("Kbuild: disable TRIM_UNUSED_KSYMS option") I
disabled this option because it's hugely expensive at build time, and I
questioned how much use it gets.

Several people piped up and convinced me it's actually useful, so
instead of disabling it entirely, it now depends on EXPERT and gets
disabled by COMPILE_TEST builds so that 'allmodconfig' style things
don't enable it.

I still hope somebody will take a look at the build time issue, because
as Arnd also noted:

"However, the combination of thinlto and trim indeed has a steep cost
in compile time, taking almost twice as long as a normal defconfig
(gc-sections makes it slightly faster)"

Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Arnd Bergmann <arnd@kernel.org>
Cc: Jessica Yu <jeyu@kernel.org>
Cc: Cristoph Hellwig <hch@lst.de>,
Cc: Miroslav Benes <mbenes@suse.cz>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+2 -2
+2 -2
init/Kconfig
··· 2273 2273 If unsure, say N. 2274 2274 2275 2275 config TRIM_UNUSED_KSYMS 2276 - bool "Trim unused exported kernel symbols" 2277 - depends on BROKEN 2276 + bool "Trim unused exported kernel symbols" if EXPERT 2277 + depends on !COMPILE_TEST 2278 2278 help 2279 2279 The kernel and some modules make many symbols available for 2280 2280 other modules to use via EXPORT_SYMBOL() and variants. Depending