diff options
Diffstat (limited to 'arch/powerpc/Makefile')
-rw-r--r-- | arch/powerpc/Makefile | 49 |
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 | ||
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,32 +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 | GCC_BROKEN_VEC := $(call cc-ifversion, -lt, 0400, y) | ||
81 | |||
82 | ifeq ($(CONFIG_POWER4_ONLY),y) | ||
83 | ifeq ($(CONFIG_ALTIVEC),y) | ||
84 | ifeq ($(GCC_BROKEN_VEC),y) | ||
85 | KBUILD_CFLAGS += $(call cc-option,-mcpu=970) | ||
86 | else | ||
87 | KBUILD_CFLAGS += $(call cc-option,-mcpu=power4) | ||
88 | endif | ||
89 | else | ||
90 | KBUILD_CFLAGS += $(call cc-option,-mcpu=power4) | ||
91 | endif | ||
92 | else | ||
93 | KBUILD_CFLAGS += $(call cc-option,-mtune=power4) | ||
94 | endif | ||
95 | endif | ||
96 | |||
97 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o | 89 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o |
98 | 90 | ||
99 | ifeq ($(CONFIG_TUNE_CELL),y) | 91 | # No AltiVec or VSX instructions when building kernel |
100 | KBUILD_CFLAGS += $(call cc-option,-mtune=cell) | ||
101 | endif | ||
102 | |||
103 | # No AltiVec instruction when building kernel | ||
104 | KBUILD_CFLAGS += $(call cc-option,-mno-altivec) | 92 | KBUILD_CFLAGS += $(call cc-option,-mno-altivec) |
93 | KBUILD_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/ | |||
160 | core-$(CONFIG_PERF_EVENTS) += arch/powerpc/perf/ | 149 | core-$(CONFIG_PERF_EVENTS) += arch/powerpc/perf/ |
161 | 150 | ||
162 | drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ | 151 | drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/ |
152 | drivers-$(CONFIG_CRYPTO_DEV_NX) += drivers/crypto/nx/ | ||
163 | 153 | ||
164 | # Default to zImage, override when needed | 154 | # Default to zImage, override when needed |
165 | all: zImage | 155 | all: 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. |
236 | TOUT := .tmp_gas_check | 226 | TOUT := .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 | ||
241 | checkbin: | 232 | checkbin: |
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 ' ; \ |