From: Jeroen Hofstee <jeroen@myspectrum.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] recent tools on FreeBSD
Date: Fri, 06 Feb 2015 20:56:15 +0100 [thread overview]
Message-ID: <54D51C5F.7090500@myspectrum.nl> (raw)
In-Reply-To: <CAPnjgZ1hVpcYqFF5ckXbvMu=tQS2eywZ4+gMdCwypK1=ouK0uQ@mail.gmail.com>
Hello Simon, +Andreas,
On 06-02-15 04:05, Simon Glass wrote:
> Hi Jeroen,
>
> On 5 February 2015 at 12:51, Jeroen Hofstee<jeroen@myspectrum.nl> wrote:
>> Hello Guilherme,
>>
>> Thanks for commenting on this,
>>
>> On 02/05/15 13:27, Guilherme Maciel Ferreira wrote:
>>> Hi Jeroen,
>>>
>>> My apologies, I didn't test the tools on BSD. The answers are inline.
>>>
>>> Best regards,
>>> Guilherme
>>>
>>> Am 04.02.2015 19:37 schrieb "Jeroen Hofstee"<jeroen@myspectrum.nl>:
>>>> Hello Guilherme / Simon,
>>>>
>>>> It seems that commit f86ed6a8d52c99bb2d17d3cac1647edca0c4399c,
>>>> "tools: moved code common to all image tools to a separated module."
>>> I guess the culprit is commit a93648d197df48fa46dd55f925ff70468bd81c71,
>>> "imagetool: replace image registration function by linker_lists feature".
>>> Because that commit introduced the linker script to imagetools.
>>>
>> Likely, since some patches depend on each other I was unable to revert
>> a single commit.
>>
>> Anyway as far as I am concerned there are two separate
>> build targets, the bare u-boot having an (almost) naked compiler, beside
>> stdarg and stdbool? without any other host includes or objects (well with
>> CONFIG_USE_PRIVATE_LIBGCC=y). U-boot provides linker scripts for them,
>> and we have fine grained control over them and an excuse to throw any
>> trick at them if it makes things faster / smaller etc. It is still nice if
>> this
>> compiles anywhere though..
>>
>> On the other hand there are "tools" for the host / target userland, which
>> should build against the host / targets "std*". Those things should be
>> buildable
>> on any decent host / target and be straightforward (and _not_ define KERNEL
>> etc, since it are userland tools). There is no linker for them afaik, so
>> tweaking
>> them seems like a bad idea. Hence I am tempted to remove the use of
>> linker generated lists from tools...
>>
>>>> - and really last, how do I test if it works..
>>> There are two scripts to test the image tools, test-imagetools.sh and
>>> test-fit.py. Running those scripts you make sure the linker list is
>>> properly setup, because it is required by the imagetools to find the image
>>> type.
>>>
>>> $ make O=sandbox clean
>>> $ make O=sandbox sandbox_config
>>> $ make mrproper
>>> $ make O=sandbox
>>> $ ./test/image/test-imagetools.sh
>>> $ ./test/image/test-fit.py -u sandbox/u-boot
>> Sandbox used to build on FreeBSD, but it is quite a mess at the moment.
>> But a I said, I think the best solution for tools is not to use linker
>> generated
>> list in the first place for tools.
> Sandbox uses driver model so has the same problem. How can we solve this?
>
> Why is the FreeBSD toolchain so different? Does it not have the
> concept of link scripts?
First of all, the biggest problem for sandbox at the moment are header
files.
For a "normal" cross target this works fine since the target uses u-boot
headers
(linux/*) and the tools the (std*). For sandbox we end up with both of
them included at the same time at the moment, leading to redefinitions
of uint64_t, time_t, ptrdiff_t, fd_set etc. I will have to look in more
details
if this is fixable. It is a different problem then the link error since
it already
errors before attempting to link.
Regarding the linking problem, there is nothing special about FreeBSD ld,
it just is based on a version which has no idea what INSERT BEFORE .data
means.
there are several option I guess (not tested):
1) include a complete linker script so INSERT BEFORE .data is not needed
2) teach FreeBSD ld what INSERT BEFORE .data is supposed to mean
3) don't use linker magic in tools (and use a linux box for sandbox, at
least for now)
1) sounds like a bad idea, the target/host might be any arch e.g.
2) won't magically fix problems as well, even if FreeBSD trunk can be
teached to understand
this, things will still be broken on releases. And u-boot tools work on
more host systems,
Andreas, can you check if Darwin is still able to compile tools from
u-boot master?
3) the option I would be tempted to choose, just don't do linker magic
for tools. This would
make sure at least mkimage etc can be build everywhere. sandbox won't
build, but as said
it is already broken because of other issues. (and I doubt there is even
an single user around
besides me to even try to build sandbox on FreeBSD).
So as far as I am concerned we go for option 3.
Regards,
Jeroen
next prev parent reply other threads:[~2015-02-06 19:56 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-04 19:37 [U-Boot] recent tools on FreeBSD Jeroen Hofstee
2015-02-05 3:34 ` Simon Glass
2015-02-05 7:07 ` Jeroen Hofstee
2015-02-05 12:37 ` Guilherme Maciel Ferreira
2015-02-05 12:27 ` Guilherme Maciel Ferreira
2015-02-05 19:51 ` Jeroen Hofstee
2015-02-06 3:05 ` Simon Glass
2015-02-06 19:56 ` Jeroen Hofstee [this message]
2015-02-06 20:40 ` Andreas Bießmann
2015-02-06 21:00 ` Simon Glass
2015-02-07 10:04 ` Jeroen Hofstee
2015-02-07 15:10 ` Simon Glass
2015-02-07 16:23 ` Andreas Bießmann
2015-02-07 16:29 ` Simon Glass
2015-02-07 17:08 ` Andreas Bießmann
2015-02-07 17:19 ` Simon Glass
2015-02-07 21:19 ` [U-Boot] [RFC PATCH] tools/imagetool: remove linker generated list Andreas Bießmann
2015-02-07 21:38 ` Jeroen Hofstee
2015-02-08 0:05 ` Guilherme Maciel Ferreira
2015-02-10 15:01 ` Simon Glass
2015-02-07 20:17 ` [U-Boot] recent tools on FreeBSD Jeroen Hofstee
2015-02-07 21:02 ` Simon Glass
2015-02-08 10:03 ` Jeroen Hofstee
2015-02-10 14:52 ` Simon Glass
2015-02-09 23:20 ` [U-Boot] sandbox " Jeroen Hofstee
2015-02-10 15:34 ` Simon Glass
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=54D51C5F.7090500@myspectrum.nl \
--to=jeroen@myspectrum.nl \
--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