[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 32/61] Use -isystem for linux-headers dir
From: |
Paolo Bonzini |
Subject: |
[PULL 32/61] Use -isystem for linux-headers dir |
Date: |
Mon, 16 Mar 2020 22:26:59 +0100 |
From: Eduardo Habkost <address@hidden>
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>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
Makefile.target | 2 +-
configure | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile.target b/Makefile.target
index 2d43dc5..934a9f7 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 44a70cf..06fcd07 100755
--- a/configure
+++ b/configure
@@ -900,7 +900,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"
;;
--
1.8.3.1
- [PULL 17/61] qom/object: enable setter for uint types, (continued)
- [PULL 17/61] qom/object: enable setter for uint types, Paolo Bonzini, 2020/03/16
- [PULL 21/61] i386: Fix GCC warning with snprintf when HAX is enabled, Paolo Bonzini, 2020/03/16
- [PULL 20/61] qom/object: Use common get/set uint helpers, Paolo Bonzini, 2020/03/16
- [PULL 22/61] WHPX: Use proper synchronization primitives while processing, Paolo Bonzini, 2020/03/16
- [PULL 23/61] Makefile: Align 'help' target output, Paolo Bonzini, 2020/03/16
- [PULL 24/61] Makefile: Let the 'help' target list the tools targets, Paolo Bonzini, 2020/03/16
- [PULL 25/61] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss, Paolo Bonzini, 2020/03/16
- [PULL 26/61] hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB, Paolo Bonzini, 2020/03/16
- [PULL 27/61] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB, Paolo Bonzini, 2020/03/16
- [PULL 28/61] ui/curses: Make control_characters[] array const, Paolo Bonzini, 2020/03/16
- [PULL 32/61] Use -isystem for linux-headers dir,
Paolo Bonzini <=
- [PULL 29/61] ui/curses: Move arrays to .heap to save 74KiB of .bss, Paolo Bonzini, 2020/03/16
- [PULL 31/61] softmmu/vl.c: Handle '-cpu help' and '-device help' before 'no default machine', Paolo Bonzini, 2020/03/16
- [PULL 33/61] exec/rom_reset: Free rom data during inmigrate skip, Paolo Bonzini, 2020/03/16
- [PULL 36/61] lockable: add QemuRecMutex support, Paolo Bonzini, 2020/03/16
- [PULL 40/61] scripts/cocci: Patch to replace memory_region_init_{ram, readonly -> rom}, Paolo Bonzini, 2020/03/16
- [PULL 35/61] lockable: add lock guards, Paolo Bonzini, 2020/03/16
- [PULL 42/61] hw/display: Use memory_region_init_rom() with read-only regions, Paolo Bonzini, 2020/03/16
- [PULL 30/61] qemu-cpu-models.rst: Document -noTSX, mds-no, taa-no, and tsx-ctrl, Paolo Bonzini, 2020/03/16
- [PULL 34/61] cpus: avoid pause_all_vcpus getting stuck due to race, Paolo Bonzini, 2020/03/16
- [PULL 37/61] memory: Correctly return alias region type, Paolo Bonzini, 2020/03/16