diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2010-07-28 11:33:09 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-08-03 08:09:45 -0400 |
commit | 6588169d516560f68672e2928680b71c647b7806 (patch) | |
tree | 91b20bf9197c718ff4b5830bb1aea0b1bc0de272 /arch | |
parent | d6f4ceb796ebf1a8c8a9ad4a8ea0d181aaec7de6 (diff) |
kbuild: allow assignment to {A,C,LD}FLAGS_MODULE on the command line
It is now possible to assign options to AS, CC and LD
on the command line - which is only used when building modules.
{A,C,LD}FLAGS_MODULE was all used both in the top-level Makefile
in the arch makefiles, thus users had no way to specify
additional options to AS, CC, LD when building modules
without overriding the original value.
Introduce a new set of variables KBUILD_{A,C,LD}FLAGS_MODULE
that is used by arch specific files and free up
{A,C,LD}FLAGS_MODULE so they can be assigned on
the command line.
All arch Makefiles that used the old variables has been updated.
Note: Previously we had a MODFLAGS variable for both
AS and CC. But in favour of consistency this was dropped.
So in some cases arch Makefile has one assignmnet replaced by
two assignmnets.
Note2: MODFLAGS was not documented and is dropped
without any notice. I do not expect much/any breakage
from this.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Chen Liqin <liqin.chen@sunplusct.com>
Acked-by: Mike Frysinger <vapier@gentoo.org> [blackfin]
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> [avr32]
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/avr32/Makefile | 2 | ||||
-rw-r--r-- | arch/blackfin/Makefile | 4 | ||||
-rw-r--r-- | arch/ia64/Makefile | 2 | ||||
-rw-r--r-- | arch/m32r/Makefile | 2 | ||||
-rw-r--r-- | arch/m68k/Makefile | 2 | ||||
-rw-r--r-- | arch/mips/Makefile | 6 | ||||
-rw-r--r-- | arch/powerpc/Makefile | 2 | ||||
-rw-r--r-- | arch/s390/Makefile | 3 | ||||
-rw-r--r-- | arch/score/Makefile | 3 |
9 files changed, 15 insertions, 11 deletions
diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile index ead8a75203a9..22fb66590dcd 100644 --- a/arch/avr32/Makefile +++ b/arch/avr32/Makefile | |||
@@ -13,7 +13,7 @@ KBUILD_DEFCONFIG := atstk1002_defconfig | |||
13 | 13 | ||
14 | KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic | 14 | KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic |
15 | KBUILD_AFLAGS += -mrelax -mno-pic | 15 | KBUILD_AFLAGS += -mrelax -mno-pic |
16 | CFLAGS_MODULE += -mno-relax | 16 | KBUILD_CFLAGS_MODULE += -mno-relax |
17 | LDFLAGS_vmlinux += --relax | 17 | LDFLAGS_vmlinux += --relax |
18 | 18 | ||
19 | cpuflags-$(CONFIG_PLATFORM_AT32AP) += -march=ap | 19 | cpuflags-$(CONFIG_PLATFORM_AT32AP) += -march=ap |
diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile index d4c7177e7656..f7ef923297fc 100644 --- a/arch/blackfin/Makefile +++ b/arch/blackfin/Makefile | |||
@@ -15,8 +15,8 @@ GZFLAGS := -9 | |||
15 | 15 | ||
16 | KBUILD_CFLAGS += $(call cc-option,-mno-fdpic) | 16 | KBUILD_CFLAGS += $(call cc-option,-mno-fdpic) |
17 | KBUILD_AFLAGS += $(call cc-option,-mno-fdpic) | 17 | KBUILD_AFLAGS += $(call cc-option,-mno-fdpic) |
18 | CFLAGS_MODULE += -mlong-calls | 18 | KBUILD_CFLAGS_MODULE += -mlong-calls |
19 | LDFLAGS_MODULE += -m elf32bfin | 19 | KBUILD_LDFLAGS_MODULE += -m elf32bfin |
20 | KALLSYMS += --symbol-prefix=_ | 20 | KALLSYMS += --symbol-prefix=_ |
21 | 21 | ||
22 | KBUILD_DEFCONFIG := BF537-STAMP_defconfig | 22 | KBUILD_DEFCONFIG := BF537-STAMP_defconfig |
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index 475e2725fbde..5ab6af3361a8 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile | |||
@@ -22,7 +22,7 @@ CHECKFLAGS += -m64 -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__ | |||
22 | 22 | ||
23 | OBJCOPYFLAGS := --strip-all | 23 | OBJCOPYFLAGS := --strip-all |
24 | LDFLAGS_vmlinux := -static | 24 | LDFLAGS_vmlinux := -static |
25 | LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds | 25 | KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds |
26 | AFLAGS_KERNEL := -mconstant-gp | 26 | AFLAGS_KERNEL := -mconstant-gp |
27 | EXTRA := | 27 | EXTRA := |
28 | 28 | ||
diff --git a/arch/m32r/Makefile b/arch/m32r/Makefile index 469766b24e22..14a3c2314fef 100644 --- a/arch/m32r/Makefile +++ b/arch/m32r/Makefile | |||
@@ -13,7 +13,7 @@ LDFLAGS_vmlinux := | |||
13 | 13 | ||
14 | KBUILD_CFLAGS += -pipe -fno-schedule-insns | 14 | KBUILD_CFLAGS += -pipe -fno-schedule-insns |
15 | CFLAGS_KERNEL += -mmodel=medium | 15 | CFLAGS_KERNEL += -mmodel=medium |
16 | CFLAGS_MODULE += -mmodel=large | 16 | KBUILD_CFLAGS_MODULE += -mmodel=large |
17 | 17 | ||
18 | ifdef CONFIG_CHIP_VDEC2 | 18 | ifdef CONFIG_CHIP_VDEC2 |
19 | cflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -Wa,-bitinst | 19 | cflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -Wa,-bitinst |
diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile index 570d85c3f97f..b06a7e3cbcd6 100644 --- a/arch/m68k/Makefile +++ b/arch/m68k/Makefile | |||
@@ -18,7 +18,7 @@ KBUILD_DEFCONFIG := multi_defconfig | |||
18 | # override top level makefile | 18 | # override top level makefile |
19 | AS += -m68020 | 19 | AS += -m68020 |
20 | LDFLAGS := -m m68kelf | 20 | LDFLAGS := -m m68kelf |
21 | LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds | 21 | KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds |
22 | ifneq ($(SUBARCH),$(ARCH)) | 22 | ifneq ($(SUBARCH),$(ARCH)) |
23 | ifeq ($(CROSS_COMPILE),) | 23 | ifeq ($(CROSS_COMPILE),) |
24 | CROSS_COMPILE := $(call cc-cross-prefix, \ | 24 | CROSS_COMPILE := $(call cc-cross-prefix, \ |
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 1893efd43fca..a77dcf35c14e 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
@@ -93,7 +93,8 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlinuz | |||
93 | cflags-y += -G 0 -mno-abicalls -fno-pic -pipe | 93 | cflags-y += -G 0 -mno-abicalls -fno-pic -pipe |
94 | cflags-y += -msoft-float | 94 | cflags-y += -msoft-float |
95 | LDFLAGS_vmlinux += -G 0 -static -n -nostdlib | 95 | LDFLAGS_vmlinux += -G 0 -static -n -nostdlib |
96 | MODFLAGS += -mlong-calls | 96 | KBUILD_AFLAGS_MODULE += -mlong-calls |
97 | KBUILD_CFLAGS_MODULE += -mlong-calls | ||
97 | 98 | ||
98 | cflags-y += -ffreestanding | 99 | cflags-y += -ffreestanding |
99 | 100 | ||
@@ -172,7 +173,8 @@ cflags-$(CONFIG_CPU_DADDI_WORKAROUNDS) += $(call cc-option,-mno-daddi,) | |||
172 | 173 | ||
173 | ifdef CONFIG_CPU_SB1 | 174 | ifdef CONFIG_CPU_SB1 |
174 | ifdef CONFIG_SB1_PASS_1_WORKAROUNDS | 175 | ifdef CONFIG_SB1_PASS_1_WORKAROUNDS |
175 | MODFLAGS += -msb1-pass1-workarounds | 176 | KBUILD_AFLAGS_MODULE += -msb1-pass1-workarounds |
177 | KBUILD_CFLAGS_MODULE += -msb1-pass1-workarounds | ||
176 | endif | 178 | endif |
177 | endif | 179 | endif |
178 | 180 | ||
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 42dcd3f4ad7b..b68a83853e1c 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -93,7 +93,7 @@ else | |||
93 | KBUILD_CFLAGS += $(call cc-option,-mtune=power4) | 93 | KBUILD_CFLAGS += $(call cc-option,-mtune=power4) |
94 | endif | 94 | endif |
95 | else | 95 | else |
96 | LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o | 96 | KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o |
97 | endif | 97 | endif |
98 | 98 | ||
99 | ifeq ($(CONFIG_TUNE_CELL),y) | 99 | ifeq ($(CONFIG_TUNE_CELL),y) |
diff --git a/arch/s390/Makefile b/arch/s390/Makefile index fc8fb20e7fc0..83ef8724c833 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile | |||
@@ -22,7 +22,8 @@ STACK_SIZE := 8192 | |||
22 | CHECKFLAGS += -D__s390__ -msize-long | 22 | CHECKFLAGS += -D__s390__ -msize-long |
23 | else | 23 | else |
24 | LDFLAGS := -m elf64_s390 | 24 | LDFLAGS := -m elf64_s390 |
25 | MODFLAGS += -fpic -D__PIC__ | 25 | KBUILD_AFLAGS_MODULE += -fpic -D__PIC__ |
26 | KBUILD_CFLAGS_MODULE += -fpic -D__PIC__ | ||
26 | KBUILD_CFLAGS += -m64 | 27 | KBUILD_CFLAGS += -m64 |
27 | KBUILD_AFLAGS += -m64 | 28 | KBUILD_AFLAGS += -m64 |
28 | UTS_MACHINE := s390x | 29 | UTS_MACHINE := s390x |
diff --git a/arch/score/Makefile b/arch/score/Makefile index 68e0cd06d5c9..d77dc639d8e3 100644 --- a/arch/score/Makefile +++ b/arch/score/Makefile | |||
@@ -20,7 +20,8 @@ cflags-y += -G0 -pipe -mel -mnhwloop -D__SCOREEL__ \ | |||
20 | # | 20 | # |
21 | KBUILD_AFLAGS += $(cflags-y) | 21 | KBUILD_AFLAGS += $(cflags-y) |
22 | KBUILD_CFLAGS += $(cflags-y) | 22 | KBUILD_CFLAGS += $(cflags-y) |
23 | MODFLAGS += -mlong-calls | 23 | KBUILD_AFLAGS_MODULE += -mlong-calls |
24 | KBUILD_CFLAGS_MODULE += -mlong-calls | ||
24 | LDFLAGS += --oformat elf32-littlescore | 25 | LDFLAGS += --oformat elf32-littlescore |
25 | LDFLAGS_vmlinux += -G0 -static -nostdlib | 26 | LDFLAGS_vmlinux += -G0 -static -nostdlib |
26 | 27 | ||