aboutsummaryrefslogtreecommitdiff
path: root/Makefile.main
diff options
context:
space:
mode:
authorStewart Smith <stewart@flamingspork.com>2021-12-20 22:22:46 +1000
committerCédric Le Goater <clg@kaod.org>2022-01-03 16:12:45 +0100
commita6816a42c1f40481c998177b2b88329984ed25b2 (patch)
treea16e18b13ebec97cd8f1704b26d439f6d4da7a31 /Makefile.main
parentb2b4b311c4a2a084bb072eeaf8d9e0409a9eedd5 (diff)
downloadskiboot-a6816a42c1f40481c998177b2b88329984ed25b2.zip
skiboot-a6816a42c1f40481c998177b2b88329984ed25b2.tar.gz
skiboot-a6816a42c1f40481c998177b2b88329984ed25b2.tar.bz2
Add CONFIG_P8 with PHB3 behind it
We can use a base CPU of POWER9 if we don't have P8. We can also hide PHB3 code behind this, and shave 12kb off skiboot.lid.xz Reviewed-by: Dan Horák <dan@danny.cz> [npiggin: add cpp define, fail gracefully on P8] Signed-off-by: Stewart Smith <stewart@flamingspork.com> Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'Makefile.main')
-rw-r--r--Makefile.main15
1 files changed, 14 insertions, 1 deletions
diff --git a/Makefile.main b/Makefile.main
index c8a63e8..2a346a6 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -96,7 +96,11 @@ CPPFLAGS += -DDEBUG -DCCAN_LIST_DEBUG
endif
CFLAGS := -fno-strict-aliasing -pie -fpie -fno-pic -m64 -fno-asynchronous-unwind-tables
+ifeq ($(CONFIG_P8),1)
CFLAGS += -mcpu=power8
+else
+CFLAGS += -mcpu=power9
+endif
CFLAGS += -Wl,--oformat,elf64-powerpc -ggdb
# r13,r14,r15 are preserved for OS to use as fixed registers.
# These could be saved and restored in and out of skiboot, but it's more
@@ -156,6 +160,10 @@ else
CFLAGS += -fno-stack-protector
endif
+# Add preprocessor defines for CONFIG_ options here
+ifeq ($(CONFIG_P8),1)
+CFLAGS += -DCONFIG_P8=1
+endif
CFLAGS += $(call try-cflag,$(CC),-Wjump-misses-init) \
$(call try-cflag,$(CC),-Wsuggest-attribute=const) \
@@ -173,7 +181,12 @@ LDFLAGS := -m64 -static -nostdlib -pie
LDFLAGS += -Wl,-pie
LDFLAGS += -Wl,-Ttext-segment,$(LD_TEXT) -Wl,-N -Wl,--build-id=none
LDFLAGS += -Wl,--no-multi-toc
-LDFLAGS += -mcpu=power8 -Wl,--oformat,elf64-powerpc
+ifeq ($(CONFIG_P8),1)
+LDFLAGS += -mcpu=power8
+else
+LDFLAGS += -mcpu=power9
+endif
+LDFLAGS += -Wl,--oformat,elf64-powerpc
LDFLAGS_FINAL = -m elf64lppc --no-multi-toc -N --build-id=none --whole-archive
LDFLAGS_FINAL += -static -nostdlib -pie -Ttext-segment=$(LD_TEXT) --oformat=elf64-powerpc
LDFLAGS_FINAL += --orphan-handling=warn