From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?QW5kcmVhcyBCaWXDn21hbm4=?= Date: Sat, 07 Feb 2015 17:23:55 +0100 Subject: [U-Boot] recent tools on FreeBSD In-Reply-To: References: <54D27501.7040304@myspectrum.nl> <54D3C9D1.6030905@myspectrum.nl> <54D51C5F.7090500@myspectrum.nl> <54D526DB.6080303@googlemail.com> <54D5E332.50401@myspectrum.nl> Message-ID: <54D63C1B.4070103@googlemail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On 07.02.15 16:10, Simon Glass wrote: > On 7 February 2015 at 03:04, Jeroen Hofstee wrote: >> On 06-02-15 22:00, Simon Glass wrote: >>> On 6 February 2015 at 13:40, Andreas Bie?mann >>> 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. Please do not use the linker to generate those lists. Maybe we should use the kernel approach and build the lists inside the code. Best regards Andreas Bie?mann