Skip to content

Commit

Permalink
Kbuild: disable TRIM_UNUSED_KSYMS option
Browse files Browse the repository at this point in the history
The removal of EXPORT_UNUSED_SYMBOL() in commit 3679482 looks like
(and was sold as) a no-op, but it actually had a rather serious and
subtle side effect: the UNUSED_SYMBOLS option not only enabled the
removed (unused) functionality, it also _disabled_ the TRIM_UNUSED_KSYMS
functionality.

And it turns out that TRIM_UNUSED_KSYMS is a huge time waste, and takes
up a third of the kernel build time for me.  For no actual upside, since
no distro is likely to ever be able to enable it (because they all
support external kernel modules).

Rather than re-enable EXPORT_UNUSED_SYMBOL, this just disables the
TRIM_UNUSED_KSYMS option by marking it broken.  I'm tempted to just
remove the support entirely, but maybe somebody has a use-case and can
fix the behavior of it.

I could have just disabled it for COMPILE_TEST, but it really smells
like the TRIM_UNUSED_KSYMS option is badly done and not really useful,
so this takes the more direct approach - let's see if anybody ever
actually notices or complains.

Cc: Miroslav Benes <[email protected]>
Cc: Emil Velikov <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Jessica Yu <[email protected]>
Fixes: 3679482 ("module: remove EXPORT_UNUSED_SYMBOL*")
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Feb 23, 2021
1 parent 21a6ab2 commit 5cf0fd5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2274,6 +2274,7 @@ config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS

config TRIM_UNUSED_KSYMS
bool "Trim unused exported kernel symbols"
depends on BROKEN
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 5cf0fd5

Please sign in to comment.