diff options
author | Anton Blanchard <anton@samba.org> | 2012-04-17 14:45:28 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2012-04-30 01:37:27 -0400 |
commit | d23c6fb4ebf7d3563dd801c95b22ada4516e35ce (patch) | |
tree | 2de1bad46e8c2909835e7e014b43fde87d866fc3 /arch/powerpc/Makefile | |
parent | 894a65c857b2e595da1c65d1ad1a7c559ac88c8d (diff) |
powerpc: Add 64-bit CPU targets for gcc
Add a menu to select various 64-bit CPU targets for gcc. We
default to -mtune=power7 and if gcc doesn't understand that we
fallback to -mtune=power4.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/Makefile')
-rw-r--r-- | arch/powerpc/Makefile | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 6ee3beb4d264..159e94f4b22a 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -69,6 +69,16 @@ LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y) | |||
69 | 69 | ||
70 | CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=no -mcall-aixdesc | 70 | CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=no -mcall-aixdesc |
71 | CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple | 71 | CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple |
72 | |||
73 | CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,-mtune=power4) | ||
74 | CFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell) | ||
75 | CFLAGS-$(CONFIG_POWER4_CPU) += $(call cc-option,-mcpu=power4) | ||
76 | CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5) | ||
77 | CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6) | ||
78 | CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7) | ||
79 | |||
80 | CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell) | ||
81 | |||
72 | KBUILD_CPPFLAGS += -Iarch/$(ARCH) | 82 | KBUILD_CPPFLAGS += -Iarch/$(ARCH) |
73 | KBUILD_AFLAGS += -Iarch/$(ARCH) | 83 | KBUILD_AFLAGS += -Iarch/$(ARCH) |
74 | KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) | 84 | KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) |
@@ -76,22 +86,11 @@ CPP = $(CC) -E $(KBUILD_CFLAGS) | |||
76 | 86 | ||
77 | CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ | 87 | CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ |
78 | 88 | ||
79 | ifeq ($(CONFIG_PPC64),y) | ||
80 | ifeq ($(CONFIG_POWER4_ONLY),y) | ||
81 | KBUILD_CFLAGS += $(call cc-option,-mcpu=power4) | ||
82 | else | ||
83 | KBUILD_CFLAGS += $(call cc-option,-mtune=power4) | ||
84 | endif | ||
85 | endif | ||
86 | |||
87 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o | 89 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o |
88 | 90 | ||
89 | ifeq ($(CONFIG_TUNE_CELL),y) | 91 | # No AltiVec or VSX instructions when building kernel |
90 | KBUILD_CFLAGS += $(call cc-option,-mtune=cell) | ||
91 | endif | ||
92 | |||
93 | # No AltiVec instruction when building kernel | ||
94 | KBUILD_CFLAGS += $(call cc-option,-mno-altivec) | 92 | KBUILD_CFLAGS += $(call cc-option,-mno-altivec) |
93 | KBUILD_CFLAGS += $(call cc-option,-mno-vsx) | ||
95 | 94 | ||
96 | # No SPE instruction when building kernel | 95 | # No SPE instruction when building kernel |
97 | # (We use all available options to help semi-broken compilers) | 96 | # (We use all available options to help semi-broken compilers) |