From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeroen Hofstee Date: Sat, 07 Feb 2015 21:17:37 +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: <54D672E1.30700@myspectrum.nl> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Simon, On 07-02-15 16:10, Simon Glass wrote: > On 7 February 2015 at 03:04, Jeroen Hofstee wrote: >> >> >> 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? FreeBSD host ld can handle linker scripts fine, it is INSERT BEFORE .data; which is not supported. Boards don't use the host linker script, but one for the target, which comes from ports and hence is not that old e.g. arm-gnueabi-freebsd-ld --version GNU ld (GNU Binutils) 2.25 Copyright (C) 2014 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. Besides that, boards don't use INSERT before .data, since they have a complete linker script. > The docs for 'ld' seem to indicate that if the -T option is not used > the file is treated as a link script addendum rather than replacing it > entirely. Is that what we want? FreeBSD ld has this option, it does not work on a MAC/Darwin though according to Andreas his post. The problem on FreeBSD is the INSERT before .data inside the "addendum" aka tools/imagetool.lds >>> Finally, please point me to how I can install FreeBSD in viritualbox >>> or similar. I'm interested in that... >> >> Just download an install image and start it in virtualbox, see 1. >> You might need to change the motherboard type. >> >> doc/README.clang explains how to use the host compiler to cross build >> u-boot (for some boards). You can install a gcc cross compiler as well. >> >> [1] https://www.freebsd.org/releases/10.1R/announce.html >> > I tried this out and I have a prompt but I'm not sure how to install > git or anything else 'pkg install git' tells me there are no packages > available to install matching 'git'. pkg_add seems to be missing. I am > none the wiser after some web searching. pkg replaced the pkg_add / pkg_info and friends. So it is fine that they are not there. The weird thing is I just booted 10.1 in virtualbox to reproduce this but works fine (just defaults everywhere), I roughly did [1]. Obviously you need root credentials to install packages, but I doubt you forgot that. If this still fails, you can always build it from source, but needs a bit of patience. Somthing like this should always work: portsnap fetch portsnap extract cd /usr/ports/devel/git make config-recursive make make install Let me know if you still have issues. Regards, Jeroen [1] (as root) pkg install nano git git clone git://git.denx.de/u-boot.git git checkout v2015.01 -b b2015.01 cd u-boot pkg install arm-gnueabi-binutils gmake gmake CC="clang -target arm-freebsd-eabi -no-integrated-as -mllvm -arm-use-movt=0" rpi_defconfig gmake CROSS_COMPILE=arm-gnueabi-freebsd- CC="clang -target arm-freebsd-eabi -no-integrated-as -mllvm -arm-use-movt=0 -B/usr/local/bin/arm-gnueabi-freebsd-" CONFIG_USE_PRIVATE_LIBGCC=y