From patchwork Fri Jun 25 03:02:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 56884 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 24A1CB6F17 for ; Fri, 25 Jun 2010 13:08:02 +1000 (EST) Received: from localhost ([127.0.0.1]:44734 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORzGp-0007Pe-Dn for incoming@patchwork.ozlabs.org; Thu, 24 Jun 2010 23:07:59 -0400 Received: from [140.186.70.92] (port=46092 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ORzFR-0006l9-0Q for qemu-devel@nongnu.org; Thu, 24 Jun 2010 23:06:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ORzFP-0004Yk-F6 for qemu-devel@nongnu.org; Thu, 24 Jun 2010 23:06:32 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:39091) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ORzFO-0004YO-VS for qemu-devel@nongnu.org; Thu, 24 Jun 2010 23:06:31 -0400 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id 07E0B107510; Fri, 25 Jun 2010 12:06:27 +0900 (JST) Received: (nullmailer pid 4719 invoked by uid 1000); Fri, 25 Jun 2010 03:02:40 -0000 Date: Fri, 25 Jun 2010 12:02:40 +0900 From: Isaku Yamahata To: qemu-devel@nongnu.org Message-ID: <20100625030240.GJ4498@valinux.co.jp> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: amit.shah@redhat.com, pbonzini@redhat.com, blauwirbel@gmail.com, rth@twiddle.net Subject: [Qemu-devel] [PATCH v2] Makefile: poison TARGET_xxx for compile once. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org poison TARGET_xxx for compile once object to prevent those ifdef from creeping in again. didn't poison env which is used as function argument as void *env. Although it would be possible to sort it out, for now just not poison it. qemu-malloc.c didn't compile, so I make it non compile-once for now. It is linked via block-obj-y in Makefile.obj and common-obj-y in Makefile.objs through block-obj-y. So qemu-malloc.o is explicitly added to rules. Signed-off-by: Isaku Yamahata --- Changes v1 -> v2: - tried to poison not only TARGET_ but also TARGET_xxx. - fix link breakage. --- Makefile | 10 +++++----- Makefile.objs | 11 ++++++++++- Makefile.target | 2 +- poison.h | 2 ++ 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 221fbd8..233b2b1 100644 --- a/Makefile +++ b/Makefile @@ -79,8 +79,8 @@ ifneq ($(wildcard config-host.mak),) include $(SRC_PATH)/Makefile.objs endif -$(common-obj-y): $(GENERATED_HEADERS) -$(filter %-softmmu,$(SUBDIR_RULES)): $(common-obj-y) subdir-libdis +$(common-obj-y) qemu-malloc.o: $(GENERATED_HEADERS) +$(filter %-softmmu,$(SUBDIR_RULES)): $(common-obj-y) qemu-malloc.o subdir-libdis $(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) subdir-libdis-user subdir-libuser @@ -137,11 +137,11 @@ iov.o: iov.c iov.h qemu-img.o: qemu-img-cmds.h qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o: $(GENERATED_HEADERS) -qemu-img$(EXESUF): qemu-img.o qemu-tool.o qemu-error.o $(block-obj-y) $(qobject-obj-y) +qemu-img$(EXESUF): qemu-img.o qemu-tool.o qemu-error.o qemu-malloc.o $(block-obj-y) $(qobject-obj-y) -qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o $(block-obj-y) $(qobject-obj-y) +qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o qemu-malloc.o $(block-obj-y) $(qobject-obj-y) -qemu-io$(EXESUF): qemu-io.o cmd.o qemu-tool.o qemu-error.o $(block-obj-y) $(qobject-obj-y) +qemu-io$(EXESUF): qemu-io.o cmd.o qemu-tool.o qemu-error.o qemu-malloc.o $(block-obj-y) $(qobject-obj-y) qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $@") diff --git a/Makefile.objs b/Makefile.objs index 53fb68e..15764c4 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -7,7 +7,7 @@ qobject-obj-y += qerror.o ####################################################################### # block-obj-y is code used by both qemu system emulation and qemu-img -block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o +block-obj-y = cutils.o cache-utils.o qemu-option.o module.o block-obj-y += nbd.o block.o aio.o aes.o osdep.o qemu-config.o block-obj-$(CONFIG_POSIX) += posix-aio-compat.o block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o @@ -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.h -DDONT_POISON_ENV +$(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/Makefile.target b/Makefile.target index f64702b..91160b6 100644 --- a/Makefile.target +++ b/Makefile.target @@ -295,7 +295,7 @@ monitor.o: qemu-monitor.h $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) -obj-y += $(addprefix ../, $(common-obj-y)) +obj-y += $(addprefix ../, $(common-obj-y) qemu-malloc.o) obj-y += $(addprefix ../libdis/, $(libdis-y)) obj-y += $(libobj-y) obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y)) diff --git a/poison.h b/poison.h index d7db7f4..43af79a 100644 --- a/poison.h +++ b/poison.h @@ -34,7 +34,9 @@ #pragma GCC poison TARGET_PAGE_ALIGN #pragma GCC poison CPUState +#ifndef DONT_POISON_ENV #pragma GCC poison env +#endif #pragma GCC poison CPU_INTERRUPT_HARD #pragma GCC poison CPU_INTERRUPT_EXITTB