From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Nicholas Piggin <npiggin@gmail.com>,
Alan Modra <amodra@gmail.com>,
Segher Boessenkool <segher@kernel.crashing.org>
Subject: [RFC][PATCH] powerpc/64be: use ELFv2 ABI for big endian kernels
Date: Thu, 24 Nov 2016 00:08:40 +1100 [thread overview]
Message-ID: <20161123130840.1877-1-npiggin@gmail.com> (raw)
Question, are there any fundamental reasons we shouldn't use the ELFv2
ABI to build big endian kernels if the compiler supports it?
Thanks,
Nick
---
arch/powerpc/Makefile | 15 +++++----------
arch/powerpc/boot/Makefile | 2 +-
2 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 902da6e..b4867fc 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -72,18 +72,19 @@ GNUTARGET := powerpc
MULTIPLEWORD := -mmultiple
endif
+ifeq ($(CONFIG_PPC64),y)
+cflags-y += $(call cc-option,-mabi=elfv2)
+aflags-y += $(call cc-option,-mabi=elfv2)
+endif
+
cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian)
-cflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1)
cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian
-cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2
ifneq ($(cc-name),clang)
cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mno-strict-align
endif
aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian)
-aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mabi=elfv1)
aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian
-aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mabi=elfv2
ifeq ($(HAS_BIARCH),y)
override AS += -a$(BITS)
@@ -113,14 +114,8 @@ endif
endif
CFLAGS-$(CONFIG_PPC64) := $(call cc-option,-mtraceback=no)
-ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y)
CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2,$(call cc-option,-mcall-aixdesc))
AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv2)
-else
-CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcall-aixdesc)
-CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1)
-AFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mabi=elfv1)
-endif
CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mcmodel=medium,$(call cc-option,-mminimal-toc))
CFLAGS-$(CONFIG_PPC64) += $(call cc-option,-mno-pointers-to-nested-functions)
CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 $(MULTIPLEWORD)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 1d50d41..ef2499b 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -33,7 +33,7 @@ BOOTCFLAGS += -m64
endif
ifdef CONFIG_CPU_BIG_ENDIAN
BOOTCFLAGS += -mbig-endian
-BOOTCFLAGS += $(call cc-option,-mabi=elfv1)
+BOOTCFLAGS += $(call cc-option,-mabi=elfv2)
else
BOOTCFLAGS += -mlittle-endian
BOOTCFLAGS += $(call cc-option,-mabi=elfv2)
--
2.10.2
next reply other threads:[~2016-11-23 13:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 13:08 Nicholas Piggin [this message]
2016-11-23 14:20 ` [RFC][PATCH] powerpc/64be: use ELFv2 ABI for big endian kernels Balbir Singh
2016-11-23 14:38 ` Segher Boessenkool
2016-11-24 4:42 ` Nicholas Piggin
2016-11-24 5:37 ` Oliver O'Halloran
2016-11-24 12:27 ` Segher Boessenkool
2016-11-24 22:22 ` Michael Ellerman
2016-11-24 23:17 ` Segher Boessenkool
2016-11-25 1:13 ` Nicholas Piggin
2016-11-25 2:08 ` Michael Ellerman
2016-11-25 2:35 ` Nicholas Piggin
2016-11-25 3:35 ` Michael Ellerman
2016-11-25 2:02 ` Michael Ellerman
2016-11-25 14:59 ` Segher Boessenkool
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=20161123130840.1877-1-npiggin@gmail.com \
--to=npiggin@gmail.com \
--cc=amodra@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=segher@kernel.crashing.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.