aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2010-07-28 11:33:09 -0400
committerMichal Marek <mmarek@suse.cz>2010-08-03 08:09:45 -0400
commit6588169d516560f68672e2928680b71c647b7806 (patch)
tree91b20bf9197c718ff4b5830bb1aea0b1bc0de272 /arch
parentd6f4ceb796ebf1a8c8a9ad4a8ea0d181aaec7de6 (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/Makefile2
-rw-r--r--arch/blackfin/Makefile4
-rw-r--r--arch/ia64/Makefile2
-rw-r--r--arch/m32r/Makefile2
-rw-r--r--arch/m68k/Makefile2
-rw-r--r--arch/mips/Makefile6
-rw-r--r--arch/powerpc/Makefile2
-rw-r--r--arch/s390/Makefile3
-rw-r--r--arch/score/Makefile3
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
14KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic 14KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic
15KBUILD_AFLAGS += -mrelax -mno-pic 15KBUILD_AFLAGS += -mrelax -mno-pic
16CFLAGS_MODULE += -mno-relax 16KBUILD_CFLAGS_MODULE += -mno-relax
17LDFLAGS_vmlinux += --relax 17LDFLAGS_vmlinux += --relax
18 18
19cpuflags-$(CONFIG_PLATFORM_AT32AP) += -march=ap 19cpuflags-$(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
16KBUILD_CFLAGS += $(call cc-option,-mno-fdpic) 16KBUILD_CFLAGS += $(call cc-option,-mno-fdpic)
17KBUILD_AFLAGS += $(call cc-option,-mno-fdpic) 17KBUILD_AFLAGS += $(call cc-option,-mno-fdpic)
18CFLAGS_MODULE += -mlong-calls 18KBUILD_CFLAGS_MODULE += -mlong-calls
19LDFLAGS_MODULE += -m elf32bfin 19KBUILD_LDFLAGS_MODULE += -m elf32bfin
20KALLSYMS += --symbol-prefix=_ 20KALLSYMS += --symbol-prefix=_
21 21
22KBUILD_DEFCONFIG := BF537-STAMP_defconfig 22KBUILD_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
23OBJCOPYFLAGS := --strip-all 23OBJCOPYFLAGS := --strip-all
24LDFLAGS_vmlinux := -static 24LDFLAGS_vmlinux := -static
25LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds 25KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds
26AFLAGS_KERNEL := -mconstant-gp 26AFLAGS_KERNEL := -mconstant-gp
27EXTRA := 27EXTRA :=
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
14KBUILD_CFLAGS += -pipe -fno-schedule-insns 14KBUILD_CFLAGS += -pipe -fno-schedule-insns
15CFLAGS_KERNEL += -mmodel=medium 15CFLAGS_KERNEL += -mmodel=medium
16CFLAGS_MODULE += -mmodel=large 16KBUILD_CFLAGS_MODULE += -mmodel=large
17 17
18ifdef CONFIG_CHIP_VDEC2 18ifdef CONFIG_CHIP_VDEC2
19cflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -Wa,-bitinst 19cflags-$(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
19AS += -m68020 19AS += -m68020
20LDFLAGS := -m m68kelf 20LDFLAGS := -m m68kelf
21LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds 21KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds
22ifneq ($(SUBARCH),$(ARCH)) 22ifneq ($(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
93cflags-y += -G 0 -mno-abicalls -fno-pic -pipe 93cflags-y += -G 0 -mno-abicalls -fno-pic -pipe
94cflags-y += -msoft-float 94cflags-y += -msoft-float
95LDFLAGS_vmlinux += -G 0 -static -n -nostdlib 95LDFLAGS_vmlinux += -G 0 -static -n -nostdlib
96MODFLAGS += -mlong-calls 96KBUILD_AFLAGS_MODULE += -mlong-calls
97KBUILD_CFLAGS_MODULE += -mlong-calls
97 98
98cflags-y += -ffreestanding 99cflags-y += -ffreestanding
99 100
@@ -172,7 +173,8 @@ cflags-$(CONFIG_CPU_DADDI_WORKAROUNDS) += $(call cc-option,-mno-daddi,)
172 173
173ifdef CONFIG_CPU_SB1 174ifdef CONFIG_CPU_SB1
174ifdef CONFIG_SB1_PASS_1_WORKAROUNDS 175ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
175MODFLAGS += -msb1-pass1-workarounds 176KBUILD_AFLAGS_MODULE += -msb1-pass1-workarounds
177KBUILD_CFLAGS_MODULE += -msb1-pass1-workarounds
176endif 178endif
177endif 179endif
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)
94endif 94endif
95else 95else
96LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o 96KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
97endif 97endif
98 98
99ifeq ($(CONFIG_TUNE_CELL),y) 99ifeq ($(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
22CHECKFLAGS += -D__s390__ -msize-long 22CHECKFLAGS += -D__s390__ -msize-long
23else 23else
24LDFLAGS := -m elf64_s390 24LDFLAGS := -m elf64_s390
25MODFLAGS += -fpic -D__PIC__ 25KBUILD_AFLAGS_MODULE += -fpic -D__PIC__
26KBUILD_CFLAGS_MODULE += -fpic -D__PIC__
26KBUILD_CFLAGS += -m64 27KBUILD_CFLAGS += -m64
27KBUILD_AFLAGS += -m64 28KBUILD_AFLAGS += -m64
28UTS_MACHINE := s390x 29UTS_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#
21KBUILD_AFLAGS += $(cflags-y) 21KBUILD_AFLAGS += $(cflags-y)
22KBUILD_CFLAGS += $(cflags-y) 22KBUILD_CFLAGS += $(cflags-y)
23MODFLAGS += -mlong-calls 23KBUILD_AFLAGS_MODULE += -mlong-calls
24KBUILD_CFLAGS_MODULE += -mlong-calls
24LDFLAGS += --oformat elf32-littlescore 25LDFLAGS += --oformat elf32-littlescore
25LDFLAGS_vmlinux += -G0 -static -nostdlib 26LDFLAGS_vmlinux += -G0 -static -nostdlib
26 27