From owner-freebsd-arm@FreeBSD.ORG Thu Apr 17 19:07:19 2014 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D2A1D9 for ; Thu, 17 Apr 2014 19:07:19 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CD31170D for ; Thu, 17 Apr 2014 19:07:18 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1WareS-000FbS-FO; Thu, 17 Apr 2014 19:07:12 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id s3HJ78Kh003582; Thu, 17 Apr 2014 13:07:09 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+gWhi072JmlZc0VyywHvnF Subject: Re: Building an ARM/RPI-B release (hacked) on CURRENT/AMD64. From: Ian Lepore To: Mark R V Murray In-Reply-To: References: <9FDD6F0E-B2A9-48D9-A3E4-181868995FDA@grondar.org> <20140417103117.GE44138@cicely7.cicely.de> <1397738961.1124.157.camel@revolution.hippie.lan> Content-Type: text/plain; charset="windows-1251" Date: Thu, 17 Apr 2014 13:07:08 -0600 Message-ID: <1397761628.1124.245.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by damnhippie.dyndns.org id s3HJ78Kh003582 Cc: Tim Kientzle , freebsd-arm , ticso@cicely.de X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Apr 2014 19:07:19 -0000 On Thu, 2014-04-17 at 19:01 +0100, Mark R V Murray wrote: > On 17 Apr 2014, at 13:49, Ian Lepore wrote: >=20 > > U-boot requires that a global register be set aside by the compiler a= nd > > it's used to access all global vars. As I vaguely understand it, u-b= oot > > used to want r8 for this, and clang didn't used to support the concep= t > > at all. Now clang supports it, but only for r9, and apparently more > > recent u-boot expects r9 rather than r8. So the fix is probably to u= se > > more recent u-boot sources (I've been using 2014.01 for imx6 stuff), = and > > probably to add the new -ffixed-r9 flag for a clang build. >=20 > Correct. >=20 > The pig in trying to build u-boot 2004.04 with Clang/XDEV is the use of >=20 > #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *= gd asm ("r9=94) >=20 > which means =93gd is an alias for the r9 register and is a pointer to t= ype =85=94 >=20 > =85 I think. :-) >=20 > Clang doesn=92t like this one bit. First objection is to =93global regi= ster variables=94, so if I experimentally knock out the =93register=94, I= simply get the second objection - to "multiple instances of the r9 globa= l variable=94. >=20 > Googling a bit suggests that Clang just plain can=92t do this. :-( >=20 > M Hmmm. After a bit of poking around in the llvm code, it looks like the full extent of the support for -ffixed-r9 is that it doesn't consider that register available for use by the code generator; that's only part of what u-boot needs. =20 Some online notes I found for clang 3.5 claim that global register variables aren't supported, and aren't likely to be any time soon. -- Ian