public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Bartlomiej Sieka <tur@semihalf.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH] Fix host tool build breakage, take two
Date: Thu, 03 Apr 2008 18:33:31 +0200	[thread overview]
Message-ID: <47F506DB.6010506@semihalf.com> (raw)
In-Reply-To: <20080402185750.62979243AB@gemini.denx.de>

Wolfgang Denk wrote:
> In message <47F3AD74.4000900@semihalf.com> you wrote:
>> I think that generally it is a better idea to use U-Boot's includes when
>> building for the host system, as this gives us better control over what
>> exactly gets included. But then on the other hand, tools/Makefils has this:
> 
> But U-boot doesn't have the knowledge about the target system that the
> target distribution has.
> 
>> CPPFLAGS   = -idirafter $(SRCTREE)/include \
>> 		-idirafter $(OBJTREE)/include2 \
>> 		-idirafter $(OBJTREE)/include \
>>
>> Could anyone comment on the reasons why we try U-Boot's includes after
>> system includes? Perhaps it would be a good idea to reverse the order --
>> see below for a quick RFC patch (compile-tested on two arm and two ppc
>> boards, each arch with and without CONFIG_FIT enabled).
> 
> Don't! I guess you tried just one configuration, and probably not even
> building on a 32 versus a 64 bit host system.
> 
> When building tools with the host compiler that are supposed  to  run
> on  the host system we should always use the host's header files.

I think this makes sense for code that we for example link from host's
standard libraries. But for code compiled from files from the U-Boot
tree (like lib_generic/md5.c), we shouldn't include host's header files.

> 
> The current problem comes from the fact  that  old  versions  of  the
> cyrus-sasl-devel  package  install  a  /usr/include/md5.h  file which
> probably NOT intended for direct use, but only within the context  of
> the  SASL  package; recent versions of the same package install it in
> /usr/include/sasl/md5.h instead.
> 
> To solve this problem I see three solutions:
> 
> 1) Fix the broken host systems for example by installing more recent
>    versions of the cyrus-sasl-devel package; this would be best, but
>    is unfortunately not possible everywhere.
> 2) Use relative file names (as suggested by Kumar) or similar methods
>    to make sure we pick up the md5.h header file from a local
>    directory instead from /usr/include.
> 3) Rename md5.h to make sure we use a pick up our own file instead of
>    some unrelated file which happens to have the same name.
> 
> My vote goes for 3).

2) seems to be more robust, though -- 3) works until someone installs a
system header file which happens to have the name that we came up with
for the U-Boot's own header file. Also, we used 2) for libfdt compiled
for mkimage.

Regards,
Bartlomiej

  parent reply	other threads:[~2008-04-03 16:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-27 14:06 [U-Boot-Users] [PATCH] Fix host tool build breakage, take two Bartlomiej Sieka
2008-03-27 14:44 ` Markus Klotzbücher
2008-03-27 14:44 ` Haavard Skinnemoen
2008-03-28 13:19   ` Kumar Gala
2008-03-28 14:45     ` Wolfgang Denk
2008-03-28 15:44       ` Kumar Gala
2008-03-31 16:50         ` Kumar Gala
2008-03-31 20:23           ` Wolfgang Denk
2008-04-01 15:04             ` Kumar Gala
2008-04-01 20:41               ` Wolfgang Denk
2008-04-02 14:55                 ` Kumar Gala
2008-04-02 15:59                   ` Bartlomiej Sieka
2008-04-02 17:24                     ` Kumar Gala
2008-04-02 18:57                     ` Wolfgang Denk
2008-04-02 21:19                       ` [U-Boot-Users] [RFC] Rename include/md5.h to u-boot-md5.h Andy Fleming
2008-04-02 21:50                         ` Kumar Gala
2008-04-02 22:06                           ` Andy Fleming
2008-04-03 21:49                         ` Timur Tabi
2008-04-06 11:18                         ` Jean-Christophe PLAGNIOL-VILLARD
2008-04-14  1:09                         ` Wolfgang Denk
2008-04-03 16:33                       ` Bartlomiej Sieka [this message]
2008-04-03 18:26                         ` [U-Boot-Users] [PATCH] Fix host tool build breakage, take two Wolfgang Denk
2008-04-03 18:36                           ` Scott Wood
2008-04-03 20:09                             ` Andy Fleming
2008-04-03 22:04                             ` Wolfgang Denk

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=47F506DB.6010506@semihalf.com \
    --to=tur@semihalf.com \
    --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