On Wed, Feb 24, 2021 at 11:46 PM Masahiro Yamada <masahi...@kernel.org> wrote:
>
> On Wed, Feb 24, 2021 at 11:13 PM Jessica Yu <j...@kernel.org> wrote:
> >
> > +++ Christoph Hellwig [24/02/21 08:52 +0100]:
> > >On Tue, Feb 23, 2021 at 12:07:39PM -0800, Linus Torvalds wrote:
> > >> On Tue, Feb 23, 2021 at 12:03 PM Linus Torvalds
> > >> <torva...@linux-foundation.org> wrote:
> > >> >
> > >> > This is unacceptably slow. If that symbol trimming takes 30% of the
> > >> > whole kernel build time, it needs to be fixed or removed.
> > >>
> > >> I think I'm going to mark TRIM_UNUSED_KSYMS as "depends on BROKEN".
> > >> There's no way I can accept that horrible overhead, and the rationale
> > >> for that config option is questionable at best,
> > >
> > >I think it is pretty useful for embedded setups.
> > >
> > >BROKEN seems pretty strong for something that absolutely works as
> > >intendended.  I guess to make you (and possibly others) not grumpy
> > >we just need to ensure it doesn't get pulled in by allmodconfig.
> > >
> > >So maybe just invert the symbol, default the KEEP_UNUSED_SYMBOL, and
> > >add a message to the helptext explaining the slowdown?
> >
> > Hm, something like this maybe? (untested)
>

A patch attached, if Linus is OK to re-enable this.



-- 
Best Regards
Masahiro Yamada
From 2eb88648aff9547d1c10df841d1ac61ac2369df6 Mon Sep 17 00:00:00 2001
From: Masahiro Yamada <masahi...@kernel.org>
Date: Wed, 24 Feb 2021 23:52:54 +0900
Subject: [PATCH] Kbuild: re-enable TRIM_UNUSED_KSYMS under the condition of
 !COMPILE_TEST

This option is useful for embedded systems, and acutally used by the
MIPS generic_defconfig. Commit 1518c633df78 ("kbuild: allow symbol
whitelisting with TRIM_UNUSED_KSYMS") also states this is used by
Android Generic Kernel Image. I guess somebody will start complaining.

Disable this only for COMPILE_TEST so it is hidden for all{yes,mod}config.

Fixes: 5cf0fd591f2e ("Kbuild: disable TRIM_UNUSED_KSYMS option")
Signed-off-by: Masahiro Yamada <masahi...@kernel.org>
---
 init/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init/Kconfig b/init/Kconfig
index 2ff0b5a50736..135e2129e04b 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -2273,7 +2273,7 @@ config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS
 
 config TRIM_UNUSED_KSYMS
 	bool "Trim unused exported kernel symbols"
-	depends on BROKEN
+	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
-- 
2.27.0

Reply via email to