* [PATCH] uml: fix W=1 missing-include-dirs warnings
@ 2021-04-14 19:26 Randy Dunlap
2021-04-15 6:52 ` Masahiro Yamada
0 siblings, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2021-04-14 19:26 UTC (permalink / raw)
To: linux-kernel
Cc: Randy Dunlap, Masahiro Yamada, Michal Marek, linux-kbuild,
Jeff Dike, Richard Weinberger, Anton Ivanov, linux-um
Currently when using "W=1" with UML builds, there are over 700 warnings
like so:
CC arch/um/drivers/stderr_console.o
cc1: warning: ./arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
but arch/um/ does not have include/uapi/ at all, so don't
include arch/um/include/uapi/ in USERINCLUDE for UML.
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: linux-kbuild@vger.kernel.org
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: linux-um@lists.infradead.org
---
Makefile | 10 ++++++++++
1 file changed, 10 insertions(+)
Option 2: change the setting of USERINCLUDE. This could alter
(a) build times and
(b) which header files get used: if there are multiple
header files named foobar.h in the $(USERINCLUDE)
subdirectories, this Option changes the order in which
they would be found.
- linux-next-20210413.orig/Makefile
+ linux-next-20210413/Makefile
@@ -501,13 +501,16 @@ LDFLAGS_vmlinux =
# Use USERINCLUDE when you must reference the UAPI directories only.
USERINCLUDE := \
- -I$(srctree)/arch/$(SRCARCH)/include/uapi \
-I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \
-I$(srctree)/include/uapi \
-I$(objtree)/include/generated/uapi \
-include $(srctree)/include/linux/compiler-version.h \
-include $(srctree)/include/linux/kconfig.h
+ifneq ($(ARCH),um)
+USERINCLUDE += -I$(srctree)/arch/$(SRCARCH)/include/uapi
+endif
+
# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
LINUXINCLUDE := \
Option 3: modify scripts/Makefile.extrawarn not to set
-Wmissing-include-dirs for arch=um. I think that this is not
a good idea: it could cause valid problem reports not to be
reported.
Option 4: simply mkdir arch/um/include/uapi
That's what I did first, just as a test, and it works.
--- linux-next-20210413.orig/Makefile
+++ linux-next-20210413/Makefile
@@ -500,6 +500,15 @@ AFLAGS_KERNEL =
LDFLAGS_vmlinux =
# Use USERINCLUDE when you must reference the UAPI directories only.
+# Note: arch/um/ does not have an include/uapi/ subdir.
+ifeq ($(ARCH),um)
+USERINCLUDE := \
+ -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \
+ -I$(srctree)/include/uapi \
+ -I$(objtree)/include/generated/uapi \
+ -include $(srctree)/include/linux/compiler-version.h \
+ -include $(srctree)/include/linux/kconfig.h
+else
USERINCLUDE := \
-I$(srctree)/arch/$(SRCARCH)/include/uapi \
-I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \
@@ -507,6 +516,7 @@ USERINCLUDE := \
-I$(objtree)/include/generated/uapi \
-include $(srctree)/include/linux/compiler-version.h \
-include $(srctree)/include/linux/kconfig.h
+endif
# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] uml: fix W=1 missing-include-dirs warnings
2021-04-14 19:26 [PATCH] uml: fix W=1 missing-include-dirs warnings Randy Dunlap
@ 2021-04-15 6:52 ` Masahiro Yamada
2021-04-15 7:01 ` Randy Dunlap
0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2021-04-15 6:52 UTC (permalink / raw)
To: Randy Dunlap
Cc: Linux Kernel Mailing List, Michal Marek,
Linux Kbuild mailing list, Jeff Dike, Richard Weinberger,
Anton Ivanov, linux-um
On Thu, Apr 15, 2021 at 4:27 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> Currently when using "W=1" with UML builds, there are over 700 warnings
> like so:
>
> CC arch/um/drivers/stderr_console.o
> cc1: warning: ./arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
>
> but arch/um/ does not have include/uapi/ at all, so don't
> include arch/um/include/uapi/ in USERINCLUDE for UML.
>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: linux-kbuild@vger.kernel.org
> Cc: Jeff Dike <jdike@addtoit.com>
> Cc: Richard Weinberger <richard@nod.at>
> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com>
> Cc: linux-um@lists.infradead.org
> ---
> Makefile | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> Option 2: change the setting of USERINCLUDE. This could alter
> (a) build times and
> (b) which header files get used: if there are multiple
> header files named foobar.h in the $(USERINCLUDE)
> subdirectories, this Option changes the order in which
> they would be found.
>
> - linux-next-20210413.orig/Makefile
> + linux-next-20210413/Makefile
> @@ -501,13 +501,16 @@ LDFLAGS_vmlinux =
>
> # Use USERINCLUDE when you must reference the UAPI directories only.
> USERINCLUDE := \
> - -I$(srctree)/arch/$(SRCARCH)/include/uapi \
> -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \
> -I$(srctree)/include/uapi \
> -I$(objtree)/include/generated/uapi \
> -include $(srctree)/include/linux/compiler-version.h \
> -include $(srctree)/include/linux/kconfig.h
>
> +ifneq ($(ARCH),um)
> +USERINCLUDE += -I$(srctree)/arch/$(SRCARCH)/include/uapi
> +endif
> +
> # Use LINUXINCLUDE when you must reference the include/ directory.
> # Needed to be compatible with the O= option
> LINUXINCLUDE := \
>
> Option 3: modify scripts/Makefile.extrawarn not to set
> -Wmissing-include-dirs for arch=um. I think that this is not
> a good idea: it could cause valid problem reports not to be
> reported.
>
> Option 4: simply mkdir arch/um/include/uapi
> That's what I did first, just as a test, and it works.
I like Option 4.
But, you cannot do "mkdir -p arch/um/include/uapi" at build-time
because the build system should not touch the source tree(, which
might be read-only)
for O= building.
How about adding
arch/um/include/uapi/asm/Kbuild,
which is just having a SPDX one-liner?
>
> --- linux-next-20210413.orig/Makefile
> +++ linux-next-20210413/Makefile
> @@ -500,6 +500,15 @@ AFLAGS_KERNEL =
> LDFLAGS_vmlinux =
>
> # Use USERINCLUDE when you must reference the UAPI directories only.
> +# Note: arch/um/ does not have an include/uapi/ subdir.
> +ifeq ($(ARCH),um)
> +USERINCLUDE := \
> + -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \
> + -I$(srctree)/include/uapi \
> + -I$(objtree)/include/generated/uapi \
> + -include $(srctree)/include/linux/compiler-version.h \
> + -include $(srctree)/include/linux/kconfig.h
> +else
> USERINCLUDE := \
> -I$(srctree)/arch/$(SRCARCH)/include/uapi \
> -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \
> @@ -507,6 +516,7 @@ USERINCLUDE := \
> -I$(objtree)/include/generated/uapi \
> -include $(srctree)/include/linux/compiler-version.h \
> -include $(srctree)/include/linux/kconfig.h
> +endif
>
> # Use LINUXINCLUDE when you must reference the include/ directory.
> # Needed to be compatible with the O= option
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] uml: fix W=1 missing-include-dirs warnings
2021-04-15 6:52 ` Masahiro Yamada
@ 2021-04-15 7:01 ` Randy Dunlap
2021-04-15 7:04 ` Masahiro Yamada
0 siblings, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2021-04-15 7:01 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Linux Kernel Mailing List, Michal Marek,
Linux Kbuild mailing list, Jeff Dike, Richard Weinberger,
Anton Ivanov, linux-um
On 4/14/21 11:52 PM, Masahiro Yamada wrote:
> On Thu, Apr 15, 2021 at 4:27 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> Currently when using "W=1" with UML builds, there are over 700 warnings
>> like so:
>>
>> CC arch/um/drivers/stderr_console.o
>> cc1: warning: ./arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
>>
>> but arch/um/ does not have include/uapi/ at all, so don't
>> include arch/um/include/uapi/ in USERINCLUDE for UML.
>> Option 4: simply mkdir arch/um/include/uapi
>> That's what I did first, just as a test, and it works.
>
>
> I like Option 4.
>
> But, you cannot do "mkdir -p arch/um/include/uapi" at build-time
> because the build system should not touch the source tree(, which
> might be read-only)
> for O= building.
>
> How about adding
>
> arch/um/include/uapi/asm/Kbuild,
>
> which is just having a SPDX one-liner?
Wow! :)
That's what Al Viro suggested also.
I'll submit that patch later today (Thursday my time).
thanks.
--
~Randy
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] uml: fix W=1 missing-include-dirs warnings
2021-04-15 7:01 ` Randy Dunlap
@ 2021-04-15 7:04 ` Masahiro Yamada
2021-04-15 16:03 ` Randy Dunlap
0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2021-04-15 7:04 UTC (permalink / raw)
To: Randy Dunlap
Cc: Linux Kernel Mailing List, Michal Marek,
Linux Kbuild mailing list, Jeff Dike, Richard Weinberger,
Anton Ivanov, linux-um
On Thu, Apr 15, 2021 at 4:02 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> On 4/14/21 11:52 PM, Masahiro Yamada wrote:
> > On Thu, Apr 15, 2021 at 4:27 AM Randy Dunlap <rdunlap@infradead.org> wrote:
> >>
> >> Currently when using "W=1" with UML builds, there are over 700 warnings
> >> like so:
> >>
> >> CC arch/um/drivers/stderr_console.o
> >> cc1: warning: ./arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
> >>
> >> but arch/um/ does not have include/uapi/ at all, so don't
> >> include arch/um/include/uapi/ in USERINCLUDE for UML.
>
>
> >> Option 4: simply mkdir arch/um/include/uapi
> >> That's what I did first, just as a test, and it works.
> >
> >
> > I like Option 4.
> >
> > But, you cannot do "mkdir -p arch/um/include/uapi" at build-time
> > because the build system should not touch the source tree(, which
> > might be read-only)
> > for O= building.
> >
> > How about adding
> >
> > arch/um/include/uapi/asm/Kbuild,
> >
> > which is just having a SPDX one-liner?
>
> Wow! :)
> That's what Al Viro suggested also.
> I'll submit that patch later today (Thursday my time).
>
> thanks.
> --
> ~Randy
>
BTW, after fixing this UML problem,
can we move -Wmissing-include-dirs to the top Makefile?
Is there any other source of -Wmissing-include-dirs
warnings?
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] uml: fix W=1 missing-include-dirs warnings
2021-04-15 7:04 ` Masahiro Yamada
@ 2021-04-15 16:03 ` Randy Dunlap
0 siblings, 0 replies; 5+ messages in thread
From: Randy Dunlap @ 2021-04-15 16:03 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Linux Kernel Mailing List, Michal Marek,
Linux Kbuild mailing list, Jeff Dike, Richard Weinberger,
Anton Ivanov, linux-um
On 4/15/21 12:04 AM, Masahiro Yamada wrote:
> On Thu, Apr 15, 2021 at 4:02 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> On 4/14/21 11:52 PM, Masahiro Yamada wrote:
>>> On Thu, Apr 15, 2021 at 4:27 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>>>>
>>>> Currently when using "W=1" with UML builds, there are over 700 warnings
>>>> like so:
>>>>
>>>> CC arch/um/drivers/stderr_console.o
>>>> cc1: warning: ./arch/um/include/uapi: No such file or directory [-Wmissing-include-dirs]
>>>>
>>>> but arch/um/ does not have include/uapi/ at all, so don't
>>>> include arch/um/include/uapi/ in USERINCLUDE for UML.
>>
>>
>>>> Option 4: simply mkdir arch/um/include/uapi
>>>> That's what I did first, just as a test, and it works.
>>>
>>>
>>> I like Option 4.
>>>
>>> But, you cannot do "mkdir -p arch/um/include/uapi" at build-time
>>> because the build system should not touch the source tree(, which
>>> might be read-only)
>>> for O= building.
>>>
>>> How about adding
>>>
>>> arch/um/include/uapi/asm/Kbuild,
>>>
>>> which is just having a SPDX one-liner?
>>
>> Wow! :)
>> That's what Al Viro suggested also.
>> I'll submit that patch later today (Thursday my time).
>>
>> thanks.
>> --
>> ~Randy
>>
>
>
> BTW, after fixing this UML problem,
> can we move -Wmissing-include-dirs to the top Makefile?
I don't see why not. And eventually remove this one:
fs/btrfs/Makefile:subdir-ccflags-y += -Wmissing-include-dirs
> Is there any other source of -Wmissing-include-dirs
> warnings?
I can't give a full answer on that; only that I haven't
seen any others and also that all other arch/*/include/
do have a uapi/ subdir.
--
~Randy
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-04-15 16:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-14 19:26 [PATCH] uml: fix W=1 missing-include-dirs warnings Randy Dunlap
2021-04-15 6:52 ` Masahiro Yamada
2021-04-15 7:01 ` Randy Dunlap
2021-04-15 7:04 ` Masahiro Yamada
2021-04-15 16:03 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).