diff options
author | Sam Ravnborg <sam@neptun.(none)> | 2007-10-14 16:21:35 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@neptun.(none)> | 2007-10-14 16:21:35 -0400 |
commit | a0f97e06a43cf524e616f09e6af3398e1e9c1c5b (patch) | |
tree | 2503b24bdbc144aea9ea5bde6ead94b3406eaf98 /arch/i386/Makefile | |
parent | 9a39e273d4df0560c724c5fe71f6314a0583ca2b (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/i386/Makefile')
-rw-r--r-- | arch/i386/Makefile | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/i386/Makefile b/arch/i386/Makefile index 5e50dbf00f3e..fc3c8e88b744 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile | |||
@@ -34,10 +34,10 @@ LDFLAGS_vmlinux := --emit-relocs | |||
34 | endif | 34 | endif |
35 | CHECKFLAGS += -D__i386__ | 35 | CHECKFLAGS += -D__i386__ |
36 | 36 | ||
37 | CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return | 37 | KBUILD_CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return |
38 | 38 | ||
39 | # prevent gcc from keeping the stack 16 byte aligned | 39 | # prevent gcc from keeping the stack 16 byte aligned |
40 | CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) | 40 | KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) |
41 | 41 | ||
42 | # CPU-specific tuning. Anything which can be shared with UML should go here. | 42 | # CPU-specific tuning. Anything which can be shared with UML should go here. |
43 | include $(srctree)/arch/i386/Makefile.cpu | 43 | include $(srctree)/arch/i386/Makefile.cpu |
@@ -51,7 +51,7 @@ cflags-y += -maccumulate-outgoing-args | |||
51 | 51 | ||
52 | # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use | 52 | # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use |
53 | # a lot more stack due to the lack of sharing of stacklots: | 53 | # a lot more stack due to the lack of sharing of stacklots: |
54 | CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;) | 54 | KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call cc-option,-fno-unit-at-a-time); fi ;) |
55 | 55 | ||
56 | # do binutils support CFI? | 56 | # do binutils support CFI? |
57 | cflags-y += $(call as-instr,.cfi_startproc\n.cfi_rel_offset esp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,) | 57 | cflags-y += $(call as-instr,.cfi_startproc\n.cfi_rel_offset esp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,) |
@@ -61,7 +61,7 @@ AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_rel_offset esp${comma}0\n.cfi_end | |||
61 | cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,) | 61 | cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,) |
62 | AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,) | 62 | AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,) |
63 | 63 | ||
64 | CFLAGS += $(cflags-y) | 64 | KBUILD_CFLAGS += $(cflags-y) |
65 | 65 | ||
66 | # Default subarch .c files | 66 | # Default subarch .c files |
67 | mcore-y := arch/x86/mach-default | 67 | mcore-y := arch/x86/mach-default |
@@ -116,7 +116,7 @@ drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/ | |||
116 | drivers-$(CONFIG_PM) += arch/x86/power/ | 116 | drivers-$(CONFIG_PM) += arch/x86/power/ |
117 | drivers-$(CONFIG_FB) += arch/x86/video/ | 117 | drivers-$(CONFIG_FB) += arch/x86/video/ |
118 | 118 | ||
119 | CFLAGS += $(mflags-y) | 119 | KBUILD_CFLAGS += $(mflags-y) |
120 | AFLAGS += $(mflags-y) | 120 | AFLAGS += $(mflags-y) |
121 | 121 | ||
122 | boot := arch/x86/boot | 122 | boot := arch/x86/boot |