[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/2] Use -isystem for linux-headers dir
From: |
Eduardo Habkost |
Subject: |
[PATCH v2 1/2] Use -isystem for linux-headers dir |
Date: |
Wed, 11 Mar 2020 19:23:41 -0400 |
glibc and Linux-provided headers are known to generate macro
redefinition warnings when used together. For example:
<linux/mman.h> and <sys/mman.h> duplicate some macro definitions.
We normally never see those warnings because GCC suppresses
warnings generated by system headers. We carry our own copy of
Linux header files, though, and this makes those warnings not be
suppressed when glibc headers are included before Linux headers
(e.g. if <sys/mman.h> is included before <linux/mman.h>).
Use -isystem instead of -I for linux-headers. This makes the
compiler treat our linux-headers directory the same way it treats
system-provided Linux headers, and suppress warnings generated by
them.
Signed-off-by: Eduardo Habkost <address@hidden>
---
Changes v1 -> v2:
* Use -isystem for $PWD/linux-headers too
Reported-by: "Michael S. Tsirkin" <address@hidden>
---
Makefile.target | 2 +-
configure | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile.target b/Makefile.target
index 2d43dc586a..934a9f7431 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -12,7 +12,7 @@ endif
$(call set-vpath, $(SRC_PATH):$(BUILD_DIR))
ifdef CONFIG_LINUX
-QEMU_CFLAGS += -I../linux-headers
+QEMU_CFLAGS += -isystem ../linux-headers
endif
QEMU_CFLAGS += -iquote .. -iquote $(SRC_PATH)/target/$(TARGET_BASE_ARCH)
-DNEED_CPU_H
diff --git a/configure b/configure
index cbf864bff1..bf5bf70600 100755
--- a/configure
+++ b/configure
@@ -899,7 +899,7 @@ Linux)
linux="yes"
linux_user="yes"
kvm="yes"
- QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$PWD/linux-headers
$QEMU_INCLUDES"
+ QEMU_INCLUDES="-isystem \$(SRC_PATH)/linux-headers -isystem
$PWD/linux-headers $QEMU_INCLUDES"
supported_os="yes"
libudev="yes"
;;
--
2.24.1
- [PATCH v2 0/2] Fix MAP_SYNC support when host has older glibc version, Eduardo Habkost, 2020/03/11
- [PATCH v2 1/2] Use -isystem for linux-headers dir,
Eduardo Habkost <=
- [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX, Eduardo Habkost, 2020/03/11
- Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX, Michael S. Tsirkin, 2020/03/12
- Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX, Eduardo Habkost, 2020/03/15
- Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX, Michael S. Tsirkin, 2020/03/15
- Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX, Eduardo Habkost, 2020/03/16
- Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX, Peter Maydell, 2020/03/16
- Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX, Eduardo Habkost, 2020/03/16
- Re: [PATCH v2 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX, Michael S. Tsirkin, 2020/03/16