From 6588169d516560f68672e2928680b71c647b7806 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Wed, 28 Jul 2010 17:33:09 +0200 Subject: 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 Cc: Denys Vlasenko Cc: Haavard Skinnemoen Cc: Mike Frysinger Cc: Tony Luck Cc: Geert Uytterhoeven Cc: Ralf Baechle Cc: Benjamin Herrenschmidt Cc: Martin Schwidefsky Cc: Chen Liqin Acked-by: Mike Frysinger [blackfin] Acked-by: Haavard Skinnemoen [avr32] Signed-off-by: Michal Marek --- arch/avr32/Makefile | 2 +- arch/blackfin/Makefile | 4 ++-- arch/ia64/Makefile | 2 +- arch/m32r/Makefile | 2 +- arch/m68k/Makefile | 2 +- arch/mips/Makefile | 6 ++++-- arch/powerpc/Makefile | 2 +- arch/s390/Makefile | 3 ++- arch/score/Makefile | 3 ++- 9 files changed, 15 insertions(+), 11 deletions(-) (limited to 'arch') diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile index ead8a75203a..22fb66590dc 100644 --- a/arch/avr32/Makefile +++ b/arch/avr32/Makefile @@ -13,7 +13,7 @@ KBUILD_DEFCONFIG := atstk1002_defconfig KBUILD_CFLAGS += -pipe -fno-builtin -mno-pic KBUILD_AFLAGS += -mrelax -mno-pic -CFLAGS_MODULE += -mno-relax +KBUILD_CFLAGS_MODULE += -mno-relax LDFLAGS_vmlinux += --relax cpuflags-$(CONFIG_PLATFORM_AT32AP) += -march=ap diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile index d4c7177e765..f7ef923297f 100644 --- a/arch/blackfin/Makefile +++ b/arch/blackfin/Makefile @@ -15,8 +15,8 @@ GZFLAGS := -9 KBUILD_CFLAGS += $(call cc-option,-mno-fdpic) KBUILD_AFLAGS += $(call cc-option,-mno-fdpic) -CFLAGS_MODULE += -mlong-calls -LDFLAGS_MODULE += -m elf32bfin +KBUILD_CFLAGS_MODULE += -mlong-calls +KBUILD_LDFLAGS_MODULE += -m elf32bfin KALLSYMS += --symbol-prefix=_ KBUILD_DEFCONFIG := BF537-STAMP_defconfig diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index 475e2725fbd..5ab6af3361a 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__ OBJCOPYFLAGS := --strip-all LDFLAGS_vmlinux := -static -LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds +KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds AFLAGS_KERNEL := -mconstant-gp EXTRA := diff --git a/arch/m32r/Makefile b/arch/m32r/Makefile index 469766b24e2..14a3c2314fe 100644 --- a/arch/m32r/Makefile +++ b/arch/m32r/Makefile @@ -13,7 +13,7 @@ LDFLAGS_vmlinux := KBUILD_CFLAGS += -pipe -fno-schedule-insns CFLAGS_KERNEL += -mmodel=medium -CFLAGS_MODULE += -mmodel=large +KBUILD_CFLAGS_MODULE += -mmodel=large ifdef CONFIG_CHIP_VDEC2 cflags-$(CONFIG_ISA_M32R2) += -DNO_FPU -Wa,-bitinst diff --git a/arch/m68k/Makefile b/arch/m68k/Makefile index 570d85c3f97..b06a7e3cbcd 100644 --- a/arch/m68k/Makefile +++ b/arch/m68k/Makefile @@ -18,7 +18,7 @@ KBUILD_DEFCONFIG := multi_defconfig # override top level makefile AS += -m68020 LDFLAGS := -m m68kelf -LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds +KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/m68k/kernel/module.lds ifneq ($(SUBARCH),$(ARCH)) ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := $(call cc-cross-prefix, \ diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 1893efd43fc..a77dcf35c14 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -93,7 +93,8 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlinuz cflags-y += -G 0 -mno-abicalls -fno-pic -pipe cflags-y += -msoft-float LDFLAGS_vmlinux += -G 0 -static -n -nostdlib -MODFLAGS += -mlong-calls +KBUILD_AFLAGS_MODULE += -mlong-calls +KBUILD_CFLAGS_MODULE += -mlong-calls cflags-y += -ffreestanding @@ -172,7 +173,8 @@ cflags-$(CONFIG_CPU_DADDI_WORKAROUNDS) += $(call cc-option,-mno-daddi,) ifdef CONFIG_CPU_SB1 ifdef CONFIG_SB1_PASS_1_WORKAROUNDS -MODFLAGS += -msb1-pass1-workarounds +KBUILD_AFLAGS_MODULE += -msb1-pass1-workarounds +KBUILD_CFLAGS_MODULE += -msb1-pass1-workarounds endif endif diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 42dcd3f4ad7..b68a83853e1 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -93,7 +93,7 @@ else KBUILD_CFLAGS += $(call cc-option,-mtune=power4) endif else -LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o +KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o endif ifeq ($(CONFIG_TUNE_CELL),y) diff --git a/arch/s390/Makefile b/arch/s390/Makefile index fc8fb20e7fc..83ef8724c83 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -22,7 +22,8 @@ STACK_SIZE := 8192 CHECKFLAGS += -D__s390__ -msize-long else LDFLAGS := -m elf64_s390 -MODFLAGS += -fpic -D__PIC__ +KBUILD_AFLAGS_MODULE += -fpic -D__PIC__ +KBUILD_CFLAGS_MODULE += -fpic -D__PIC__ KBUILD_CFLAGS += -m64 KBUILD_AFLAGS += -m64 UTS_MACHINE := s390x diff --git a/arch/score/Makefile b/arch/score/Makefile index 68e0cd06d5c..d77dc639d8e 100644 --- a/arch/score/Makefile +++ b/arch/score/Makefile @@ -20,7 +20,8 @@ cflags-y += -G0 -pipe -mel -mnhwloop -D__SCOREEL__ \ # KBUILD_AFLAGS += $(cflags-y) KBUILD_CFLAGS += $(cflags-y) -MODFLAGS += -mlong-calls +KBUILD_AFLAGS_MODULE += -mlong-calls +KBUILD_CFLAGS_MODULE += -mlong-calls LDFLAGS += --oformat elf32-littlescore LDFLAGS_vmlinux += -G0 -static -nostdlib -- cgit v1.2.3