All of lore.kernel.org
 help / color / mirror / Atom feed
From: Isaku Yamahata <yamahata@valinux.co.jp>
To: qemu-devel@nongnu.org
Cc: amit.shah@redhat.com, pbonzini@redhat.com, blauwirbel@gmail.com
Subject: [Qemu-devel] [PATCH] poison TARGET_<ARCH> for compile once.
Date: Thu, 24 Jun 2010 15:52:53 +0900	[thread overview]
Message-ID: <20100624065253.GA4498@valinux.co.jp> (raw)

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

diff --git a/Makefile.objs b/Makefile.objs
index 53fb68e..3438195 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -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)
diff --git a/poison-arch.h b/poison-arch.h
new file mode 100644
index 0000000..8143c41
--- /dev/null
+++ b/poison-arch.h
@@ -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
diff --git a/poison.h b/poison.h
index d7db7f4..f9efae9 100644
--- a/poison.h
+++ b/poison.h
@@ -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
-- 
1.6.6.1

             reply	other threads:[~2010-06-24  6:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-24  6:52 Isaku Yamahata [this message]
2010-06-24  7:14 ` [Qemu-devel] [PATCH] poison TARGET_<ARCH> for compile once Isaku Yamahata
2010-06-24 11:09   ` Paolo Bonzini
2010-06-24 18:41   ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100624065253.GA4498@valinux.co.jp \
    --to=yamahata@valinux.co.jp \
    --cc=amit.shah@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.