aboutsummaryrefslogtreecommitdiff
path: root/Makefile.main
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2017-01-05 19:35:47 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-02-06 18:40:48 +1100
commit4ebde139333659b6de4516830a2785b8a89c08a4 (patch)
treea04a547f3971f98a2bff5f777884daf19e5bf863 /Makefile.main
parent420d62d8f545204ff615b3062b01babb8b98e11c (diff)
downloadskiboot-4ebde139333659b6de4516830a2785b8a89c08a4.zip
skiboot-4ebde139333659b6de4516830a2785b8a89c08a4.tar.gz
skiboot-4ebde139333659b6de4516830a2785b8a89c08a4.tar.bz2
Initial support for the ELFv2 ABI
Provide an experimental option to compile using ELFv2 ABI even on big endian builds. ELFv2 + BE is not officially supported by the toolchain, but it works quite well. It may be useful as a small step toward a little-endian build. This saves about 200kB of text/data. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'Makefile.main')
-rw-r--r--Makefile.main11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile.main b/Makefile.main
index d71635b..5656cb7 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -71,8 +71,12 @@ endif
CFLAGS := -fno-strict-aliasing -pie -mbig-endian -m64
CFLAGS += -Wl,--oformat,elf64-powerpc
CFLAGS += -ffixed-r13
-CFLAGS += $(call try-cflag,$(CC),-mabi=elfv1)
CFLAGS += $(call try-cflag,$(CC),-std=gnu11)
+ifeq ($(ELF_ABI_v2),1)
+CFLAGS += $(call try-cflag,$(CC),-mabi=elfv2)
+else
+CFLAGS += $(call try-cflag,$(CC),-mabi=elfv1)
+endif
ifeq ($(SKIBOOT_GCOV),1)
CFLAGS += -fprofile-arcs -ftest-coverage -DSKIBOOT_GCOV=1
@@ -109,6 +113,11 @@ LDRFLAGS=-melf64ppc
#LDFLAGS += -Wl,-v -Wl,-Map,foomap
AFLAGS := -D__ASSEMBLY__ -mbig-endian -m64
+ifeq ($(ELF_ABI_v2),1)
+AFLAGS += $(call try-cflag,$(CC),-mabi=elfv2)
+else
+AFLAGS += $(call try-cflag,$(CC),-mabi=elfv1)
+endif
# Special tool flags:
# Do not use the floating point unit