From patchwork Wed Jul 9 20:34:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 33348 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0F227208CF for ; Wed, 9 Jul 2014 20:37:27 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id hy10sf25929066vcb.9 for ; Wed, 09 Jul 2014 13:37:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:message-id:user-agent :mime-version:cc:subject:precedence:list-id:list-unsubscribe :list-post:list-help:list-subscribe:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=hzCzXgv5YC8lk21q0MlrJzwYwtAeAYqg14LpwNO0q6s=; b=StSFQoFRkQbLQH873Op52ao2kr2ThAVhtMb1ULwP6gAWsrS8/mfZSNGFmLhpYpkM3b b4+F09oYstCFqrBjtF6VwkGJfbcVcRnqAZ4ENlOr4WZloqPCJAVph9I5wFBa13Lp0br6 DiYjvC7BuOBZR1pNgU+ikt9QgSqc86Xboys+aj0pof2L4qPqcU3zDVpVIxcrPP23sxoy H4zdoQ8erIaUqnszbr8IA/v+YRnh9c2N5I7kgXqln/rnXvv+tIFFJEIACaZGO/zfoiaM YwgUT6z2171Ex4k3TjlCbl5Hr7DahpzQLVt3co2656Dowd3DRjKAyF0FmoOl5FaMa9Xm /apw== X-Gm-Message-State: ALoCoQkKRCxSoel983fwPijFrwjhhjd40imT2w9+Yuv858RxmqM5dtx7p/RzqSiq/z7sGT54b1ml X-Received: by 10.236.66.105 with SMTP id g69mr18564675yhd.11.1404938247781; Wed, 09 Jul 2014 13:37:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.34.147 with SMTP id l19ls1559583qgl.42.gmail; Wed, 09 Jul 2014 13:37:27 -0700 (PDT) X-Received: by 10.52.244.35 with SMTP id xd3mr48851vdc.71.1404938247696; Wed, 09 Jul 2014 13:37:27 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id bo12si22090876veb.23.2014.07.09.13.37.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Jul 2014 13:37:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so8321070vcb.35 for ; Wed, 09 Jul 2014 13:37:27 -0700 (PDT) X-Received: by 10.220.203.134 with SMTP id fi6mr41808243vcb.18.1404938247598; Wed, 09 Jul 2014 13:37:27 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp76609vcb; Wed, 9 Jul 2014 13:37:27 -0700 (PDT) X-Received: by 10.52.138.7 with SMTP id qm7mr23955179vdb.7.1404938247168; Wed, 09 Jul 2014 13:37:27 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id ig16si18688225vec.99.2014.07.09.13.37.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 09 Jul 2014 13:37:27 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X4yaE-0006LJ-0S; Wed, 09 Jul 2014 20:35:18 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X4yaC-0006LE-W9 for xen-devel@lists.xensource.com; Wed, 09 Jul 2014 20:35:17 +0000 Received: from [85.158.143.35:50401] by server-2.bemta-4.messagelabs.com id 5E/B1-18579-487ADB35; Wed, 09 Jul 2014 20:35:16 +0000 X-Env-Sender: Stefano.Stabellini@citrix.com X-Msg-Ref: server-14.tower-21.messagelabs.com!1404938112!16981619!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5932 invoked from network); 9 Jul 2014 20:35:13 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 9 Jul 2014 20:35:13 -0000 X-IronPort-AV: E=Sophos;i="5.01,633,1400025600"; d="scan'208";a="151112787" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 09 Jul 2014 20:35:12 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.3.181.6; Wed, 9 Jul 2014 16:35:11 -0400 Received: from kaball.uk.xensource.com ([10.80.2.59]) by ukmail1.uk.xensource.com with esmtp (Exim 4.69) (envelope-from ) id 1X4ya7-00013J-IN; Wed, 09 Jul 2014 21:35:11 +0100 Date: Wed, 9 Jul 2014 21:34:26 +0100 From: Stefano Stabellini X-X-Sender: sstabellini@kaball.uk.xensource.com To: Peter Maydell Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-DLP: MIA1 Cc: xen-devel@lists.xensource.com, qemu-devel@nongnu.org, Stefano Stabellini Subject: [Xen-devel] [PATCH] pass $($*.o-cflags) first to gcc/g++ X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: stefano.stabellini@eu.citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: rules.mak adds cflags specific to the target source file ($($@-cflags)) for last on the compiler command line. As a consequence when compiling arm-a64.o, g++ might end up picking the wrong utils.h header file, because it looks for utils.h on all the other include paths first. Fix the issue by passing the source file specific cflags first. Do it consisently for *.c, *.cc, etc. Signed-off-by: Stefano Stabellini diff --git a/rules.mak b/rules.mak index ba2f4c1..da825e7 100644 --- a/rules.mak +++ b/rules.mak @@ -28,7 +28,7 @@ expand-objs = $(strip $(sort $(filter %.o,$1)) \ $(filter-out %.o %.mo,$1)) %.o: %.c - $(call quiet-command,$(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) -c -o $@ $<," CC $(TARGET_DIR)$@") + $(call quiet-command,$(CC) $($@-cflags) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@") %.o: %.rc $(call quiet-command,$(WINDRES) -I. -o $@ $<," RC $(TARGET_DIR)$@") @@ -42,7 +42,7 @@ LINK = $(call quiet-command, $(LINKPROG) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o else LIBTOOL += $(if $(V),,--quiet) %.lo: %.c - $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($*.o-cflags) -c -o $@ $<," lt CC $@") + $(call quiet-command,$(LIBTOOL) --mode=compile --tag=CC $(CC) $($*.o-cflags) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," lt CC $@") %.lo: %.rc $(call quiet-command,$(LIBTOOL) --mode=compile --tag=RC $(WINDRES) -I. -o $@ $<,"lt RC $(TARGET_DIR)$@") %.lo: %.dtrace @@ -63,13 +63,13 @@ endif $(call quiet-command,$(AS) $(ASFLAGS) -o $@ $<," AS $(TARGET_DIR)$@") %.o: %.cc - $(call quiet-command,$(CXX) $(QEMU_INCLUDES) $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) -c -o $@ $<," CXX $(TARGET_DIR)$@") + $(call quiet-command,$(CXX) $($@-cflags) $(QEMU_INCLUDES) $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CXX $(TARGET_DIR)$@") %.o: %.cpp - $(call quiet-command,$(CXX) $(QEMU_INCLUDES) $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) -c -o $@ $<," CXX $(TARGET_DIR)$@") + $(call quiet-command,$(CXX) $($@-cflags) $(QEMU_INCLUDES) $(QEMU_CXXFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CXX $(TARGET_DIR)$@") %.o: %.m - $(call quiet-command,$(OBJCC) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) $($@-cflags) -c -o $@ $<," OBJC $(TARGET_DIR)$@") + $(call quiet-command,$(OBJCC) $($@-cflags) $(QEMU_INCLUDES) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@") %.o: %.dtrace $(call quiet-command,dtrace -o $@ -G -s $<, " GEN $(TARGET_DIR)$@")