grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH 1/2] Add powerpc little-endian (ppc64le) flags
Date: Wed, 15 Jul 2015 18:46:18 +0200	[thread overview]
Message-ID: <55A68E5A.7000204@gmail.com> (raw)
In-Reply-To: <20150630212856.12c56676@opensuse.site>


[-- Attachment #1.1: Type: text/plain, Size: 5364 bytes --]

On 30.06.2015 20:28, Andrei Borzenkov wrote:
> В Tue, 30 Jun 2015 15:05:46 -0300
> Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com> пишет:
> 
>> 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 said 
>> 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.
>>
>>
>> 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 using clang.
> 
> If I understand it correctly, it is possible to build for big-endian
> PowerPC using
> 
> clang -target=powerpc
> 
@pfsmorigo. Please try attached patch
> but then we depend on clang being built with BE target support; and
> e.g. openSUSE builds it with
> 
> cmake -G "Ninja" \
>       -DBUILD_SHARED_LIBS=OFF \
>       -DCMAKE_BUILD_TYPE=Release \
>       -DLLVM_ENABLE_ASSERTIONS=OFF \
>       -DLLVM_TARGETS_TO_BUILD=host \
>       -DCMAKE_C_FLAGS="-O0" \
>       -DCMAKE_CXX_FLAGS="-O0" \
>       -DLLVM_HOST_TRIPLE=%{host_triple} \
> 
> 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.
> 
> 
> 
>>>
>>> Le 30 juin 2015 16:30, "Andrei Borzenkov" <arvidjaar@gmail.com
>>> <mailto:arvidjaar@gmail.com>> a écrit :
>>>
>>>     On Tue, Jun 30, 2015 at 5:03 PM, Vladimir 'phcoder' Serbinenko
>>>     <phcoder@gmail.com <mailto:phcoder@gmail.com>> 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 for PPC.
>>>
>>>      > Le 30 juin 2015 14:57, "Paulo Flabiano Smorigo"
>>>      > <pfsmorigo@linux.vnet.ibm.com
>>>     <mailto:pfsmorigo@linux.vnet.ibm.com>> a écrit :
>>>      >>
>>>      >> libgcc dependency was removed *just* for this target because
>>>      >> the distros that use ppc64el doesn't have 32-bit support on it.
>>>      >>
>>>      >> * configure.ac <http://configure.ac>: Add targets for
>>>     powerpc64el and skip libgcc.
>>>      >> * Makefile.am: Likewise.
>>>      >> ---
>>>      >> configure.ac <http://configure.ac> | 8 ++++++++
>>>      >>  1 file changed, 8 insertions(+)
>>>      >>
>>>      >> diff --git a/configure.ac <http://configure.ac> b/configure.ac
>>>     <http://configure.ac>
>>>      >> index fd8a62e..0a79fad 100644
>>>      >> --- a/configure.ac <http://configure.ac>
>>>      >> +++ b/configure.ac <http://configure.ac>
>>>      >> @@ -116,6 +116,7 @@ if test "x$with_platform" = x; then
>>>      >>      x86_64-*) platform=pc ;;
>>>      >>      powerpc-*) platform=ieee1275 ;;
>>>      >>      powerpc64-*) platform=ieee1275 ;;
>>>      >> +    powerpc64le-*) platform=ieee1275 ;;
>>>      >>      sparc64-*) platform=ieee1275 ;;
>>>      >>      mipsel-*) platform=loongson ;;
>>>      >>      mips-*) platform=arc ;;
>>>      >> @@ -138,6 +139,7 @@ case "$target_cpu"-"$platform" in
>>>      >>    x86_64-none) ;;
>>>      >>    x86_64-*) target_cpu=i386 ;;
>>>      >>    powerpc64-ieee1275) target_cpu=powerpc ;;
>>>      >> +  powerpc64le-ieee1275) target_cpu=powerpc ;;
>>>      >>  esac
>>>      >>
>>>      >>  # Check if the platform is supported, make final adjustments.
>>>      >> @@ -601,6 +603,12 @@ if test "x$target_cpu" = xi386 && test
>>>     "x$platform"
>>>      >> != xemu; then
>>>      >>    TARGET_CFLAGS="$TARGET_CFLAGS -march=i386"
>>>      >>  fi
>>>      >>
>>>      >> +if test x$target_cpu = xpowerpc; then
>>>      >> +  TARGET_CFLAGS="$TARGET_CFLAGS -mbig-endian"
>>>      >> +  TARGET_CCASFLAGS="$TARGET_CCASFLAGS -mbig-endian"
>>>      >> +  TARGET_LDFLAGS="$TARGET_LDFLAGS -static -mbig-endian"
>>>      >> +fi
>>>      >> +
>>>      >>  if test "x$target_m32" = x1; then
>>>      >>    # Force 32-bit mode.
>>>      >>    TARGET_CFLAGS="$TARGET_CFLAGS -m32"
>>>      >> --
>>>      >> 2.1.0
>>>      >>
>>>      >>
>>>      >> _______________________________________________
>>>      >> Grub-devel mailing list
>>>      >> Grub-devel@gnu.org <mailto:Grub-devel@gnu.org>
>>>      >> https://lists.gnu.org/mailman/listinfo/grub-devel
>>>      >
>>>      >
>>>      > _______________________________________________
>>>      > Grub-devel mailing list
>>>      > Grub-devel@gnu.org <mailto:Grub-devel@gnu.org>
>>>      > https://lists.gnu.org/mailman/listinfo/grub-devel
>>>      >
>>>
>>>     _______________________________________________
>>>     Grub-devel mailing list
>>>     Grub-devel@gnu.org <mailto: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
> 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: be.diff --]
[-- Type: text/x-diff; name="be.diff", Size: 1935 bytes --]

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" = x; then
     x86_64-*) platform=pc ;;
     powerpc-*) platform=ieee1275 ;;
     powerpc64-*) platform=ieee1275 ;;
