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

Submitted by Nicholas Piggin on July 18, 2017, 10:40 a.m.

Details

Message ID 20170718104008.9624-4-npiggin@gmail.com
State New
Headers show

Commit Message

Nicholas Piggin July 18, 2017, 10:40 a.m.
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@gmail.com>
---
 Makefile.main | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

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