From owner-freebsd-arm@FreeBSD.ORG Thu Apr 17 19:14:33 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 D092C251 for ; Thu, 17 Apr 2014 19:14:33 +0000 (UTC) Received: from mail-pd0-f173.google.com (mail-pd0-f173.google.com [209.85.192.173]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EA9517B4 for ; Thu, 17 Apr 2014 19:14:33 +0000 (UTC) Received: by mail-pd0-f173.google.com with SMTP id z10so672421pdj.32 for ; Thu, 17 Apr 2014 12:14:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=hmjn4xwjony83XL39+pMLmAFflAmEsPYsIjLE2LVpKk=; b=TGQwoOQPp1jb9T1Yw72fzroOY7vDFcOjzrGtSWos7829e7vd6HOjpMAhaVOx/3vV4y 0HaIJDlugxcqZelSJNnXmDFmp+DTtjhV7DmDy2yJhb+yt8xzMeUsPSDbwkYndU5cNAS7 tN45c2lPufgLNREUY8DoLGdb36E3DHISoSVYZ1/lbb0VTEuUJMSeyZxgRqF2n41iQKrT 0NJvS+JJivaW02/6PPoooo7ssuf6TnrqJxJK50WX4j+w73HhCh1b1zovRITFPWH7Wqu9 XPKvFq0PWpnbV7GiHMMAr5cKtntXyZvHUwbHmOgPsycku/yGcIAF94i8LPU1fQWjcINw U3xg== X-Gm-Message-State: ALoCoQmE7Mymo1ONZeT9fL1cXvAltHFrgr4NfB0vxg5bSB4A7Vmdvj8cpN7CpUEbQoTMSObe/4we X-Received: by 10.68.240.34 with SMTP id vx2mr17408189pbc.1.1397762067575; Thu, 17 Apr 2014 12:14:27 -0700 (PDT) Received: from lgmac-ckapadia.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id cz3sm55210763pbc.9.2014.04.17.12.14.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 12:14:26 -0700 (PDT) Sender: Warner Losh Content-Type: text/plain; charset=windows-1251 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: Building an ARM/RPI-B release (hacked) on CURRENT/AMD64. From: Warner Losh In-Reply-To: <1397761628.1124.245.camel@revolution.hippie.lan> Date: Thu, 17 Apr 2014 13:14:25 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <7196A020-54E1-42FA-B8A0-25B145B0E412@bsdimp.com> References: <9FDD6F0E-B2A9-48D9-A3E4-181868995FDA@grondar.org> <20140417103117.GE44138@cicely7.cicely.de> <1397738961.1124.157.camel@revolution.hippie.lan> <1397761628.1124.245.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1874) Cc: Tim Kientzle , freebsd-arm , ticso@cicely.de, Mark R V Murray 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:14:34 -0000 On Apr 17, 2014, at 1:07 PM, Ian Lepore wrote: > 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 = and >>> it's used to access all global vars. As I vaguely understand it, = u-boot >>> 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 = use >>> 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 = type =85=94 >>=20 >> =85 I think. :-) >>=20 >> Clang doesn=92t like this one bit. First objection is to =93global = register variables=94, so if I experimentally knock out the =93register=94= , I simply get the second objection - to "multiple instances of the r9 = global variable=94. >>=20 >> Googling a bit suggests that Clang just plain can=92t do this. :-( >>=20 >> M >=20 > 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 what=92s the other part? Global register variables like this? > 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. Is that a poke in the eye of uboot, or is it more of a contention that uboot is moving away from that need? Warner