From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZFQhi-0003TI-QD for mharc-grub-devel@gnu.org; Wed, 15 Jul 2015 13:42:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFQhf-0003T9-R1 for grub-devel@gnu.org; Wed, 15 Jul 2015 13:42:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFQhe-00073S-7S for grub-devel@gnu.org; Wed, 15 Jul 2015 13:42:43 -0400 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]:38237) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFQhd-00072Y-T5 for grub-devel@gnu.org; Wed, 15 Jul 2015 13:42:42 -0400 Received: by wicmv11 with SMTP id mv11so4471306wic.1 for ; Wed, 15 Jul 2015 10:42:41 -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=U5JlcjtuICAmH0rSd6q1w2DtDJleqbYh9b/t10qDdTw=; b=RoUgJWa0yKTtZECJdkHBvqN9QF9VtDSLD9LtN2Wi9yop81CL5MtHp2irUeCZ0eU527 m5jM24WwemUIi16iYc1rQr1Ukk1gE6AhrMOqK8qt87/cfySXkY9QqAbpcy9x5o+fjqjh ePKRNeYZeArlnu55UlgciSRwjYQ9BS7J97/KFlpk+4h/WJJM3BtYSXNUjmCS4+Awl1fD qW4RewHdcrDwOPPnctAWZjUBoedPgeUSytETWxJ1cS5OyteDJUHWLBMdxSNiPAMFlBtf NoPaulY341+s5KSxrxiMwYKnujuBj9C5LBG8nRKYnp5ZYs2KqoD2zY1S6sl707IFJ1yW I/xw== X-Received: by 10.194.6.37 with SMTP id x5mr11364827wjx.73.1436982161163; Wed, 15 Jul 2015 10:42:41 -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 q9sm968913wiz.23.2015.07.15.10.42.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 10:42:40 -0700 (PDT) Message-ID: <55A69B8F.4020105@gmail.com> Date: Wed, 15 Jul 2015 19:42:39 +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> <20150705203839.124984af@opensuse.site> In-Reply-To: <20150705203839.124984af@opensuse.site> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="iAlhrQcaE4SCAaab9B1cv0Famel8KPrNU" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::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:42:45 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iAlhrQcaE4SCAaab9B1cv0Famel8KPrNU Content-Type: multipart/mixed; boundary="------------080202020403070409060804" This is a multi-part message in MIME format. --------------080202020403070409060804 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > It is possible to compile using "--target=3Dpowerpc -Wl,-EB" - this wor= ks > on all three ppc, ppc64 and ppc64le, but this means hardcoding GNU ld > dependency. >=20 Thanks for this info. See attached patch > So I'd rather try to produce patch for proper support of > -mbig-endian/-mlittle-endian (including passing it onto gcc linker) and= > until then declared clang on ppc64le having limited support (i.e. > support for automatic detection by configure). >=20 I agree that this is a better approach in long term. But if we can get some support for current tools with little work (see patch) and without risks of breaking other tools I see no reason not to go for it in short t= erm >=20 --------------080202020403070409060804 Content-Type: text/x-diff; name="be2.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="be2.diff" diff --git a/configure.ac b/configure.ac index fd8a62e..113e7c7 100644 --- a/configure.ac +++ b/configure.ac @@ -116,6 +116,7 @@ if test "x$with_platform" =3D x; then x86_64-*) platform=3Dpc ;; powerpc-*) platform=3Dieee1275 ;; powerpc64-*) platform=3Dieee1275 ;; + powerpc64le-*) platform=3Dieee1275 ;; sparc64-*) platform=3Dieee1275 ;; mipsel-*) platform=3Dloongson ;; mips-*) platform=3Darc ;; @@ -138,6 +139,7 @@ case "$target_cpu"-"$platform" in x86_64-none) ;; x86_64-*) target_cpu=3Di386 ;; powerpc64-ieee1275) target_cpu=3Dpowerpc ;; + powerpc64le-ieee1275) target_cpu=3Dpowerpc ;; esac =20 # Check if the platform is supported, make final adjustments. @@ -601,6 +603,37 @@ if test "x$target_cpu" =3D xi386 && test "x$platform= " !=3D xemu; then TARGET_CFLAGS=3D"$TARGET_CFLAGS -march=3Di386" fi =20 +if test x$target_cpu =3D xpowerpc; then + AC_CACHE_CHECK([for options to get big-endian compilation], grub_cv_ta= rget_cc_big_endian, [ + grub_cv_target_cc_big_endian=3Dno + for cand in "-target powerpc -Wl,-EB" "-target powerpc" \ + "-mbig-endian"; do + if test x"$grub_cv_target_cc_big_endian" !=3D xno ; then + break + fi + CFLAGS=3D"$TARGET_CFLAGS $cand -Werror" + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__ORDER= _BIG_ENDIAN__ !=3D __BYTE_ORDER__) +#error still little endian +#endif +asm (".globl start; start:"); +void __main (void); +void __main (void) {} +int main (void); +]], [[]])], + [grub_cv_target_cc_big_endian=3D"$cand"], []) + done + ]) + + if test x"$grub_cv_target_cc_big_endian" =3D xno ; then + AC_MSG_ERROR([could not force big-endian]) + fi + + TARGET_CFLAGS=3D"$TARGET_CFLAGS $grub_cv_target_cc_big_endian" + TARGET_CCASFLAGS=3D"$TARGET_CCASFLAGS $grub_cv_target_cc_big_endian" + TARGET_LDFLAGS=3D"$TARGET_LDFLAGS -static $grub_cv_target_cc_big_endia= n" +fi + if test "x$target_m32" =3D x1; then # Force 32-bit mode. TARGET_CFLAGS=3D"$TARGET_CFLAGS -m32" --------------080202020403070409060804-- --iAlhrQcaE4SCAaab9B1cv0Famel8KPrNU 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 iF4EAREKAAYFAlWmm5AACgkQmBXlbbo5nOtanQEAln88+LDyd0TeDSYUFu97bpJP 4IfkPvDaTujA/tKRJDEBAJetZfLhyVJQJ45Co6+LdVyikeGzdwCej5bSFwIxBFlk =gIkO -----END PGP SIGNATURE----- --iAlhrQcaE4SCAaab9B1cv0Famel8KPrNU--