qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

Use -isystem for linux-headers dir

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 <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

authored by

Eduardo Habkost and committed by
Paolo Bonzini
67cf3f5c 3df261b6

+2 -2
+1 -1
Makefile.target
··· 12 12 13 13 $(call set-vpath, $(SRC_PATH):$(BUILD_DIR)) 14 14 ifdef CONFIG_LINUX 15 - QEMU_CFLAGS += -I../linux-headers 15 + QEMU_CFLAGS += -isystem ../linux-headers 16 16 endif 17 17 QEMU_CFLAGS += -iquote .. -iquote $(SRC_PATH)/target/$(TARGET_BASE_ARCH) -DNEED_CPU_H 18 18
+1 -1
configure
··· 900 900 linux="yes" 901 901 linux_user="yes" 902 902 kvm="yes" 903 - QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES" 903 + QEMU_INCLUDES="-isystem \$(SRC_PATH)/linux-headers -isystem $PWD/linux-headers $QEMU_INCLUDES" 904 904 supported_os="yes" 905 905 libudev="yes" 906 906 ;;