Re: [regression ?] kbuild: fix building bzImage with CONFIG_TRIM_UNUSED_KSYMS enabled

From: Nicolas Pitre
Date: Thu Dec 08 2016 - 22:40:28 EST


On Fri, 9 Dec 2016, Sergey Senozhatsky wrote:

> On (12/09/16 11:43), Sergey Senozhatsky wrote:
> >
> > after 53924022d8a ("kbuild: fix building bzImage withCONFIG_TRIM_UNUSED_KSYMS
> > enabled") all of my build scripts build the kernel without the modules.
>
> [..]
> > +# For the kernel to actually contain only the needed exported symbols,
> > +# we have to build modules as well to determine what those symbols are.
> > +# (this can be evaluated only once include/config/auto.conf has been included)
> ^^^^^
>
> ah, the config. so the patch is wrong.

Furthermore, the export statement exports the variable not its value.
Even if the value is changed afterwards, referencing the exported
variable will see the new value.

You can try out this little Makefile to prove it:

FOOBAR := 0
export FOOBAR
FOOBAR := 1
all:
echo FOOBAR is $$FOOBAR


Nicolas