All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] recent tools on FreeBSD
Date: Sat, 7 Feb 2015 10:19:31 -0700	[thread overview]
Message-ID: <CAPnjgZ2f=zwgtQ9w8bE=kYZ9moTiKzfUhrHYv3bEDexkSQ0SzQ@mail.gmail.com> (raw)
In-Reply-To: <54D646A4.1060504@googlemail.com>

Hi Andreas,

On 7 February 2015 at 10:08, Andreas Bie?mann
<andreas.devel@googlemail.com> wrote:
> Hi Simon,
>
> On 07.02.15 17:29, Simon Glass wrote:
>> On 7 February 2015 at 09:23, Andreas Bie?mann
>> <andreas.devel@googlemail.com> wrote:
>>> On 07.02.15 16:10, Simon Glass wrote:
>>>> On 7 February 2015 at 03:04, Jeroen Hofstee <jeroen@myspectrum.nl> wrote:
>>>>> On 06-02-15 22:00, Simon Glass wrote:
>>>>>> On 6 February 2015 at 13:40, Andreas Bie?mann
>>>>>> <andreas.devel@googlemail.com> wrote:
>>>>>>> On 06.02.15 20:56, Jeroen Hofstee wrote:
>>>
>>>>>>> Dynamic list-sections is in general a good thing. But beside the linker
>>>>>>> problem here we will get another problem on darwin hosts when we want to
>>>>>>> read the sections. I added a patch to linux kernel to get around [1].
>>>>>>>
>>>>>>> So I have another option here:
>>>>>>>
>>>>>>> 4) setup the lists sections in code, add the magic handling for Mach-O
>>>>>>> binaries and remove the linker foo.
>>>>>>
>>>>>> The lower-common-denominator approach is a bit frustrating. How does
>>>>>> FreeBSD compile U-Boot?
>>>>>
>>>>>
>>>>> I guess I am missing the point here. U-boot v2015.01 builds fine
>>>>> on FreeBSD and as far as I know on a mac as well. It is v2015.04-rc1
>>>>> which no longer builds mkimage on FreeBSD and Darwin.
>>>
>>> Exactly that is the point. Before it worked to build the host tools on
>>> some exotic hosts. The introduced linker generated lists breaks this.
>>>
>>>>>> What are you actually using that system for if
>>>>>> it cannot build U-Boot?
>>>>>
>>>>> I am missing the point, u-boot and its tools build fine until v2015.04-rc1
>>>>> on FreeBSD and a mac. And this is easily fixed by not using linker magic
>>>>> for tools. (and yes sandbox likely fails to build, but I don't care that
>>>>> much)
>>>>
>>>> How do you build U-Boot for any of the boards supported? What I mean
>>>> is that if you can't handle linker scripts in FreeBSD how do you build
>>>> anything beyond the 'tools' build?
>>>
>>> to build U-Boot for any board we use a cross toolchain, to build the
>>> host tools we use the host compiler. In most cases the cross toolchain
>>> is gnu/linux which comes with a linker as we know in linux.
>>> But some host systems toolchain differ. *BSD with ELF as binary format
>>> is not really a problem here, cause the binary format is comparable. It
>>> requires just some tweaks for the used host-tools (e.g. host linker) and
>>> it will work. Unfortunately Darwin uses Mach-O as binary format which
>>> has some more restrictions. Especially it does not work with sections
>>> the same way as ELF does. Therefore I posted the patch for
>>> scripts/mod/file2alias.c in linux kernel to handle these. In days gone
>>> by we used to support windows as host too, at least with mingw which
>>> tries to clone a unix environment on windows. But the binary format on
>>> Windows is still PE (AFAIK) ... I wonder if the MS linker can generate
>>> those lists.
>>
>> OK I see, so the GNU cross compilers are used on BSD, but the GNU x86
>> compiler is not used for host compiling.
>>
>>>
>>> Please do not use the linker to generate those lists. Maybe we should
>>> use the kernel approach and build the lists inside the code.
>>
>> Can you point me to that please?
>
> I added correct section handling for Mach-O binary format to the
> file2alias.c [1] when they introduced dynamic sections
> (ADD_TO_DEVTABLE() macro in that file) which broke compilation on darwin.
>
>> I'm not familiar with it.
>
> Me too, I just fixed the build when it was broken.

So are you saying that we need to write a tool which converts the ELF
sections in the u-boot ELF into C code which then gets compiled and
put into a final u-boot ELF? And if we did that then sandbox would
work?

BTW I never did have any success getting a dev environment up on a
Mac. It took hours to download and install things and then I can't
remember what went wrong but it was awful. This was about 2 years ago
- maybe things have got easier? I'm happy to fiddle with this sort of
thing but my pain tolerance isn't what it was/

>
>> The kernel
>> uses all sorts of crazy link scripts - I wonder how FreeBSD deals with
>> that?
>
> AFAIK there is no link script for any host tool. They use it heavily for
> the kernel. But again, this is compiled and linked with the gnu linux
> cross tool chain.

Ah OK. And compiling U-Boot sandbox with a gnu linux cross tool chain
(with x86 target) on BSD is not an option? I suppose it would not run.

>
>> I suppose you can't compile Linux on FreeBSD natively?
>
> This will not work.
>
> Best regards
>
> Andreas Bie?mann
>
> [1]
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/mod/file2alias.c?id=bb66fc67192bbd406fe9c22033f1bbbf3e7ec621

Regards,
Simon

  reply	other threads:[~2015-02-07 17:19 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
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 [this message]
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='CAPnjgZ2f=zwgtQ9w8bE=kYZ9moTiKzfUhrHYv3bEDexkSQ0SzQ@mail.gmail.com' \
    --to=sjg@chromium.org \
    --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 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.