Skip to content

Commit

Permalink
Kbuild: enable TRIM_UNUSED_KSYMS again, with some guarding
Browse files Browse the repository at this point in the history
In commit 5cf0fd5 ("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 <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Jessica Yu <[email protected]>
Cc: Cristoph Hellwig <[email protected]>,
Cc: Miroslav Benes <[email protected]>
Cc: Emil Velikov <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Feb 24, 2021
1 parent c03c21b commit a555bdd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2273,8 +2273,8 @@ config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
If unsure, say N.

config TRIM_UNUSED_KSYMS
bool "Trim unused exported kernel symbols"
depends on BROKEN
bool "Trim unused exported kernel symbols" if EXPERT
depends on !COMPILE_TEST
help
The kernel and some modules make many symbols available for
other modules to use via EXPORT_SYMBOL() and variants. Depending
Expand Down

0 comments on commit a555bdd

Please sign in to comment.