public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [WIP] tools/env: cleanup host build flags
Date: Tue, 09 Nov 2010 16:03:50 +0100	[thread overview]
Message-ID: <m2y6924jzd.fsf@ohwell.denx.de> (raw)
In-Reply-To: <1286813206-20163-1-git-send-email-daniel.hobi@schmid-telecom.ch> (Daniel Hobi's message of "Mon, 11 Oct 2010 18:06:46 +0200")

Hello Daniel,

> This patch makes tools/env/Makefile more similar to tools/imls:
> - define HOSTSRCS and HOSTCPPFLAGS, so that .depend generation works.
> - include U-Boot headers using -idirafter to prevent picking up
>   u-boot/include/errno.h.
> - use HOSTCFLAGS_NOPED (fw_env.c does not conform to -pedantic).
> - use the cross compiler again (fw_printenv is intended for a
>   hosted environment on the target).
>
> Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch>
> Cc: Mike Frysinger <vapier@gentoo.org>
> Cc: Wolfgang Denk <wd@denx.de>

As this indeed fixes the cross-compilation problem:

Tested-by: Detlev Zundel <dzu@denx.de>

>  tools/env/Makefile |   15 ++++++++++-----
>  1 files changed, 10 insertions(+), 5 deletions(-)
>
>
> Hi Scott,
>
> In commit d984fed0 (makefiles: fixes for building build tools),
> you suggest that using $(CC) with host flags (HOSTCFLAGS, etc)
> is the correct way to use the cross compiler to generate binaries
> for a hosted environment on the target.
>
> On the other hand, you use $(HOSTCC) to generate the .depend file
> in rules.mk which leads to wrong dependencies.
>
> I think we need to differentiate three cases:
>  - (free-standing) U-Boot: use CC and CFLAGS
>  - native tools (mkimage, etc): use HOSTCC and HOSTCFLAGS
>  - Linux environment on the target (imls, fw_printenv):
>
>    Can we use CC and HOSTCFLAGS, or do we need a third set of
>    variables for flags?
>
>    If reusing HOSTCFLAGS: how do we fix dependency generation?

I also don't know, but this fixes a bug, so I want the patch in ;)

Cheers
  Detlev

-- 
Bacchus, n. A convenient deity invented by the ancients as an excuse for
getting drunk.
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de

  parent reply	other threads:[~2010-11-09 15:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-11 16:06 [U-Boot] [WIP] tools/env: cleanup host build flags Daniel Hobi
2010-10-11 19:16 ` Scott Wood
2010-11-09 15:03 ` Detlev Zundel [this message]
2010-11-09 15:58   ` Steve Sakoman
2010-11-10  9:23 ` Mike Frysinger
2010-11-10 11:58   ` Daniel Hobi
2010-11-10 22:09     ` Mike Frysinger
2010-11-10 13:11   ` [U-Boot] [PATCH] " Daniel Hobi
2010-11-10 20:00   ` [U-Boot] [WIP] " Wolfgang Denk
2010-11-10 22:06     ` Mike Frysinger
2010-11-10 22:25       ` Wolfgang Denk
2010-11-10 22:51         ` Mike Frysinger
2010-11-10 22:12     ` Grant Edwards

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=m2y6924jzd.fsf@ohwell.denx.de \
    --to=dzu@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox