@@ -265,3 +265,12 @@ os-win32.o: qemu-options.def
qemu-options.def: $(SRC_PATH)/qemu-options.hx
$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
+
+######################################################################
+# poison TARGET_arch to prevent from creeping those defines again.
+
+POISON_CFLAGS = -include poison-arch.h
+$(qobject-obj-y) $(block-obj-y) $(block-nested-y) $(block-obj-y) \
+$(net-obj-y) $(net-nested-y) $(fsdev-nested-y) $(fsdev-obj-y) \
+$(common-obj-y) $(audio-obj-y) $(slirp-obj-y) $(user-obj-y) \
+$(hw-obj-y) $(sound-obj-y) $(libdis-y) vl.o: QEMU_CFLAGS += $(POISON_CFLAGS)
new file mode 100644
@@ -0,0 +1,25 @@
+/* Poison identifiers that should not be used when building
+ target independent device code. */
+
+#ifndef HW_POISON_ARCH_H
+#define HW_POISON_ARCH_H
+#ifdef __GNUC__
+
+#pragma GCC poison TARGET_I386
+#pragma GCC poison TARGET_X86_64
+#pragma GCC poison TARGET_ALPHA
+#pragma GCC poison TARGET_ARM
+#pragma GCC poison TARGET_CRIS
+#pragma GCC poison TARGET_M68K
+#pragma GCC poison TARGET_MIPS
+#pragma GCC poison TARGET_MIPS64
+#pragma GCC poison TARGET_PPC
+#pragma GCC poison TARGET_PPCEMB
+#pragma GCC poison TARGET_PPC64
+#pragma GCC poison TARGET_ABI32
+#pragma GCC poison TARGET_SH4
+#pragma GCC poison TARGET_SPARC
+#pragma GCC poison TARGET_SPARC64
+
+#endif
+#endif
@@ -5,21 +5,7 @@
#define HW_POISON_H
#ifdef __GNUC__
-#pragma GCC poison TARGET_I386
-#pragma GCC poison TARGET_X86_64
-#pragma GCC poison TARGET_ALPHA
-#pragma GCC poison TARGET_ARM
-#pragma GCC poison TARGET_CRIS
-#pragma GCC poison TARGET_M68K
-#pragma GCC poison TARGET_MIPS
-#pragma GCC poison TARGET_MIPS64
-#pragma GCC poison TARGET_PPC
-#pragma GCC poison TARGET_PPCEMB
-#pragma GCC poison TARGET_PPC64
-#pragma GCC poison TARGET_ABI32
-#pragma GCC poison TARGET_SH4
-#pragma GCC poison TARGET_SPARC
-#pragma GCC poison TARGET_SPARC64
+#include "poison-arch.h"
#pragma GCC poison TARGET_WORDS_BIGENDIAN
#pragma GCC poison BSWAP_NEEDED
poison TARGET_<ARCH> for compile once object to prevent those ifdef from creeping in again. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> --- Makefile.objs | 9 +++++++++ poison-arch.h | 25 +++++++++++++++++++++++++ poison.h | 16 +--------------- 3 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 poison-arch.h