The patch titled Subject: selftests: use -isystem instead of -I to include headers has been added to the -mm tree. Its filename is selftests-use-isystem-instead-of-i-to-include-headers.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/selftests-use-isystem-instead-of-i-to-include-headers.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/selftests-use-isystem-instead-of-i-to-include-headers.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx> Subject: 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 redefinition warnings from compiler. These warnings can be suppressed by using -isystem to include the uapi headers. Link: https://lkml.kernel.org/r/20220214160756.3543590-1-usama.anjum@xxxxxxxxxxxxx Signed-off-by: Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx> Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx> Reviewed-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/tools/testing/selftests/Makefile~selftests-use-isystem-instead-of-i-to-include-headers +++ a/tools/testing/selftests/Makefile @@ -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 _ Patches currently in -mm which might be from usama.anjum@xxxxxxxxxxxxx are selftests-set-the-build-variable-to-absolute-path.patch selftests-add-and-export-a-kernel-uapi-headers-path.patch selftests-correct-the-headers-install-path.patch selftests-futex-add-the-uapi-headers-include-variable.patch selftests-kvm-add-the-uapi-headers-include-variable.patch selftests-landlock-add-the-uapi-headers-include-variable.patch selftests-net-add-the-uapi-headers-include-variable.patch selftests-mptcp-add-the-uapi-headers-include-variable.patch selftests-vm-add-the-uapi-headers-include-variable.patch selftests-vm-remove-dependecy-from-internal-kernel-macros.patch selftests-use-isystem-instead-of-i-to-include-headers.patch