[Skiboot] [RFC PATCH 3/3] build: CFLAGS compile with -mcpu=power7

Nicholas Piggin npiggin at gmail.com
Tue Jul 18 20:40:08 AEST 2017


The gcc powerpc64le cross compiler for x86 builds with -mcpu=power8 by
default, which does not match the powerpc64 compiler, and is not
the right thing to do for POWER7 support.

Pass -mcpu=power7 explicitly. This may cause a change of target on
existing BE toolchains.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 Makefile.main | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile.main b/Makefile.main
index b8fed59b..551f8b5a 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -67,6 +67,7 @@ CPPFLAGS += -DDEBUG -DCCAN_LIST_DEBUG
 endif
 
 CFLAGS := -fno-strict-aliasing -pie -fpie -fno-pic -mbig-endian -m64
+CFLAGS += -mcpu=power7
 CFLAGS += -Wl,--oformat,elf64-powerpc
 CFLAGS += -ffixed-r13
 CFLAGS += $(call try-cflag,$(CC),-std=gnu11)
@@ -109,7 +110,7 @@ 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 += -mbig-endian -Wl,--oformat,elf64-powerpc
+LDFLAGS += -mcpu=power7 -mbig-endian -Wl,--oformat,elf64-powerpc
 
 LDRFLAGS=-melf64ppc
 # Debug stuff
-- 
2.11.0



More information about the Skiboot mailing list