From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZFQbr-0001zk-O8 for mharc-grub-devel@gnu.org; Wed, 15 Jul 2015 13:36:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFQbn-0001xf-18 for grub-devel@gnu.org; Wed, 15 Jul 2015 13:36:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFQbl-0003ZP-Tl for grub-devel@gnu.org; Wed, 15 Jul 2015 13:36:38 -0400 Received: from mail-wg0-x229.google.com ([2a00:1450:400c:c00::229]:35516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFQbl-0003Z6-Ij for grub-devel@gnu.org; Wed, 15 Jul 2015 13:36:37 -0400 Received: by wgjx7 with SMTP id x7so39276750wgj.2 for ; Wed, 15 Jul 2015 10:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=/+qEYDQ/Ht9Uw7P5HY5RetgDvYin3yx9yf0yQ3lPRIM=; b=0KAKd6a1n0WCx9iz7c7uWQ3d5Hr6yuR4d3A5TcfXk5XPzfyOskJp5v4WLSlT3vmUXE zl6qqUTxulCPlNtBagUbb8QDzrg+3dmpZiekTCMd8/BVP/g9rucgDwwy/p5vjRWlhPNu 1xTlDR8qWoFxUXfTXRXK6ib16/75LSeI/UYaY0JywnuDRFLzWD5O4KjWHvWHoVqmDzn5 JYBNIK7iei3j3ATFu+Pskdzbn4VZCEOO8SNVUwoVGy2YDpRZ9LJqRGraGvBAQd7WcBf9 XSvDA160PmIy6Qz2jnNkJsVn4zBsPOTUWP5lpJmdIbces5j1rAHVuWXAdt1UlwiGxMrM 33dA== X-Received: by 10.194.2.161 with SMTP id 1mr10261750wjv.143.1436981796951; Wed, 15 Jul 2015 10:36:36 -0700 (PDT) Received: from ?IPv6:2620:0:105f:fd00:863a:4bff:fe50:abc4? ([2620:0:105f:fd00:863a:4bff:fe50:abc4]) by smtp.gmail.com with ESMTPSA id pn6sm8904889wjb.36.2015.07.15.10.36.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 10:36:35 -0700 (PDT) Message-ID: <55A69A23.2090903@gmail.com> Date: Wed, 15 Jul 2015 19:36:35 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Andrei Borzenkov Subject: Re: [PATCH 1/2] Add powerpc little-endian (ppc64le) flags References: <1435669013-3741-1-git-send-email-pfsmorigo@linux.vnet.ibm.com> <1435669013-3741-2-git-send-email-pfsmorigo@linux.vnet.ibm.com> <5592DA7A.8050107@linux.vnet.ibm.com> <20150630212856.12c56676@opensuse.site> <20150704094659.6aa48bf5@opensuse.site> In-Reply-To: <20150704094659.6aa48bf5@opensuse.site> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BxFgpV32NGBpILI8G2lGCDhq2xwkgVUV3" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::229 Cc: The development of GRUB 2 , Paulo Flabiano Smorigo X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2015 17:36:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BxFgpV32NGBpILI8G2lGCDhq2xwkgVUV3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04.07.2015 08:46, Andrei Borzenkov wrote: > =D0=92 Tue, 30 Jun 2015 21:34:10 +0200 > "Vladimir 'phcoder' Serbinenko" =D0=BF=D0=B8=D1=88=D0= =B5=D1=82: >=20 >> I think those flags disable only runtime libraries, not the code gener= ation >=20 > Yes, you are right. Clang seems to be built for the whole family, i.e. > PowerPC, which seems to automatically include all three versions (ppc, > ppc64, ppc64le) >=20 > See below for details. >=20 >> Le 30 juin 2015 20:29, "Andrei Borzenkov" a =C3=A9= crit : >> >>> =D0=92 Tue, 30 Jun 2015 15:05:46 -0300 >>> Paulo Flabiano Smorigo =D0=BF=D0=B8=D1= =88=D0=B5=D1=82: >>> >>>> On 2015-06-30 11:33, Vladimir 'phcoder' Serbinenko wrote: >>>>> What about clang? >>>> >>>> Not good news about clang support. This is what the toolchain team s= aid >>>> about it: >>>> >>>> The -mbig-endian option was added around April 10th, 2014. >>>> Unfortunately, those who implemented it only implemented it for ARM = and >>>> one other architecture. >>>> >>>> The option is currently accepted on Power systems, but does not have= any >>>> affect on the code generation for Power. >>>> >=20 > Support for it looks rather trivial; see attached patch. Anyone has goo= d > connection to clang development community? >=20 Just send it to their ML. They usually have good response. If this patch is accepted we can probably simplify it in our code > Using this patch the >=20 > clang --target=3Dpowerpc64le -mbig-endian -m32 produces code for PPC32 > BE, so just works: >=20 > bor@opensuse:~/build/clang-ppc/bin> ./clang --target=3Dpowerpc64le -= c -mbig-endian -m32 /tmp/foo.c > /tmp/foo.c:1:1: warning: type specifier missing, defaults to 'int' > [-Wimplicit-int] > foo() > ^ > 1 warning generated. > bor@opensuse:~/build/clang-ppc/bin> file foo.o > foo.o: ELF 32-bit MSB relocatable, PowerPC or cisco 4500, version 1 (SY= SV), not stripped >=20 > The problem is that in this case we do not really have any way to test > if it works in configure, so no way to fail gracefully. >=20 Just check the defines. >>>> >>>> So, what can we do here? Maybe add a constrain in the configure file= >>>> saying that it's not possible to build GRUB in a LE environment usin= g >>> clang. >>> >>> If I understand it correctly, it is possible to build for big-endian >>> PowerPC using >>> >>> clang -target=3Dpowerpc >>> >>> but then we depend on clang being built with BE target support; and >>> e.g. openSUSE builds it with >>> >=20 > Yes, that works too. But I'm not sure how we can test for it. Brute > force would of course be >=20 > $TARGET_CC --version | grep clang && TARGET_CFLAGS=3D--target=3Dpowerpc= >=20 > Comments? I'm inclined to use this workaround. This still may have > issues when using external assembler, but here we can simply mandate > support for clang 3.6 at the minimum, which should use integrated > assembler on PPC by default. >=20 --BxFgpV32NGBpILI8G2lGCDhq2xwkgVUV3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iF4EAREKAAYFAlWmmiMACgkQmBXlbbo5nOsZlQD/URkBXVwgK8PN8ktNSwQc90BX jjxbiGC8ZS8Z943aucYA/2EFGFrNy5NZzgjw/BGOp5zacdR39ebRLFsLXXvLEMXF =3XYk -----END PGP SIGNATURE----- --BxFgpV32NGBpILI8G2lGCDhq2xwkgVUV3--