Re: [PATCH 2/2] kconfig: unify cc-option and as-option
From: Masahiro Yamada
Date: Tue May 04 2021 - 17:06:44 EST
On Wed, May 5, 2021 at 5:52 AM Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
>
> On Wed, 2021-05-05 at 05:46 +0900, Masahiro Yamada wrote:
> >
> > - This commit touches scripts/Kconfig.include.
> > - External module builds (M= builds) never invoke Kconfig
> >
> > Putting these two together, your claim is really odd.
>
> Hmm.
>
> > If external module builds invoke Kconfig,
> > your kernel is already broken.
>
> Well, it's not about the kernel, that's just the normal upstream (or
> perhaps distribution) kernel.
>
> Anyway, you're right, it's much simpler. The problem isn't invoking M=
> or something like that, that happens much later and sent me on the
> completely wrong track.
>
> The problem is simply doing
>
> make kernelversion
>
> to determine the version of a tree that's not writable to the user, e.g.
>
> make -C /lib/modules/$(uname -r)/build/ kernelversion
>
> Which basically also means that it's harmless, since the version is of
> course not affected by cc-option.
It was fixed.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=805b2e1d427aab4bb27fa7c51ebb9db7547551b1
If you want to make it work without that commit,
make -C /lib/modules/$(uname -r)/build/ kernelversion M=/tmp
will work.
Pass a writable directory to M=.
M= build never touches the kernel source tree.
> johannes
>
--
Best Regards
Masahiro Yamada