lkml.org 
[lkml]   [2021]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/2] kconfig: unify cc-option and as-option
On Wed, May 5, 2021 at 5:17 AM Johannes Berg <johannes@sipsolutions.net> wrote:
>
> Hi,
>
> So... I realized it's been a while:
>
> On Sun, 2020-06-14 at 23:43 +0900, Masahiro Yamada wrote:
> > cc-option and as-option are almost the same; both pass the flag to
> > $(CC). The main difference is the cc-option stops before the assemble
> > stage (-S option) whereas as-option stops after it (-c option).
> >
>
> But, I had noticed for a while now that M= build for an out-of-tree
> driver were causing some trouble. Not really completely "out-of-tree"
> but rather backported (https://backports.wiki.kernel.org/).
>
> And then I finally narrowed it down to this commit, specifically this:
>
> > # Return y if the compiler supports <flag>, n otherwise
> > -cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -S -x c /dev/null -o /dev/null)
> > +cc-option = $(success,mkdir .tmp_$$$$; trap "rm -rf .tmp_$$$$" EXIT; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$$$/tmp.o)
>
> What happens is that we're doing
>
> make -C /path/to/kernel M=/path/to/driver
>
> But /path/to/kernel may be the installed distro kernel headers, and thus
> not be writable to the user doing the driver compile. Obviously, the
> user may need to 'sudo' anyway to install the result, but if just test-
> compiling, or even as better practice to not run everything as root,
> this ".tmp_$$" dir cannot be created.
>
> IOW, this broke compiler option detection when KBUILD_EXTMOD=/M= is
> used. It seems this is still supported (documented in kbuild docs), so
> I'm kind of hoping it could be fixed? But OTOH, I really don't know how,
> perhaps just using "mktemp -d" here instead of the hardcoded temp dir?
>
> Thanks,
> johannes
>


- This commit touches scripts/Kconfig.include.
- External module builds (M= builds) never invoke Kconfig

Putting these two together, your claim is really odd.
If external module builds invoke Kconfig,
your kernel is already broken.

If you claim this is an issue,
please describe how to reproduce it in *upstream* kernel.
I do not know (or care about) your backport kernel.


--
Best Regards
Masahiro Yamada

\
 
 \ /
  Last update: 2021-05-04 22:49    [W:0.056 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site