]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests: Use -isystem instead of -I to include headers
authorMuhammad Usama Anjum <usama.anjum@collabora.com>
Mon, 14 Feb 2022 16:07:56 +0000 (21:07 +0500)
committerShuah Khan <skhan@linuxfoundation.org>
Thu, 24 Feb 2022 00:25:02 +0000 (17:25 -0700)
Selftests need kernel headers and glibc for compilation. In compilation
of selftests, uapi headers from kernel source are used instead of
default ones while glibc has already been compiled with different header
files installed in the operating system. So there can be redefination
warnings from compiler. These warnings can be suppressed by using
-isystem to include the uapi headers.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/Makefile

index 80e5498eab92adb716cd9c82ee8bcc499c40dd72..5d9d4ddccccb1de74708b11f6551ac8e90016932 100644 (file)
@@ -129,11 +129,11 @@ ifneq ($(KBUILD_OUTPUT),)
   # $(realpath ...) resolves symlinks
   abs_objtree := $(realpath $(abs_objtree))
   BUILD := $(abs_objtree)/kselftest
-  KHDR_INCLUDES := -I${abs_objtree}/usr/include
+  KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include
 else
   BUILD := $(CURDIR)
   abs_srctree := $(shell cd $(top_srcdir) && pwd)
-  KHDR_INCLUDES := -I${abs_srctree}/usr/include
+  KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include
   DEFAULT_INSTALL_HDR_PATH := 1
 endif