+    powerpc64le-*) platform=ieee1275 ;;
     sparc64-*) platform=ieee1275 ;;
     mipsel-*) platform=loongson ;;
     mips-*) platform=arc ;;
@@ -138,6 +139,7 @@ case "$target_cpu"-"$platform" in
   x86_64-none) ;;
   x86_64-*) target_cpu=i386 ;;
   powerpc64-ieee1275) target_cpu=powerpc ;;
+  powerpc64le-ieee1275) target_cpu=powerpc ;;
 esac
 
 # Check if the platform is supported, make final adjustments.
@@ -601,6 +603,33 @@ if test "x$target_cpu" = xi386 && test "x$platform" != xemu; then
   TARGET_CFLAGS="$TARGET_CFLAGS -march=i386"
 fi
 
+if test x$target_cpu = xpowerpc; then
+  AC_CACHE_CHECK([for options to get big-endian compilation], grub_cv_target_cc_big_endian, [
+    grub_cv_target_cc_big_endian=no
+    for cand in "-target powerpc" \
+		"-mbig-endian"; do
+      if test x"$grub_cv_target_cc_big_endian" != xno ; then
+        break
+      fi
+      CFLAGS="$TARGET_CFLAGS $cand -Werror"
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__ORDER_BIG_ENDIAN__ != __BYTE_ORDER__)
+#error still little endian
+#endif
+]], [[]])],
+		        [grub_cv_target_cc_big_endian="$cand"], [])
+    done
+  ])
+
+  if test x"$grub_cv_target_cc_big_endian" = xno ; then
+    AC_MSG_ERROR([could not force big-endian])
+  fi
+
+  TARGET_CFLAGS="$TARGET_CFLAGS $grub_cv_target_cc_big_endian"
+  TARGET_CCASFLAGS="$TARGET_CCASFLAGS $grub_cv_target_cc_big_endian"
+  TARGET_LDFLAGS="$TARGET_LDFLAGS -static $grub_cv_target_cc_big_endian"
+fi
+
 if test "x$target_m32" = x1; then
   # Force 32-bit mode.
   TARGET_CFLAGS="$TARGET_CFLAGS -m32"

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 213 bytes --]

  parent reply	other threads:[~2015-07-15 16:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 12:56 [PATCH 0/2] Add remaining parts for ppc64le environment Paulo Flabiano Smorigo
2015-06-30 12:56 ` [PATCH 1/2] Add powerpc little-endian (ppc64le) flags Paulo Flabiano Smorigo
2015-06-30 14:03   ` Vladimir 'phcoder' Serbinenko
2015-06-30 14:29     ` Andrei Borzenkov
2015-06-30 14:33       ` Vladimir 'phcoder' Serbinenko
2015-06-30 18:05         ` Paulo Flabiano Smorigo
2015-06-30 18:28           ` Andrei Borzenkov
2015-06-30 19:34             ` Vladimir 'phcoder' Serbinenko
2015-07-04  6:46               ` Andrei Borzenkov
2015-07-05 17:38                 ` Andrei Borzenkov
2015-07-15 17:42                   ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-07-16 18:55                     ` Andrei Borzenkov
2015-07-16 19:05                       ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-07-16 19:30                         ` Andrei Borzenkov
2015-07-20 13:01                           ` Paulo Flabiano Smorigo
2015-07-22  3:23                     ` Andrei Borzenkov
2015-07-22 17:00                       ` Paulo Flabiano Smorigo
2015-07-15 17:36                 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-07-15 16:46             ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2015-06-30 14:33       ` Paulo Flabiano Smorigo
2015-06-30 12:56 ` [PATCH 2/2] Suport for bi-endianess in elf file Paulo Flabiano Smorigo
2015-06-30 15:03   ` Andrei Borzenkov
2015-06-30 18:06     ` Paulo Flabiano Smorigo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55A68E5A.7000204@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).