* [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc.
@ 2009-10-19 21:24 Scott Wood
2009-10-19 21:42 ` Mike Frysinger
2009-10-19 22:35 ` [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc Wolfgang Denk
0 siblings, 2 replies; 7+ messages in thread
From: Scott Wood @ 2009-10-19 21:24 UTC (permalink / raw)
To: u-boot
If the user has specified a CC or similar on the command line, that is the
cross compiler, not the host compiler. Override is needed to keep these
assignments from being ignored in that case.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
tools/Makefile | 10 +++++-----
tools/gdb/Makefile | 6 +++---
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/Makefile b/tools/Makefile
index 2a9a9fd..6bf3fde 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -139,21 +139,21 @@ LIBFDT_OBJS := $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y))
# Use native tools and options
# Define __KERNEL_STRICT_NAMES to prevent typedef overlaps
#
-CPPFLAGS = -idirafter $(SRCTREE)/include \
+override CPPFLAGS = -idirafter $(SRCTREE)/include \
-idirafter $(OBJTREE)/include2 \
-idirafter $(OBJTREE)/include \
-I $(SRCTREE)/libfdt \
-I $(SRCTREE)/tools \
-DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC \
-D__KERNEL_STRICT_NAMES
-CFLAGS = $(HOSTCFLAGS) $(CPPFLAGS) -O
+override CFLAGS = $(HOSTCFLAGS) $(CPPFLAGS) -O
# No -pedantic switch to avoid libfdt compilation warnings
FIT_CFLAGS = -Wall $(CPPFLAGS) -O
-AFLAGS = -D__ASSEMBLY__ $(CPPFLAGS)
-CC = $(HOSTCC)
-STRIP = $(HOSTSTRIP)
+override AFLAGS = -D__ASSEMBLY__ $(CPPFLAGS)
+override CC = $(HOSTCC)
+override STRIP = $(HOSTSTRIP)
MAKEDEPEND = makedepend
all: $(obj).depend $(BINS) $(LOGO-y) subdirs
diff --git a/tools/gdb/Makefile b/tools/gdb/Makefile
index 0a5687d..dca97f4 100644
--- a/tools/gdb/Makefile
+++ b/tools/gdb/Makefile
@@ -37,9 +37,9 @@ BINS := $(addprefix $(obj),$(BINS))
#
# Use native tools and options
#
-CPPFLAGS = -I$(BFD_ROOT_DIR)/include
-CFLAGS = $(HOSTCFLAGS) -O $(CPPFLAGS)
-CC = $(HOSTCC)
+override CPPFLAGS = -I$(BFD_ROOT_DIR)/include
+override CFLAGS = $(HOSTCFLAGS) -O $(CPPFLAGS)
+override CC = $(HOSTCC)
MAKEDEPEND = makedepend
HOSTOS := $(shell uname -s | sed -e 's/\([Cc][Yy][Gg][Ww][Ii][Nn]\).*/cygwin/')
--
1.6.4.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc.
2009-10-19 21:24 [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc Scott Wood
@ 2009-10-19 21:42 ` Mike Frysinger
2009-10-19 21:56 ` Scott Wood
2009-10-20 21:53 ` [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc Scott Wood
2009-10-19 22:35 ` [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc Wolfgang Denk
1 sibling, 2 replies; 7+ messages in thread
From: Mike Frysinger @ 2009-10-19 21:42 UTC (permalink / raw)
To: u-boot
On Monday 19 October 2009 17:24:35 Scott Wood wrote:
> If the user has specified a CC or similar on the command line, that is the
> cross compiler, not the host compiler. Override is needed to keep these
> assignments from being ignored in that case.
then again, if we didnt mix host and target variable names, this wouldnt be a
problem. in a sane world, all of the host stuff would be HOSTXX (or BUILDXX).
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091019/be800397/attachment.pgp
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc.
2009-10-19 21:42 ` Mike Frysinger
@ 2009-10-19 21:56 ` Scott Wood
2009-10-19 22:37 ` [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS , etc Mike Frysinger
2009-10-20 21:53 ` [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc Scott Wood
1 sibling, 1 reply; 7+ messages in thread
From: Scott Wood @ 2009-10-19 21:56 UTC (permalink / raw)
To: u-boot
Mike Frysinger wrote:
> On Monday 19 October 2009 17:24:35 Scott Wood wrote:
>> If the user has specified a CC or similar on the command line, that is the
>> cross compiler, not the host compiler. Override is needed to keep these
>> assignments from being ignored in that case.
>
> then again, if we didnt mix host and target variable names, this wouldnt be a
> problem. in a sane world, all of the host stuff would be HOSTXX (or BUILDXX).
Right... I initially tried substituting in HOSTCC, but it still tried to
use CC, probably from an implicit rule that would need to be made
explicit in order to use HOSTCC.
I can try to respin it with a new explicit rule if y'all want.
-Scott
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc.
2009-10-19 21:24 [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc Scott Wood
2009-10-19 21:42 ` Mike Frysinger
@ 2009-10-19 22:35 ` Wolfgang Denk
1 sibling, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2009-10-19 22:35 UTC (permalink / raw)
To: u-boot
Dear Scott Wood,
In message <20091019212435.GA31339@loki.buserror.net> you wrote:
> If the user has specified a CC or similar on the command line, that is the
> cross compiler, not the host compiler. Override is needed to keep these
> assignments from being ignored in that case.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
> tools/Makefile | 10 +++++-----
> tools/gdb/Makefile | 6 +++---
> 2 files changed, 8 insertions(+), 8 deletions(-)
As Mike pointed out, we should rather consistently use HOSTCC when we
refer to the host's C compiler.
I suggest you rework the patch to do that.
Thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Swap read error. You lose your mind.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS , etc.
2009-10-19 21:56 ` Scott Wood
@ 2009-10-19 22:37 ` Mike Frysinger
0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2009-10-19 22:37 UTC (permalink / raw)
To: u-boot
On Monday 19 October 2009 17:56:37 Scott Wood wrote:
> Mike Frysinger wrote:
> > On Monday 19 October 2009 17:24:35 Scott Wood wrote:
> >> If the user has specified a CC or similar on the command line, that is
> >> the cross compiler, not the host compiler. Override is needed to keep
> >> these assignments from being ignored in that case.
> >
> > then again, if we didnt mix host and target variable names, this wouldnt
> > be a problem. in a sane world, all of the host stuff would be HOSTXX (or
> > BUILDXX).
>
> Right... I initially tried substituting in HOSTCC, but it still tried to
> use CC, probably from an implicit rule that would need to be made
> explicit in order to use HOSTCC.
>
> I can try to respin it with a new explicit rule if y'all want.
if you feel like cleaning up all the host code, that'd be great, but i'm not
going to NACK a patch that obviously fixes broken code ;)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091019/e7d0f7fe/attachment.pgp
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc.
2009-10-19 21:42 ` Mike Frysinger
2009-10-19 21:56 ` Scott Wood
@ 2009-10-20 21:53 ` Scott Wood
2009-10-21 1:17 ` [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS , etc Mike Frysinger
1 sibling, 1 reply; 7+ messages in thread
From: Scott Wood @ 2009-10-20 21:53 UTC (permalink / raw)
To: u-boot
Mike Frysinger wrote:
> On Monday 19 October 2009 17:24:35 Scott Wood wrote:
>> If the user has specified a CC or similar on the command line, that is the
>> cross compiler, not the host compiler. Override is needed to keep these
>> assignments from being ignored in that case.
>
> then again, if we didnt mix host and target variable names, this wouldnt be a
> problem. in a sane world, all of the host stuff would be HOSTXX (or BUILDXX).
I was looking at making static pattern rules to divert host objects to a
host rule, with separate object lists for files that want pedantic and
non-pedantic (leaving the current set of individual file rules would
cause conflicts).
It seems that nothing in tools/Makefile is using -pedantic or any of the
other HOSTCFLAGS set in tools/Makefile; HOSTCFLAGS is getting
overwritten by config.mk. It looks like maybe this was introduced when
HOST_CFLAGS was changed to HOSTCFLAGS.
Any thoughts on how to untangle things? What flags to we really want to
use here? Given the number of files that have been exempted, do we
still want to keep the -pedantic stuff around?
-Scott
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS , etc.
2009-10-20 21:53 ` [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc Scott Wood
@ 2009-10-21 1:17 ` Mike Frysinger
0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2009-10-21 1:17 UTC (permalink / raw)
To: u-boot
On Tuesday 20 October 2009 17:53:58 Scott Wood wrote:
> Mike Frysinger wrote:
> > On Monday 19 October 2009 17:24:35 Scott Wood wrote:
> >> If the user has specified a CC or similar on the command line, that is
> >> the cross compiler, not the host compiler. Override is needed to keep
> >> these assignments from being ignored in that case.
> >
> > then again, if we didnt mix host and target variable names, this wouldnt
> > be a problem. in a sane world, all of the host stuff would be HOSTXX (or
> > BUILDXX).
>
> I was looking at making static pattern rules to divert host objects to a
> host rule, with separate object lists for files that want pedantic and
> non-pedantic (leaving the current set of individual file rules would
> cause conflicts).
>
> It seems that nothing in tools/Makefile is using -pedantic or any of the
> other HOSTCFLAGS set in tools/Makefile; HOSTCFLAGS is getting
> overwritten by config.mk. It looks like maybe this was introduced when
> HOST_CFLAGS was changed to HOSTCFLAGS.
>
> Any thoughts on how to untangle things? What flags to we really want to
> use here? Given the number of files that have been exempted, do we
> still want to keep the -pedantic stuff around?
i dislike -pedantic/-ansi (i find it a waste of time), but i think Wolfgang
wants to support older crap
having all hostflags be in the top level would be good at any rate rather than
duplicating into tools/ ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20091020/319e2bf5/attachment.pgp
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-10-21 1:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-19 21:24 [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc Scott Wood
2009-10-19 21:42 ` Mike Frysinger
2009-10-19 21:56 ` Scott Wood
2009-10-19 22:37 ` [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS , etc Mike Frysinger
2009-10-20 21:53 ` [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc Scott Wood
2009-10-21 1:17 ` [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS , etc Mike Frysinger
2009-10-19 22:35 ` [U-Boot] [PATCH 2/2] tools: Use override when changing CC, CFLAGS, etc Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox