From owner-freebsd-arm@FreeBSD.ORG Sat May 18 21:44:04 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E3B9A51E for ; Sat, 18 May 2013 21:44:04 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id C7C32604 for ; Sat, 18 May 2013 21:44:04 +0000 (UTC) Received: from bender.Home (unknown [176.252.108.73]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 114B65E1DA; Sat, 18 May 2013 21:43:57 +0000 (UTC) Date: Sat, 18 May 2013 22:43:35 +0100 From: Andrew Turner To: Tim Kientzle Subject: Re: Port: U-Boot for BeagleBone Message-ID: <20130518224335.16aa88de@bender.Home> In-Reply-To: <90152894-5643-4189-B6DF-394E4F463FA3@kientzle.com> References: <3B16A2E5-C92B-4248-BE98-DD5C1194CB05@freebsd.org> <20130518100512.57c47fe6@bender> <8D318315-A18E-4B16-B37A-1073CB36CA66@bsdimp.com> <695C0935-9AFC-4C99-B6FE-E7B6F260FB59@kientzle.com> <9A15C7DB-BC23-40DC-8059-CDCE3CFD5CEB@bsdimp.com> <90152894-5643-4189-B6DF-394E4F463FA3@kientzle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: freebsd-arm X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 May 2013 21:44:05 -0000 On Sat, 18 May 2013 13:59:45 -0400 Tim Kientzle wrote: > > On May 18, 2013, at 10:54 AM, Warner Losh wrote: > > > > > On May 18, 2013, at 10:46 AM, Tim Kientzle wrote: > > > >> On May 18, 2013, at 10:41 AM, Warner Losh wrote: > >>> > >>> On May 18, 2013, at 10:38 AM, Jason Birch wrote: > >>> > >>>> I'm not sure how it'd work internally in the ports tree (I'm a > >>>> ports consumer, not a contributor), but I'd find it weird if a > >>>> U-Boot port required me to get any devel/cross-* ports if U-Boot > >>>> was able to be built by Clang native to FreeBSD 9.X+ and I had > >>>> Clang set as my CC, CPP, CXX. > >>> > >>> u-boot can't be built with clang. > >> > >> Yes, it can. Since the ARM clang switch was thrown, > >> the xdev tools now build clang (unnecessarily, of course). > >> U-Boot builds just fine with it: > >> > >> $ armv6-freebsd-cc --version > >> FreeBSD clang version 3.3 (trunk 178860) 20130405 > >> Target: armv6--freebsd > >> Thread model: posix > > > > Do these boot? > > Gosh. Now you've made me nervous that > I might still be using old GCC-compiled versions. > > Just a sec …. > $ rm -rf u-boot-2013.04 > $ tar xf u-boot-2013.04.tar.bz2 > $ sudo ./crochet.sh -c beagleblack.sh > > Copy to SD card … > > Yep. It boots. ;-) > > > I was under the impression that u-boot used global register flags > > in gcc that clang wasn't going to support... I'd be happy if I'm > > wrong though… My understanding is clang doesn't support it. I have removed the only one in our kernel when adding support for clang. > Don't know the details. Maybe Andrew knows what has changed? The variable in question is in a macro in arch/arm/include/asm/global_data.h. There is a pointer to a global data structure in register r8. This register is reserved through the use of the -ffixed-r8 compiler flag. I'm not sure if clang supports the -ffixed-* flag or not. Given this if you manage to get clang to build U-Boot is is unlikely to work as it could change r8 within some functions unless there is some way to tell it otherwise. Andrew