Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: Use -isystem instead of -I to include headers

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>

authored by

Muhammad Usama Anjum and committed by
Shuah Khan
46e50459 68169686

+2 -2
+2 -2
tools/testing/selftests/Makefile
··· 129 129 # $(realpath ...) resolves symlinks 130 130 abs_objtree := $(realpath $(abs_objtree)) 131 131 BUILD := $(abs_objtree)/kselftest 132 - KHDR_INCLUDES := -I${abs_objtree}/usr/include 132 + KHDR_INCLUDES := -isystem ${abs_objtree}/usr/include 133 133 else 134 134 BUILD := $(CURDIR) 135 135 abs_srctree := $(shell cd $(top_srcdir) && pwd) 136 - KHDR_INCLUDES := -I${abs_srctree}/usr/include 136 + KHDR_INCLUDES := -isystem ${abs_srctree}/usr/include 137 137 DEFAULT_INSTALL_HDR_PATH := 1 138 138 endif 139 139