aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/Makefile')
-rw-r--r--arch/powerpc/Makefile49
1 files changed, 23 insertions, 26 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 6524c6e21896..950d1f7a5a39 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -69,6 +69,16 @@ LDFLAGS_vmlinux := $(LDFLAGS_vmlinux-y)
69 69
70CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=no -mcall-aixdesc 70CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=no -mcall-aixdesc
71CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple 71CFLAGS-$(CONFIG_PPC32) := -ffixed-r2 -mmultiple
72
73CFLAGS-$(CONFIG_GENERIC_CPU) += $(call cc-option,-mtune=power7,-mtune=power4)
74CFLAGS-$(CONFIG_CELL_CPU) += $(call cc-option,-mcpu=cell)
75CFLAGS-$(CONFIG_POWER4_CPU) += $(call cc-option,-mcpu=power4)
76CFLAGS-$(CONFIG_POWER5_CPU) += $(call cc-option,-mcpu=power5)
77CFLAGS-$(CONFIG_POWER6_CPU) += $(call cc-option,-mcpu=power6)
78CFLAGS-$(CONFIG_POWER7_CPU) += $(call cc-option,-mcpu=power7)
79
80CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell)
81
72KBUILD_CPPFLAGS += -Iarch/$(ARCH) 82KBUILD_CPPFLAGS += -Iarch/$(ARCH)
73KBUILD_AFLAGS += -Iarch/$(ARCH) 83KBUILD_AFLAGS += -Iarch/$(ARCH)
74KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) 84KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y)
@@ -76,32 +86,11 @@ CPP = $(CC) -E $(KBUILD_CFLAGS)
76 86
77CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ 87CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
78 88
79ifeq ($(CONFIG_PPC64),y)
80GCC_BROKEN_VEC := $(call cc-ifversion, -lt, 0400, y)
81
82ifeq ($(CONFIG_POWER4_ONLY),y)
83ifeq ($(CONFIG_ALTIVEC),y)
84ifeq ($(GCC_BROKEN_VEC),y)
85 KBUILD_CFLAGS += $(call cc-option,-mcpu=970)
86else
87 KBUILD_CFLAGS += $(call cc-option,-mcpu=power4)
88endif
89else
90 KBUILD_CFLAGS += $(call cc-option,-mcpu=power4)
91endif
92else
93 KBUILD_CFLAGS += $(call cc-option,-mtune=power4)
94endif
95endif
96
97KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o 89KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
98 90
99ifeq ($(CONFIG_TUNE_CELL),y) 91# No AltiVec or VSX instructions when building kernel
100 KBUILD_CFLAGS += $(call cc-option,-mtune=cell)
101endif
102
103# No AltiVec instruction when building kernel
104KBUILD_CFLAGS += $(call cc-option,-mno-altivec) 92KBUILD_CFLAGS += $(call cc-option,-mno-altivec)
93KBUILD_CFLAGS += $(call cc-option,-mno-vsx)
105 94
106# No SPE instruction when building kernel 95# No SPE instruction when building kernel
107# (We use all available options to help semi-broken compilers) 96# (We use all available options to help semi-broken compilers)
@@ -160,6 +149,7 @@ core-$(CONFIG_KVM) += arch/powerpc/kvm/
160core-$(CONFIG_PERF_EVENTS) += arch/powerpc/perf/ 149core-$(CONFIG_PERF_EVENTS) += arch/powerpc/perf/
161 150
162drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ 151drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
152drivers-$(CONFIG_CRYPTO_DEV_NX) += drivers/crypto/nx/
163 153
164# Default to zImage, override when needed 154# Default to zImage, override when needed
165all: zImage 155all: zImage
@@ -234,10 +224,11 @@ archprepare: checkbin
234# Use the file '.tmp_gas_check' for binutils tests, as gas won't output 224# Use the file '.tmp_gas_check' for binutils tests, as gas won't output
235# to stdout and these checks are run even on install targets. 225# to stdout and these checks are run even on install targets.
236TOUT := .tmp_gas_check 226TOUT := .tmp_gas_check
237# Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
238# instructions.
239# gcc-3.4 and binutils-2.14 are a fatal combination.
240 227
228# Check gcc and binutils versions:
229# - gcc-3.4 and binutils-2.14 are a fatal combination
230# - Require gcc 4.0 or above on 64-bit
231# - gcc-4.2.0 has issues compiling modules on 64-bit
241checkbin: 232checkbin:
242 @if test "$(call cc-version)" = "0304" ; then \ 233 @if test "$(call cc-version)" = "0304" ; then \
243 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \ 234 if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
@@ -247,6 +238,12 @@ checkbin:
247 false; \ 238 false; \
248 fi ; \ 239 fi ; \
249 fi 240 fi
241 @if test "$(call cc-version)" -lt "0400" \
242 && test "x${CONFIG_PPC64}" = "xy" ; then \
243 echo -n "Sorry, GCC v4.0 or above is required to build " ; \
244 echo "the 64-bit powerpc kernel." ; \
245 false ; \
246 fi
250 @if test "$(call cc-fullversion)" = "040200" \ 247 @if test "$(call cc-fullversion)" = "040200" \
251 && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \ 248 && test "x${CONFIG_MODULES}${CONFIG_PPC64}" = "xyy" ; then \
252 echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \ 249 echo -n '*** GCC-4.2.0 cannot compile the 64-bit powerpc ' ; \