grub2/ppc64le.patch
Michael Chang eafb269f9e Accepting request 356507 from home:k0da:branches:Base:System
- Drop ppc64le patches. Build stage1 as BE for Power
  Droped patches:
  - grub2-ppc64le-01-Add-Little-Endian-support-for-Power64-to-the-build.patch
  - grub2-ppc64le-02-Build-grub-as-O1-until-we-add-savegpr-and-restgpr-ro.patch
  - grub2-ppc64le-03-disable-creation-of-vsx-and-altivec-instructions.patch
  - grub2-ppc64le-04-powerpc64-LE-s-linker-knows-how-to-handle-the-undefi.patch
  - grub2-ppc64le-05-grub-install-can-now-recognize-and-install-a-LE-grub.patch
  - grub2-ppc64le-06-set-the-ABI-version-to-0x02-in-the-e_flag-of-the-PPC.patch
  - grub2-ppc64le-07-Add-IEEE1275_ADDR-helper.patch
  - grub2-ppc64le-08-Fix-some-more-warnings-when-casting.patch
  - grub2-ppc64le-09-Add-powerpc64-types.patch
  - grub2-ppc64le-10-powerpc64-is-not-necessarily-BigEndian-anymore.patch
  - grub2-ppc64le-11-Fix-warnings-when-building-powerpc-linux-loader-64bi.patch
  - grub2-ppc64le-12-GRUB_ELF_R_PPC_-processing-is-applicable-only-for-32.patch
  - grub2-ppc64le-13-Fix-powerpc-setjmp-longjmp-64bit-issues.patch
  - grub2-ppc64le-14-Add-powerpc64-ieee1275-trampoline.patch
  - grub2-ppc64le-15-Add-64bit-support-to-powerpc-startup-code.patch
  - grub2-ppc64le-16-Add-grub_dl_find_section_addr.patch
  - grub2-ppc64le-17-Add-ppc64-relocations.patch
  - grub2-ppc64le-18-ppc64-doesn-t-need-libgcc-routines.patch
  - grub2-ppc64le-19-Use-FUNC_START-FUNC_END-for-powerpc-function-definit.patch
  - grub2-ppc64le-20-.TOC.-symbol-is-special-in-ppc64le-.-It-maps-to-the-.patch
  - grub2-ppc64le-21-the-.toc-section-in-powerpc64le-modules-are-sometime.patch
  - grub2-ppc64le-22-all-parameter-to-firmware-calls-should-to-be-BigEndi.patch
  - grub2-ppc64le-fix-64bit-trampoline-in-dyn-linker.patch
  - grub2-ppc64le-timeout.patch
  - grub2-ppc64-build-ppc64-32bit.patch
- Added patches:
  -  biendian.patch
  -  grub2-ppc64-cas-reboot-support.patch

OBS-URL: https://build.opensuse.org/request/show/356507
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=202
2016-01-29 03:26:23 +00:00

96 lines
3.8 KiB
Diff

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