All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Francis <alistair.francis@xilinx.com>
To: xen-devel@lists.xenproject.org
Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com,
	imhy.yang@gmail.com, rshriram@cs.ubc.ca, alistair23@gmail.com,
	"Yann E. MORIN" <yann.morin.1998@free.fr>
Subject: [PATCH 3/7] xen/Rules.mk: fix build with CFLAGS from environment
Date: Fri, 16 Dec 2016 14:56:03 -0800	[thread overview]
Message-ID: <1481928967-4130-4-git-send-email-alistair.francis@xilinx.com> (raw)
In-Reply-To: <1481928967-4130-1-git-send-email-alistair.francis@xilinx.com>

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

When CFLAGS are passed from the environment, the first-level make
invocation will append -D__OBJECT_FILE__ to it, then call a second
make invocation, that will have those new CFLAGS in its environment,
but will also append -D__OBJECT_FILE__ to those.

Then, the compiler fails because __OBEJECT_FILE__ is defined twice.

Just undefine it before defining it again, as a *workaround* to this
issue.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 xen/Rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 24d13dc..f8b8c2c 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -49,7 +49,7 @@ endif
 CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
-CFLAGS += '-D__OBJECT_FILE__="$@"'
+CFLAGS += -U__OBJECT_FILE__ '-D__OBJECT_FILE__="$@"'
 
 ifneq ($(clang),y)
 # Clang doesn't understand this command line argument, and doesn't appear to
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2016-12-16 22:58 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16 22:56 [PATCH 0/7] General Build Fixes Alistair Francis
2016-12-16 22:56 ` [PATCH 1/7] Remove hardcoded strict -Werror checking Alistair Francis
2016-12-17 15:51   ` Konrad Rzeszutek Wilk
2016-12-19 17:58     ` Alistair Francis
2016-12-20  3:53     ` Doug Goldstein
2016-12-20 16:05       ` Konrad Rzeszutek Wilk
2016-12-20 17:02         ` Doug Goldstein
2016-12-20 17:21           ` Konrad Rzeszutek Wilk
2016-12-20 17:57             ` Alistair Francis
2016-12-20 17:58       ` Alistair Francis
2016-12-16 22:56 ` [PATCH 2/7] tools/libxl: " Alistair Francis
2016-12-17 15:52   ` Konrad Rzeszutek Wilk
2016-12-16 22:56 ` Alistair Francis [this message]
2016-12-17 15:54   ` [PATCH 3/7] xen/Rules.mk: fix build with CFLAGS from environment Konrad Rzeszutek Wilk
2016-12-19  8:32   ` Jan Beulich
2016-12-16 22:56 ` [PATCH 4/7] tools: Update sys/poll.h to poll.h Alistair Francis
2016-12-17 15:55   ` Konrad Rzeszutek Wilk
2016-12-19 18:01     ` Alistair Francis
2016-12-20  4:00       ` Doug Goldstein
2016-12-20 17:44         ` Alistair Francis
2016-12-16 22:56 ` [PATCH 5/7] tools/blktap2: Update sys/signal.h to signal.h Alistair Francis
2016-12-17 15:56   ` Konrad Rzeszutek Wilk
2016-12-19 18:02     ` Alistair Francis
2016-12-20  4:01       ` Doug Goldstein
2016-12-16 22:56 ` [PATCH 6/7] tools/blktap2/vhd: Remove unused struct stat stats Alistair Francis
2016-12-17 15:57   ` Konrad Rzeszutek Wilk
2016-12-16 22:56 ` [PATCH 7/7] tools/blktap2: Fix missing header file Alistair Francis

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=1481928967-4130-4-git-send-email-alistair.francis@xilinx.com \
    --to=alistair.francis@xilinx.com \
    --cc=alistair23@gmail.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=imhy.yang@gmail.com \
    --cc=rshriram@cs.ubc.ca \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yann.morin.1998@free.fr \
    /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.