From owner-freebsd-arm@FreeBSD.ORG Mon Jun 2 06:21:17 2014 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCF05446; Mon, 2 Jun 2014 06:21:17 +0000 (UTC) Received: from aribaud.fr (aribaud.fr [IPv6:2001:470:c8ce::1]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 500A22E09; Mon, 2 Jun 2014 06:21:16 +0000 (UTC) Received: from lilith ([192.168.128.3]) by janus with esmtps (SSL3.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1WrLcJ-0001fP-5z; Mon, 02 Jun 2014 08:21:07 +0200 Date: Mon, 2 Jun 2014 08:21:06 +0200 From: Albert ARIBAUD To: Jeroen Hofstee Subject: Re: Building an ARM/RPI-B release (hacked) on CURRENT/AMD64. In-Reply-To: <1401649825.2295.45.camel@yellow> References: <9FDD6F0E-B2A9-48D9-A3E4-181868995FDA@grondar.org> <20140417103117.GE44138@cicely7.cicely.de> <1397738961.1124.157.camel@revolution.hippie.lan> <1401649825.2295.45.camel@yellow> X-Mailer: Claws Mail 3.10.0 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-Id: Cc: Tim Kientzle , freebsd-arm , Ian Lepore , Mark R V Murray , ticso@cicely.de X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 06:21:17 -0000 Hi Jeroen et al., On Sun, 01 Jun 2014 21:10:25 +0200, Jeroen Hofstee wrote: > On do, 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 concept > > > 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=E2=80=9D) > >=20 > > which means =E2=80=9Cgd is an alias for the r9 register and is a pointe= r to type =E2=80=A6=E2=80=9D > >=20 > > =E2=80=A6 I think. :-) > >=20 > > Clang doesn=E2=80=99t like this one bit. First objection is to =E2=80= =9Cglobal register variables=E2=80=9D, so if I experimentally knock out the= =E2=80=9Cregister=E2=80=9D, I simply get the second objection - to "multip= le instances of the r9 global variable=E2=80=9D. > >=20 > > Googling a bit suggests that Clang just plain can=E2=80=99t do this. :-( > >=20 >=20 > Well with a bit of creativity this will work [1]. Hopefully this ends up > in mainline u-boot. For the record, it is the U-Boot Arm maintainer > (Albert) who actually dug up the fixed-r9 in llvm (but was a hidden > option for ios).=20 Although my name was not uttered thrice :) allow me to chime in still, and say that while I did dig up the r9 option, it was a mere consequence of Jeroen's effort to make U-boot build with LLVM, and that even though the EABI states that r9 is the register to use if you need one to store a global constant, U-Boot itself used r8 rather than r9 and thus was non-compliant until Jeroen fixed it in mainline, see commit fe1378a961e508b31b1f29a2bb08ba1dac063155), and it is Jeroen's effort too that will make U-Boot eventualy buildable with LLVM/clang. BTW, Jeroen, I'll have a look at your patch series today. > Regards, > Jeroen >=20 > [1] > https://github.com/jhofstee/u-boot/commit/4ab717325cb7e7b02efaec2b3f95bf9= 874492ba2 Amicalement, --=20 Albert.