aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@neptun.(none)>2007-10-14 16:21:35 -0400
committerSam Ravnborg <sam@neptun.(none)>2007-10-14 16:21:35 -0400
commita0f97e06a43cf524e616f09e6af3398e1e9c1c5b (patch)
tree2503b24bdbc144aea9ea5bde6ead94b3406eaf98 /arch/powerpc/Makefile
parent9a39e273d4df0560c724c5fe71f6314a0583ca2b (diff)
kbuild: enable 'make CFLAGS=...' to add additional options to CC
The variable CFLAGS is a wellknown variable and the usage by kbuild may result in unexpected behaviour. On top of that several people over time has asked for a way to pass in additional flags to gcc. This patch replace use of CFLAGS with KBUILD_CFLAGS all over the tree and enabling one to use: make CFLAGS=... to specify additional gcc commandline options. One usecase is when trying to find gcc bugs but other use cases has been requested too. Patch was tested on following architectures: alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k Test was simple to do a defconfig build, apply the patch and check that nothing got rebuild. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'arch/powerpc/Makefile')
-rw-r--r--arch/powerpc/Makefile24
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 643839a3f5d8..51309848c11d 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -77,8 +77,8 @@ CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none -mcall-aixdesc
77CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple 77CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple
78CPPFLAGS += $(CPPFLAGS-y) 78CPPFLAGS += $(CPPFLAGS-y)
79AFLAGS += $(AFLAGS-y) 79AFLAGS += $(AFLAGS-y)
80CFLAGS += -msoft-float -pipe $(CFLAGS-y) 80KBUILD_CFLAGS += -msoft-float -pipe $(CFLAGS-y)
81CPP = $(CC) -E $(CFLAGS) 81CPP = $(CC) -E $(KBUILD_CFLAGS)
82 82
83CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__ 83CHECKFLAGS += -m$(CONFIG_WORD_SIZE) -D__powerpc__ -D__powerpc$(CONFIG_WORD_SIZE)__
84 84
@@ -88,35 +88,35 @@ GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi
88ifeq ($(CONFIG_POWER4_ONLY),y) 88ifeq ($(CONFIG_POWER4_ONLY),y)
89ifeq ($(CONFIG_ALTIVEC),y) 89ifeq ($(CONFIG_ALTIVEC),y)
90ifeq ($(GCC_BROKEN_VEC),y) 90ifeq ($(GCC_BROKEN_VEC),y)
91 CFLAGS += $(call cc-option,-mcpu=970) 91 KBUILD_CFLAGS += $(call cc-option,-mcpu=970)
92else 92else
93 CFLAGS += $(call cc-option,-mcpu=power4) 93 KBUILD_CFLAGS += $(call cc-option,-mcpu=power4)
94endif 94endif
95else 95else
96 CFLAGS += $(call cc-option,-mcpu=power4) 96 KBUILD_CFLAGS += $(call cc-option,-mcpu=power4)
97endif 97endif
98else 98else
99 CFLAGS += $(call cc-option,-mtune=power4) 99 KBUILD_CFLAGS += $(call cc-option,-mtune=power4)
100endif 100endif
101endif 101endif
102 102
103ifeq ($(CONFIG_TUNE_CELL),y) 103ifeq ($(CONFIG_TUNE_CELL),y)
104 CFLAGS += $(call cc-option,-mtune=cell) 104 KBUILD_CFLAGS += $(call cc-option,-mtune=cell)
105endif 105endif
106 106
107# No AltiVec instruction when building kernel 107# No AltiVec instruction when building kernel
108CFLAGS += $(call cc-option,-mno-altivec) 108KBUILD_CFLAGS += $(call cc-option,-mno-altivec)
109 109
110# Enable unit-at-a-time mode when possible. It shrinks the 110# Enable unit-at-a-time mode when possible. It shrinks the
111# kernel considerably. 111# kernel considerably.
112CFLAGS += $(call cc-option,-funit-at-a-time) 112KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
113 113
114# Never use string load/store instructions as they are 114# Never use string load/store instructions as they are
115# often slow when they are implemented at all 115# often slow when they are implemented at all
116CFLAGS += -mno-string 116KBUILD_CFLAGS += -mno-string
117 117
118ifeq ($(CONFIG_6xx),y) 118ifeq ($(CONFIG_6xx),y)
119CFLAGS += -mcpu=powerpc 119KBUILD_CFLAGS += -mcpu=powerpc
120endif 120endif
121 121
122cpu-as-$(CONFIG_4xx) += -Wa,-m405 122cpu-as-$(CONFIG_4xx) += -Wa,-m405
@@ -126,7 +126,7 @@ cpu-as-$(CONFIG_E500) += -Wa,-me500
126cpu-as-$(CONFIG_E200) += -Wa,-me200 126cpu-as-$(CONFIG_E200) += -Wa,-me200
127 127
128AFLAGS += $(cpu-as-y) 128AFLAGS += $(cpu-as-y)
129CFLAGS += $(cpu-as-y) 129KBUILD_CFLAGS += $(cpu-as-y)
130 130
131head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o 131head-y := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
132head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o 132head-$(CONFIG_8xx) := arch/powerpc/kernel/head_8xx.o