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

make: switch from -I to -iquote

Our rule right now is to use <> for external headers,
"" for internal ones. The idea was to avoid conflicts
between e.g. a system file named <trace.h> and an
internal one by the same name.

Unfortunately we use -I compiler flag so it does not
help: a system file doing #include <trace.h> will
still pick up ours first.

To fix, switch to -iquote which is supported by both
gcc and clang and only affects #include "" directives.

As a side effect, this catches any future uses of
#include <> for internal headers.

Suggested-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>

authored by

Michael S. Tsirkin and committed by
Marcel Apfelbaum
9edc19c9 0efc9511

+11 -11
+2 -2
Makefile.target
··· 11 11 ifdef CONFIG_LINUX 12 12 QEMU_CFLAGS += -I../linux-headers 13 13 endif 14 - QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target/$(TARGET_BASE_ARCH) -DNEED_CPU_H 14 + QEMU_CFLAGS += -iquote .. -iquote $(SRC_PATH)/target/$(TARGET_BASE_ARCH) -DNEED_CPU_H 15 15 16 - QEMU_CFLAGS+=-I$(SRC_PATH)/include 16 + QEMU_CFLAGS+=-iquote $(SRC_PATH)/include 17 17 18 18 ifdef CONFIG_USER_ONLY 19 19 # user emulator name
+8 -8
configure
··· 534 534 QEMU_CFLAGS="-Wall -Wundef -Wwrite-strings -Wmissing-prototypes $QEMU_CFLAGS" 535 535 QEMU_CFLAGS="-Wstrict-prototypes -Wredundant-decls $QEMU_CFLAGS" 536 536 QEMU_CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE $QEMU_CFLAGS" 537 - QEMU_INCLUDES="-I. -I\$(SRC_PATH) -I\$(SRC_PATH)/accel/tcg -I\$(SRC_PATH)/include" 537 + QEMU_INCLUDES="-iquote . -iquote \$(SRC_PATH) -iquote \$(SRC_PATH)/accel/tcg -iquote \$(SRC_PATH)/include" 538 538 if test "$debug_info" = "yes"; then 539 539 CFLAGS="-g $CFLAGS" 540 540 LDFLAGS="-g $LDFLAGS" ··· 6600 6600 fi 6601 6601 6602 6602 if test "$tcg_interpreter" = "yes"; then 6603 - QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" 6603 + QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" 6604 6604 elif test "$ARCH" = "sparc64" ; then 6605 - QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" 6605 + QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/sparc $QEMU_INCLUDES" 6606 6606 elif test "$ARCH" = "s390x" ; then 6607 - QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" 6607 + QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/s390 $QEMU_INCLUDES" 6608 6608 elif test "$ARCH" = "x86_64" -o "$ARCH" = "x32" ; then 6609 - QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" 6609 + QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/i386 $QEMU_INCLUDES" 6610 6610 elif test "$ARCH" = "ppc64" ; then 6611 - QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/ppc $QEMU_INCLUDES" 6611 + QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/ppc $QEMU_INCLUDES" 6612 6612 else 6613 - QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" 6613 + QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/\$(ARCH) $QEMU_INCLUDES" 6614 6614 fi 6615 - QEMU_INCLUDES="-I\$(SRC_PATH)/tcg $QEMU_INCLUDES" 6615 + QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg $QEMU_INCLUDES" 6616 6616 6617 6617 echo "TOOLS=$tools" >> $config_host_mak 6618 6618 echo "ROMS=$roms" >> $config_host_mak
+1 -1
rules.mak
··· 29 29 # dir, one absolute and the other relative to the compiler working 30 30 # directory. These are the same for target-independent files, but 31 31 # different for target-dependent ones. 32 - QEMU_LOCAL_INCLUDES = -I$(BUILD_DIR)/$(@D) -I$(@D) 32 + QEMU_LOCAL_INCLUDES = -iquote $(BUILD_DIR)/$(@D) -iquote $(@D) 33 33 34 34 WL_U := -Wl,-u, 35 35 find-symbols = $(if $1, $(sort $(shell $(NM) -P -g $1 | $2)))