From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZFPpH-00055k-C8 for mharc-grub-devel@gnu.org; Wed, 15 Jul 2015 12:46:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFPp8-0004qS-Tg for grub-devel@gnu.org; Wed, 15 Jul 2015 12:46:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFPp7-0003eg-2I for grub-devel@gnu.org; Wed, 15 Jul 2015 12:46:22 -0400 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]:37847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFPp6-0003eI-IX for grub-devel@gnu.org; Wed, 15 Jul 2015 12:46:21 -0400 Received: by wibud3 with SMTP id ud3so3245598wib.0 for ; Wed, 15 Jul 2015 09:46:19 -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:subject:references :in-reply-to:content-type; bh=Uu48y6QIwDSFhgUHr+C85I9dIK1zHDKrZpit0OrU+iM=; b=OH/Hude68lkti92/aSQ8pznHsAyQDkiRhTQgrDYnDsK8cGajkv1thYMHMw2yatPEGK L+DLy9VPEZYbzOtl1LvdwvO9gbxbcPgkzCC++ciBRqbijnTllv26GNgkqiU0fJrSrteu /YoYyEEhSAcpHoeLAfMBoakX7iwFwZ9YCl/zOiBVGDiejEgk/5FDKJrnbZKH/QM6oRL6 obvC59o2wx3AwNFCBkv917k0WiRk08ikkc7g5XO7UEXF5qqutXlh0+coCQodV3/hkE21 N3iDcmBZVg3xg8jphlYIDdUVcbteaSijh+ISXf0BFsG1KXGtCoptbSyR+Qoq90OIDnNm vg7Q== X-Received: by 10.180.7.130 with SMTP id j2mr743837wia.29.1436978779803; Wed, 15 Jul 2015 09:46:19 -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 ul1sm8724736wjc.30.2015.07.15.09.46.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Jul 2015 09:46:18 -0700 (PDT) Message-ID: <55A68E5A.7000204@gmail.com> Date: Wed, 15 Jul 2015 18:46:18 +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: The development of GNU GRUB 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> In-Reply-To: <20150630212856.12c56676@opensuse.site> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="A6CsfNCo6t77x3GBfrEchaGbxcIIUESba" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22e 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 16:46:29 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --A6CsfNCo6t77x3GBfrEchaGbxcIIUESba Content-Type: multipart/mixed; boundary="------------090907070509050209020900" This is a multi-part message in MIME format. --------------090907070509050209020900 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 30.06.2015 20:28, Andrei Borzenkov wrote: > =D0=92 Tue, 30 Jun 2015 15:05:46 -0300 > Paulo Flabiano Smorigo =D0=BF=D0=B8=D1=88= =D0=B5=D1=82: >=20 >> 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 sai= d=20 >> about it: >> >> The -mbig-endian option was added around April 10th, 2014.=20 >> Unfortunately, those who implemented it only implemented it for ARM an= d=20 >> one other architecture. >> >> The option is currently accepted on Power systems, but does not have a= ny=20 >> affect on the code generation for Power. >> >> >> So, what can we do here? Maybe add a constrain in the configure file=20 >> saying that it's not possible to build GRUB in a LE environment using = clang. >=20 > If I understand it correctly, it is possible to build for big-endian > PowerPC using >=20 > clang -target=3Dpowerpc >=20 @pfsmorigo. Please try attached patch > but then we depend on clang being built with BE target support; and > e.g. openSUSE builds it with >=20 > cmake -G "Ninja" \ > -DBUILD_SHARED_LIBS=3DOFF \ > -DCMAKE_BUILD_TYPE=3DRelease \ > -DLLVM_ENABLE_ASSERTIONS=3DOFF \ > -DLLVM_TARGETS_TO_BUILD=3Dhost \ > -DCMAKE_C_FLAGS=3D"-O0" \ > -DCMAKE_CXX_FLAGS=3D"-O0" \ > -DLLVM_HOST_TRIPLE=3D%{host_triple} \ >=20 > so as I understand on ppc64le it does not build support for any other > target. Actually openSUSE does not even build clang on ppc at all. >=20 >=20 >=20 >>> >>> Le 30 juin 2015 16:30, "Andrei Borzenkov" >> > a =C3=A9crit : >>> >>> On Tue, Jun 30, 2015 at 5:03 PM, Vladimir 'phcoder' Serbinenko >>> > wrote: >>> > Which compilers support these flags? I'm concerned of breaking= >>> old compilers >>> > >>> >>> -static and -mbig-endian are listed in gcc 2.95.3 documentation f= or PPC. >>> >>> > Le 30 juin 2015 14:57, "Paulo Flabiano Smorigo" >>> > >> > a =C3=A9crit : >>> >> >>> >> libgcc dependency was removed *just* for this target because >>> >> the distros that use ppc64el doesn't have 32-bit support on i= t. >>> >> >>> >> * configure.ac : Add targets for >>> powerpc64el and skip libgcc. >>> >> * Makefile.am: Likewise. >>> >> --- >>> >> configure.ac | 8 ++++++++ >>> >> 1 file changed, 8 insertions(+) >>> >> >>> >> diff --git a/configure.ac b/configure.a= c >>> >>> >> index fd8a62e..0a79fad 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 >>> >> >>> >> # Check if the platform is supported, make final adjustments= =2E >>> >> @@ -601,6 +603,12 @@ if test "x$target_cpu" =3D xi386 && test= >>> "x$platform" >>> >> !=3D xemu; then >>> >> TARGET_CFLAGS=3D"$TARGET_CFLAGS -march=3Di386" >>> >> fi >>> >> >>> >> +if test x$target_cpu =3D xpowerpc; then >>> >> + TARGET_CFLAGS=3D"$TARGET_CFLAGS -mbig-endian" >>> >> + TARGET_CCASFLAGS=3D"$TARGET_CCASFLAGS -mbig-endian" >>> >> + TARGET_LDFLAGS=3D"$TARGET_LDFLAGS -static -mbig-endian" >>> >> +fi >>> >> + >>> >> if test "x$target_m32" =3D x1; then >>> >> # Force 32-bit mode. >>> >> TARGET_CFLAGS=3D"$TARGET_CFLAGS -m32" >>> >> -- >>> >> 2.1.0 >>> >> >>> >> >>> >> _______________________________________________ >>> >> Grub-devel mailing list >>> >> Grub-devel@gnu.org >>> >> https://lists.gnu.org/mailman/listinfo/grub-devel >>> > >>> > >>> > _______________________________________________ >>> > Grub-devel mailing list >>> > Grub-devel@gnu.org >>> > https://lists.gnu.org/mailman/listinfo/grub-devel >>> > >>> >>> _______________________________________________ >>> Grub-devel mailing list >>> Grub-devel@gnu.org >>> https://lists.gnu.org/mailman/listinfo/grub-devel >>> >>> >>> >>> _______________________________________________ >>> Grub-devel mailing list >>> Grub-devel@gnu.org >>> https://lists.gnu.org/mailman/listinfo/grub-devel >>> >> >> >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 --------------090907070509050209020900 Content-Type: text/x-diff; name="be.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="be.diff" diff --git a/configure.ac b/configure.ac index fd8a62e..a4ee419 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,33 @@ 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" \ + "-mbig-endian"; do + if test x"$grub_cv_target_cc_big_endian" !=3D xno ; then + break + fi + CFLAGS=3D"$TARGET_CFLAGS $cand -Werror" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__ORDER= _BIG_ENDIAN__ !=3D __BYTE_ORDER__) +#error still little endian +#endif +]], [[]])], + [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" --------------090907070509050209020900-- --A6CsfNCo6t77x3GBfrEchaGbxcIIUESba 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 iF4EAREKAAYFAlWmjloACgkQmBXlbbo5nOuWCwD+LpxCHFvIjWsAKhBE3LRKOjJ0 CXDzoX66BDryGcyTlLcBAJyfmGebcnQ6pOJGe/+EaRummpAQXR5CYEIDRKaX3/HA =VOW2 -----END PGP SIGNATURE----- --A6CsfNCo6t77x3GBfrEchaGbxcIIUESba--