From: Randy Dunlap <rdunlap@infradead.org>
To: linux-kernel@vger.kernel.org
Cc: Randy Dunlap <rdunlap@infradead.org>,
Masahiro Yamada <masahiroy@kernel.org>,
Michal Marek <michal.lkml@markovi.net>,
linux-kbuild@vger.kernel.org, Jeff Dike <jdike@addtoit.com>,
Richard Weinberger <richard@nod.at>,
Anton Ivanov <anton.ivanov@cambridgegreys.com>,
linux-um@lists.infradead.org
Subject: [PATCH] uml: fix W=1 missing-include-dirs warnings
Date: Wed, 14 Apr 2021 12:26:57 -0700 [thread overview]
Message-ID: <20210414192657.17764-1-rdunlap@infradead.org> (raw)
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
next reply other threads:[~2021-04-14 19:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 19:26 Randy Dunlap [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210414192657.17764-1-rdunlap@infradead.org \
--to=rdunlap@infradead.org \
--cc=anton.ivanov@cambridgegreys.com \
--cc=jdike@addtoit.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-um@lists.infradead.org \
--cc=masahiroy@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®