Date: Thu, 17 Apr 2014 13:07:08 -0600 From: Ian Lepore <ian@FreeBSD.org> To: Mark R V Murray <mark@grondar.org> Cc: Tim Kientzle <tim@kientzle.com>, freebsd-arm <freebsd-arm@FreeBSD.org>, ticso@cicely.de Subject: Re: Building an ARM/RPI-B release (hacked) on CURRENT/AMD64. Message-ID: <1397761628.1124.245.camel@revolution.hippie.lan> In-Reply-To: <ED243420-AC33-4D90-A23D-0266C142F3C1@grondar.org> References: <9FDD6F0E-B2A9-48D9-A3E4-181868995FDA@grondar.org> <EC41E53F-96EF-4652-9A02-D49448D104BE@kientzle.com> <20140417103117.GE44138@cicely7.cicely.de> <1397738961.1124.157.camel@revolution.hippie.lan> <ED243420-AC33-4D90-A23D-0266C142F3C1@grondar.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2014-04-17 at 19:01 +0100, Mark R V Murray wrote: > On 17 Apr 2014, at 13:49, Ian Lepore <ian@FreeBSD.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1397761628.1124.245.camel>