Re: [PATCH] kbuild: Disable extra debugging info in .s output

Masahiro Yamada
2019-02-01T11:58:56Z

On Fri, Feb 1, 2019 at 7:38 PM Borislav Petkov <bp@alien8.de> wrote:
>
> On Fri, Feb 01, 2019 at 11:30:38AM +0100, Borislav Petkov wrote:
> > This can't be a full kernel build.
>
> So I did this:
>
> $(obj)/%.s: $(src)/%.c FORCE
> @echo "HERE\n"
> $(call if_changed_dep,cc_s_c)
>
> and did a full kernel build with my .config. I got exactly *three*
> "HERE"s in the build log.
>
> So pls explain in more detail how you're measuring that slowdown.

Variables assigned with ':=' are evaluated just on parsing Makefile.

The scripts/Makefile.build is parsed over and over again,
so the compiler is invoked hundreds times to test these four options
even when you are not actually building any new objects.

It is mitigated by replacing ':=' with '=',
but they are still evaluated multiple times when generating asm-offset.

Frankly, you cannot use cc-option in scripts/Makefile.build

Your next question might be,
"Is it OK to implement this in the top Makefile?"

It would be better, but I am not convinced to do it.

--
Best Regards
Masahiro Yamada