From: Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
To: grub-devel@gnu.org
Cc: Paulo Flabiano Smorigo <pfsmorigo@linux.vnet.ibm.com>
Subject: [RFC PATCH 1/3] Add powerpc little-endian (ppc64le) flags
Date: Thu, 28 Aug 2014 16:56:03 -0300 [thread overview]
Message-ID: <1409255765-3209-2-git-send-email-pfsmorigo@linux.vnet.ibm.com> (raw)
In-Reply-To: <1409255765-3209-1-git-send-email-pfsmorigo@linux.vnet.ibm.com>
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 8888c2f..1364c8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,6 +119,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 ;;
@@ -137,6 +138,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.
@@ -581,6 +583,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"
@@ -1024,7 +1033,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
@@ -1608,7 +1618,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=
@@ -1671,6 +1683,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.8.1.4
next prev parent reply other threads:[~2014-08-28 20:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 19:56 [RFC PATCH 0/3] grub powerpc64 little-endian enablement Paulo Flabiano Smorigo
2014-08-28 19:56 ` Paulo Flabiano Smorigo [this message]
2014-09-17 22:04 ` [RFC PATCH 1/3] Add powerpc little-endian (ppc64le) flags Paulo Flabiano Smorigo
2014-09-19 13:48 ` Colin Watson
2014-09-21 16:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-08-28 19:56 ` [RFC PATCH 2/3] Files reorganization and include some libgcc fuctions Paulo Flabiano Smorigo
2014-09-08 2:16 ` Colin Watson
2014-09-17 21:43 ` Paulo Flabiano Smorigo
2014-09-19 14:03 ` Colin Watson
2014-09-21 16:07 ` Vladimir 'φ-coder/phcoder' Serbinenko
2014-08-28 19:56 ` [RFC PATCH 3/3] Suport for bi-endianess in elf file Paulo Flabiano Smorigo
2015-06-16 16:44 ` Andrei Borzenkov
2014-09-21 13:58 ` [RFC PATCH 0/3] grub powerpc64 little-endian enablement Andrei Borzenkov
2014-09-21 14:24 ` Andrei Borzenkov
2014-09-25 22:48 ` Paulo Flabiano Smorigo
2014-09-26 15:52 ` Andrei Borzenkov
2014-09-26 18:18 ` Paulo Flabiano Smorigo
2015-06-15 17:15 ` Andrei Borzenkov
2015-06-16 12:36 ` 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=1409255765-3209-2-git-send-email-pfsmorigo@linux.vnet.ibm.com \
--to=pfsmorigo@linux.vnet.ibm.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).