nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0141-Add-powerpc-little-endian-ppc64le-flags.patch

39700a
From 8014cad21bb2cc986f10f0a927036851f490a8ec Mon Sep 17 00:00:00 2001
39700a
From: Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
39700a
Date: Wed, 13 Aug 2014 18:59:58 +0000
39700a
Subject: [PATCH 141/143] Add powerpc little-endian (ppc64le) flags
39700a
39700a
libgcc dependency was removed *just* for this target because
39700a
the distros that use ppc64el doesn't have 32-bit support on it.
39700a
39700a
* configure.ac: Add targets for powerpc64el and skip libgcc.
39700a
* Makefile.am: Likewise.
39700a
---
39700a
 configure.ac          | 17 +++++++++++++++--
39700a
 grub-core/Makefile.am |  2 ++
39700a
 2 files changed, 17 insertions(+), 2 deletions(-)
39700a
39700a
diff --git a/configure.ac b/configure.ac
39700a
index 2632e2d..53fd7c7 100644
39700a
--- a/configure.ac
39700a
+++ b/configure.ac
39700a
@@ -142,6 +142,7 @@ if test "x$with_platform" = x; then
39700a
     x86_64-*) platform=pc ;;
39700a
     powerpc-*) platform=ieee1275 ;;
39700a
     powerpc64-*) platform=ieee1275 ;;
39700a
+    powerpc64le-*) platform=ieee1275 ;;
39700a
     sparc64-*) platform=ieee1275 ;;
39700a
     mipsel-*) platform=loongson ;;
39700a
     mips-*) platform=arc ;;
39700a
@@ -160,6 +161,7 @@ case "$target_cpu"-"$platform" in
39700a
   x86_64-xen) ;;
39700a
   x86_64-*) target_cpu=i386 ;;
39700a
   powerpc64-ieee1275) target_cpu=powerpc ;;
39700a
+  powerpc64le-ieee1275) target_cpu=powerpc ;;
39700a
 esac
39700a
 
39700a
 # Check if the platform is supported, make final adjustments.
39700a
@@ -604,6 +606,13 @@ if test "x$target_cpu" = xi386 && test "x$platform" != xemu; then
39700a
   TARGET_CFLAGS="$TARGET_CFLAGS -march=i386"
39700a
 fi
39700a
 
39700a
+if test x$target_cpu = xpowerpc && test x$ac_cv_c_bigendian = xno; then
39700a
+	LD_FORCE_LE=1
39700a
+	TARGET_CFLAGS="$TARGET_CFLAGS -mbig-endian -DNO_LIBGCC=1"
39700a
+	TARGET_CCASFLAGS="$TARGET_CCASFLAGS -mbig-endian"
39700a
+	TARGET_LDFLAGS="$TARGET_LDFLAGS -static -mbig-endian"
39700a
+fi
39700a
+
39700a
 if test "x$target_m32" = x1; then
39700a
   # Force 32-bit mode.
39700a
   TARGET_CFLAGS="$TARGET_CFLAGS -m32"
39700a
@@ -1047,7 +1056,8 @@ else
39700a
 CFLAGS="$TARGET_CFLAGS -nostdlib -Wno-error"
39700a
 fi
39700a
 CPPFLAGS="$TARGET_CPPFLAGS"
39700a
-if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 || test "x$grub_cv_cc_target_clang" = xyes ; then
39700a
+if test x$target_cpu = xi386 || test x$target_cpu = xx86_64 || test "x$grub_cv_cc_target_clang" = xyes \
39700a
+	|| ( test x$target_cpu = xpowerpc && test x$ac_cv_c_bigendian = xno ); then
39700a
 TARGET_LIBGCC=
39700a
 else
39700a
 TARGET_LIBGCC=-lgcc
39700a
@@ -1631,7 +1641,9 @@ if test x"$enable_werror" != xno ; then
39700a
   HOST_CFLAGS="$HOST_CFLAGS -Werror"
39700a
 fi
39700a
 
39700a
-if test "x$grub_cv_cc_target_clang" = xno; then
39700a
+# if not clang or power LE, use static libgcc
39700a
+if test "x$grub_cv_cc_target_clang" = xno \
39700a
+   || ! ( test x$target_cpu = xpowerpc && test x$ac_cv_c_bigendian = xno ); then
39700a
    TARGET_LDFLAGS_STATIC_LIBGCC="-static-libgcc"
39700a
 else
39700a
    TARGET_LDFLAGS_STATIC_LIBGCC=
39700a
@@ -1694,6 +1706,7 @@ AM_CONDITIONAL([COND_mips_arc], [test "(" x$target_cpu = xmips -o x$target_cpu =
39700a
 AM_CONDITIONAL([COND_sparc64_ieee1275], [test x$target_cpu = xsparc64 -a x$platform = xieee1275])
39700a
 AM_CONDITIONAL([COND_sparc64_emu], [test x$target_cpu = xsparc64 -a x$platform = xemu])
39700a
 AM_CONDITIONAL([COND_powerpc_ieee1275], [test x$target_cpu = xpowerpc -a x$platform = xieee1275])
39700a
+AM_CONDITIONAL([COND_powerpc_le], [test x$target_cpu = xpowerpc -a x$ac_cv_c_bigendian = xno])
39700a
 AM_CONDITIONAL([COND_mips], [test x$target_cpu = xmips -o x$target_cpu = xmipsel])
39700a
 AM_CONDITIONAL([COND_mipsel], [test x$target_cpu = xmipsel])
39700a
 AM_CONDITIONAL([COND_mipseb], [test x$target_cpu = xmips])
39700a
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
39700a
index 5c087c8..cb7fd9f 100644
39700a
--- a/grub-core/Makefile.am
39700a
+++ b/grub-core/Makefile.am
39700a
@@ -84,8 +84,10 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/time.h
39700a
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/mm_private.h
39700a
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/net.h
39700a
 if !COND_clang
39700a
+if !COND_powerpc_le
39700a
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/libgcc.h
39700a
 endif
39700a
+endif
39700a
 KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/memory.h
39700a
 
39700a
 if COND_i386_pc
39700a
-- 
39700a
1.9.3
39700a