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/frv | |
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/frv')
-rw-r--r-- | arch/frv/Makefile | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/frv/Makefile b/arch/frv/Makefile index 9bf7345c5cc9..ec89886ed455 100644 --- a/arch/frv/Makefile +++ b/arch/frv/Makefile | |||
@@ -39,13 +39,13 @@ endif | |||
39 | ARCHMODFLAGS += -G0 -mlong-calls | 39 | ARCHMODFLAGS += -G0 -mlong-calls |
40 | 40 | ||
41 | ifdef CONFIG_GPREL_DATA_8 | 41 | ifdef CONFIG_GPREL_DATA_8 |
42 | CFLAGS += -G8 | 42 | KBUILD_CFLAGS += -G8 |
43 | else | 43 | else |
44 | ifdef CONFIG_GPREL_DATA_4 | 44 | ifdef CONFIG_GPREL_DATA_4 |
45 | CFLAGS += -G4 | 45 | KBUILD_CFLAGS += -G4 |
46 | else | 46 | else |
47 | ifdef CONFIG_GPREL_DATA_NONE | 47 | ifdef CONFIG_GPREL_DATA_NONE |
48 | CFLAGS += -G0 | 48 | KBUILD_CFLAGS += -G0 |
49 | endif | 49 | endif |
50 | endif | 50 | endif |
51 | endif | 51 | endif |
@@ -53,25 +53,25 @@ endif | |||
53 | #LDFLAGS_vmlinux := -Map linkmap.txt | 53 | #LDFLAGS_vmlinux := -Map linkmap.txt |
54 | 54 | ||
55 | ifdef CONFIG_GC_SECTIONS | 55 | ifdef CONFIG_GC_SECTIONS |
56 | CFLAGS += -ffunction-sections -fdata-sections | 56 | KBUILD_CFLAGS += -ffunction-sections -fdata-sections |
57 | LINKFLAGS += --gc-sections | 57 | LINKFLAGS += --gc-sections |
58 | endif | 58 | endif |
59 | 59 | ||
60 | ifndef CONFIG_FRAME_POINTER | 60 | ifndef CONFIG_FRAME_POINTER |
61 | CFLAGS += -mno-linked-fp | 61 | KBUILD_CFLAGS += -mno-linked-fp |
62 | endif | 62 | endif |
63 | 63 | ||
64 | ifdef CONFIG_CPU_FR451_COMPILE | 64 | ifdef CONFIG_CPU_FR451_COMPILE |
65 | CFLAGS += -mcpu=fr450 | 65 | KBUILD_CFLAGS += -mcpu=fr450 |
66 | AFLAGS += -mcpu=fr450 | 66 | AFLAGS += -mcpu=fr450 |
67 | ASFLAGS += -mcpu=fr450 | 67 | ASFLAGS += -mcpu=fr450 |
68 | else | 68 | else |
69 | ifdef CONFIG_CPU_FR551_COMPILE | 69 | ifdef CONFIG_CPU_FR551_COMPILE |
70 | CFLAGS += -mcpu=fr550 | 70 | KBUILD_CFLAGS += -mcpu=fr550 |
71 | AFLAGS += -mcpu=fr550 | 71 | AFLAGS += -mcpu=fr550 |
72 | ASFLAGS += -mcpu=fr550 | 72 | ASFLAGS += -mcpu=fr550 |
73 | else | 73 | else |
74 | CFLAGS += -mcpu=fr400 | 74 | KBUILD_CFLAGS += -mcpu=fr400 |
75 | AFLAGS += -mcpu=fr400 | 75 | AFLAGS += -mcpu=fr400 |
76 | ASFLAGS += -mcpu=fr400 | 76 | ASFLAGS += -mcpu=fr400 |
77 | endif | 77 | endif |
@@ -80,15 +80,15 @@ endif | |||
80 | # pretend the kernel is going to run on an FR400 with no media-fp unit | 80 | # pretend the kernel is going to run on an FR400 with no media-fp unit |
81 | # - reserve CC3 for use with atomic ops | 81 | # - reserve CC3 for use with atomic ops |
82 | # - all the extra registers are dealt with only at context switch time | 82 | # - all the extra registers are dealt with only at context switch time |
83 | CFLAGS += -mno-fdpic -mgpr-32 -msoft-float -mno-media | 83 | KBUILD_CFLAGS += -mno-fdpic -mgpr-32 -msoft-float -mno-media |
84 | CFLAGS += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 -ffixed-icc2 | 84 | KBUILD_CFLAGS += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 -ffixed-icc2 |
85 | AFLAGS += -mno-fdpic | 85 | AFLAGS += -mno-fdpic |
86 | ASFLAGS += -mno-fdpic | 86 | ASFLAGS += -mno-fdpic |
87 | 87 | ||
88 | # make sure the .S files get compiled with debug info | 88 | # make sure the .S files get compiled with debug info |
89 | # and disable optimisations that are unhelpful whilst debugging | 89 | # and disable optimisations that are unhelpful whilst debugging |
90 | ifdef CONFIG_DEBUG_INFO | 90 | ifdef CONFIG_DEBUG_INFO |
91 | #CFLAGS += -O1 | 91 | #KBUILD_CFLAGS += -O1 |
92 | AFLAGS += -Wa,--gdwarf2 | 92 | AFLAGS += -Wa,--gdwarf2 |
93 | ASFLAGS += -Wa,--gdwarf2 | 93 | ASFLAGS += -Wa,--gdwarf2 |
94 | endif | 94 | endif |