]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
kbuild: enable 'make AFLAGS=...' to add additional options to AS
authorSam Ravnborg <sam@neptun.(none)>
Mon, 15 Oct 2007 19:59:31 +0000 (21:59 +0200)
committerSam Ravnborg <sam@neptun.(none)>
Mon, 15 Oct 2007 19:59:31 +0000 (21:59 +0200)
The variable AFLAGS 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 AFLAGS with KBUILD_AFLAGS all over
the tree.

Patch was tested on following architectures:
alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k, s390

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
28 files changed:
Documentation/kbuild/makefiles.txt
Makefile
arch/arm/Makefile
arch/arm/vfp/Makefile
arch/avr32/Makefile
arch/blackfin/Makefile
arch/cris/Makefile
arch/frv/Makefile
arch/h8300/Makefile
arch/i386/Makefile
arch/m32r/Makefile
arch/m68knommu/Makefile
arch/mips/Makefile
arch/powerpc/Makefile
arch/ppc/Makefile
arch/s390/Makefile
arch/sh/Makefile
arch/sparc/Makefile
arch/sparc64/Makefile
arch/um/Makefile
arch/um/Makefile-i386
arch/um/Makefile-x86_64
arch/um/sys-ppc/Makefile
arch/x86/boot/Makefile
arch/x86/boot/compressed/Makefile_64
arch/x86_64/Makefile
scripts/Kbuild.include
scripts/Makefile.lib

index 1ca535bcc8c7d3adeae372d74bdea0fc801a9198..f4779cd1542fd5ffadcfb6a5075695d4bcc7b44f 100644 (file)
@@ -424,6 +424,7 @@ more details, with real examples.
        as-instr checks if the assembler reports a specific instruction
        and then outputs either option1 or option2
        C escapes are supported in the test instruction
+       Note: as-instr-option uses KBUILD_AFLAGS for $(AS) options
 
     cc-option
        cc-option is used to check if $(CC) supports a given option, and not
@@ -819,14 +820,14 @@ When kbuild executes, the following steps are followed (roughly):
        In this example, the binary $(obj)/image is a binary version of
        vmlinux. The usage of $(call if_changed,xxx) will be described later.
 
-    AFLAGS             $(AS) assembler flags
+    KBUILD_AFLAGS              $(AS) assembler flags
 
        Default value - see top level Makefile
        Append or modify as required per architecture.
 
        Example:
                #arch/sparc64/Makefile
-               AFLAGS += -m64 -mcpu=ultrasparc
+               KBUILD_AFLAGS += -m64 -mcpu=ultrasparc
 
     KBUILD_CFLAGS              $(CC) compiler flags
 
index 3bc86c698a4e631953036e53c15b0ad0193b67ba..8d3f66441861c807d836c576f3d55804baf1fdde 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -323,7 +323,7 @@ CPPFLAGS        := -D__KERNEL__ $(LINUXINCLUDE)
 KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
                   -fno-strict-aliasing -fno-common \
                   -Werror-implicit-function-declaration
-AFLAGS          := -D__ASSEMBLY__
+KBUILD_AFLAGS   := -D__ASSEMBLY__
 
 # Read KERNELRELEASE from include/config/kernel.release (if it exists)
 KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
@@ -336,7 +336,7 @@ export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
 
 export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
 export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
-export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
+export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
 
 # When compiling out-of-tree modules, put MODVERDIR in the module
 # tree rather than in the kernel tree. The kernel tree might
@@ -507,7 +507,7 @@ endif
 
 ifdef CONFIG_DEBUG_INFO
 KBUILD_CFLAGS  += -g
-AFLAGS         += -gdwarf-2
+KBUILD_AFLAGS  += -gdwarf-2
 endif
 
 # Force gcc to behave correct even for buggy distributions
@@ -1502,7 +1502,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN   $(wildcard $(rm-files))
       cmd_rmfiles = rm -f $(rm-files)
 
 
-a_flags = -Wp,-MD,$(depfile) $(AFLAGS) $(AFLAGS_KERNEL) \
+a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
          $(NOSTDINC_FLAGS) $(CPPFLAGS) \
          $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
 
index 0b82865ab5060aa735fde89db1013f02eb95213b..b762d235b81a9846e36f087958d46585c9f0d869 100644 (file)
@@ -86,7 +86,7 @@ endif
 
 # Need -Uarm for gcc < 3.x
 KBUILD_CFLAGS  +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
-AFLAGS         +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float
+KBUILD_AFLAGS  +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float
 
 CHECKFLAGS     += -D__arm__
 
index 7e136e77971a15362bb9f3c35a98d5a3ec8865dd..39f6d8e1af73043890adcf8761b226b5f2e82d4d 100644 (file)
@@ -7,7 +7,7 @@
 # EXTRA_CFLAGS := -DDEBUG
 # EXTRA_AFLAGS := -DDEBUG
 
-AFLAGS         :=$(AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp)
+KBUILD_AFLAGS  :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp)
 LDFLAGS                +=--no-warn-mismatch
 
 obj-y                  += vfp.o
index 9883c8b55e1be62e768e543091531fe9b153ea54..87918647be6d6ed97dba60963f7995c134012d47 100644 (file)
@@ -12,14 +12,14 @@ all: uImage vmlinux.elf
 KBUILD_DEFCONFIG       := atstk1002_defconfig
 
 KBUILD_CFLAGS  += -pipe -fno-builtin -mno-pic
-AFLAGS         += -mrelax -mno-pic
+KBUILD_AFLAGS  += -mrelax -mno-pic
 CFLAGS_MODULE  += -mno-relax
 LDFLAGS_vmlinux        += --relax
 
 cpuflags-$(CONFIG_CPU_AT32AP7000)      += -mcpu=ap7000
 
 KBUILD_CFLAGS  += $(cpuflags-y)
-AFLAGS         += $(cpuflags-y)
+KBUILD_AFLAGS  += $(cpuflags-y)
 
 CHECKFLAGS     += -D__avr32__ -D__BIG_ENDIAN
 
index 52a6ac0728513e4f15b187512e7af956021232f6..368933760d28bba2e43f591d299c1befd4630dd0 100644 (file)
@@ -54,7 +54,7 @@ rev-$(CONFIG_BF_REV_NONE) := none
 rev-$(CONFIG_BF_REV_ANY)  := any
 
 KBUILD_CFLAGS += -mcpu=$(cpu-y)-$(rev-y)
-AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
+KBUILD_AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
 
 head-y   := arch/$(ARCH)/mach-$(MACHINE)/head.o arch/$(ARCH)/kernel/init_task.o
 
index 32ef6f3cce06cf6d2e0f9b1cb073ec0c834e9544..e6bf00c262e06fa5f1ec94d2420c38df8a76d7d6 100644 (file)
@@ -29,7 +29,7 @@ LD = $(CROSS_COMPILE)ld -mcrislinux
 OBJCOPYFLAGS := -O binary -R .note -R .comment -S
 
 CPPFLAGS_vmlinux.lds = -DDRAM_VIRTUAL_BASE=0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)
-AFLAGS += -mlinux
+KBUILD_AFLAGS += -mlinux
 
 KBUILD_CFLAGS += -mlinux -march=$(arch-y) -pipe
 
index ec89886ed4554b692dbb3b1154045df90212caaa..310c47a663f8ffc4d9f038494e49fcc44505cbc8 100644 (file)
@@ -63,16 +63,16 @@ endif
 
 ifdef CONFIG_CPU_FR451_COMPILE
 KBUILD_CFLAGS  += -mcpu=fr450
-AFLAGS         += -mcpu=fr450
+KBUILD_AFLAGS  += -mcpu=fr450
 ASFLAGS                += -mcpu=fr450
 else
 ifdef CONFIG_CPU_FR551_COMPILE
 KBUILD_CFLAGS  += -mcpu=fr550
-AFLAGS         += -mcpu=fr550
+KBUILD_AFLAGS  += -mcpu=fr550
 ASFLAGS                += -mcpu=fr550
 else
 KBUILD_CFLAGS  += -mcpu=fr400
-AFLAGS         += -mcpu=fr400
+KBUILD_AFLAGS  += -mcpu=fr400
 ASFLAGS                += -mcpu=fr400
 endif
 endif
@@ -82,14 +82,14 @@ endif
 # - all the extra registers are dealt with only at context switch time
 KBUILD_CFLAGS  += -mno-fdpic -mgpr-32 -msoft-float -mno-media
 KBUILD_CFLAGS  += -ffixed-fcc3 -ffixed-cc3 -ffixed-gr15 -ffixed-icc2
-AFLAGS         += -mno-fdpic
+KBUILD_AFLAGS  += -mno-fdpic
 ASFLAGS                += -mno-fdpic
 
 # make sure the .S files get compiled with debug info
 # and disable optimisations that are unhelpful whilst debugging
 ifdef CONFIG_DEBUG_INFO
 #KBUILD_CFLAGS += -O1
-AFLAGS         += -Wa,--gdwarf2
+KBUILD_AFLAGS  += -Wa,--gdwarf2
 ASFLAGS                += -Wa,--gdwarf2
 endif
 
index 330e05f28f909cc5fb3bdfd346456cf52a65ab9a..a556447877b4c8b627b1c24a9f5122fbf8ac4dea 100644 (file)
@@ -35,7 +35,7 @@ KBUILD_CFLAGS += -mint32 -fno-builtin
 KBUILD_CFLAGS += -g
 KBUILD_CFLAGS += -D__linux__
 KBUILD_CFLAGS += -DUTS_SYSNAME=\"uClinux\"
-AFLAGS += -DPLATFORM=$(PLATFORM) -DMODEL=$(MODEL) $(cflags-y)
+KBUILD_AFLAGS += -DPLATFORM=$(PLATFORM) -DMODEL=$(MODEL) $(cflags-y)
 LDFLAGS += $(ldflags-y)
 
 CROSS_COMPILE = h8300-elf-
index fc3c8e88b7448872ee02092a0e708dd5eeaa6dba..f036d2dee3def4508411ebb9401e06e433039303 100644 (file)
@@ -55,11 +55,11 @@ KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then echo $(call c
 
 # do binutils support CFI?
 cflags-y += $(call as-instr,.cfi_startproc\n.cfi_rel_offset esp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
-AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_rel_offset esp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
+KBUILD_AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_rel_offset esp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
 
 # is .cfi_signal_frame supported too?
 cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
-AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
+KBUILD_AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
 
 KBUILD_CFLAGS += $(cflags-y)
 
@@ -117,7 +117,7 @@ drivers-$(CONFIG_PM)                        += arch/x86/power/
 drivers-$(CONFIG_FB)                    += arch/x86/video/
 
 KBUILD_CFLAGS += $(mflags-y)
-AFLAGS += $(mflags-y)
+KBUILD_AFLAGS += $(mflags-y)
 
 boot := arch/x86/boot
 
index c80618ab60ea82bb480441a30ab0d570dd561580..4072a07ebf8e301af8fa34fa788e5c5ece63eccb 100644 (file)
@@ -25,7 +25,7 @@ cflags-$(CONFIG_ISA_M32R)     += -DNO_FPU
 aflags-$(CONFIG_ISA_M32R)      += -DNO_FPU -O2 -Wa,-no-bitinst
 
 KBUILD_CFLAGS += $(cflags-y)
-AFLAGS += $(aflags-y)
+KBUILD_AFLAGS += $(aflags-y)
 
 CHECKFLAGS     += -D__m32r__ -D__BIG_ENDIAN__=1
 
index 1c1fbb69ff2648ac823b52575ca0f407393516a7..92227aaaa26e7e9f1bcb76cb02b1f74b2d2d2131 100644 (file)
@@ -102,7 +102,7 @@ cflags-$(CONFIG_M68EZ328)   := -m68000
 cflags-$(CONFIG_M68VZ328)      := -m68000
 cflags-$(CONFIG_M68360)                := -m68332
 
-AFLAGS += $(cflags-y)
+KBUILD_AFLAGS += $(cflags-y)
 
 KBUILD_CFLAGS += $(cflags-y)
 KBUILD_CFLAGS += -D__linux__
index 64512abef61df4e410adc24e0a63e377153ab444..6b663bec4752af5c8102c97fc2b8316e17bb9f02 100644 (file)
@@ -608,7 +608,7 @@ ifdef CONFIG_64BIT
   endif
 endif
 
-AFLAGS         += $(cflags-y)
+KBUILD_AFLAGS  += $(cflags-y)
 KBUILD_CFLAGS  += $(cflags-y) \
                        -D"VMLINUX_LOAD_ADDRESS=$(load-y)"
 
index 51309848c11d62b2753c4cf3b288fb5939cf6df3..462bb89b67e8ccf920c4ea90202a002df9094369 100644 (file)
@@ -76,7 +76,7 @@ AFLAGS-$(CONFIG_PPC32)        := -Iarch/$(ARCH)
 CFLAGS-$(CONFIG_PPC64) := -mminimal-toc -mtraceback=none  -mcall-aixdesc
 CFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) -ffixed-r2 -mmultiple
 CPPFLAGS       += $(CPPFLAGS-y)
-AFLAGS         += $(AFLAGS-y)
+KBUILD_AFLAGS  += $(AFLAGS-y)
 KBUILD_CFLAGS  += -msoft-float -pipe $(CFLAGS-y)
 CPP            = $(CC) -E $(KBUILD_CFLAGS)
 
@@ -125,7 +125,7 @@ cpu-as-$(CONFIG_POWER4)             += -Wa,-maltivec
 cpu-as-$(CONFIG_E500)          += -Wa,-me500
 cpu-as-$(CONFIG_E200)          += -Wa,-me200
 
-AFLAGS += $(cpu-as-y)
+KBUILD_AFLAGS += $(cpu-as-y)
 KBUILD_CFLAGS += $(cpu-as-y)
 
 head-y                         := arch/powerpc/kernel/head_$(CONFIG_WORD_SIZE).o
index 43802e95c892d9e8e680d395f065279c8aebace9..dd63ccb6673218e12f8406ffbe91c6a9bee3fa9e 100644 (file)
@@ -23,7 +23,7 @@ endif
 LDFLAGS_vmlinux        := -Ttext $(KERNELLOAD) -Bstatic
 # The -Iarch/$(ARCH)/include is temporary while we are merging
 CPPFLAGS       += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
-AFLAGS         += -Iarch/$(ARCH)
+KBUILD_AFLAGS  += -Iarch/$(ARCH)
 KBUILD_CFLAGS  += -Iarch/$(ARCH) -msoft-float -pipe \
                -ffixed-r2 -mmultiple
 
@@ -45,7 +45,7 @@ cpu-as-$(CONFIG_6xx)          += -Wa,-maltivec
 cpu-as-$(CONFIG_E500)          += -Wa,-me500
 cpu-as-$(CONFIG_E200)          += -Wa,-me200
 
-AFLAGS += $(cpu-as-y)
+KBUILD_AFLAGS += $(cpu-as-y)
 KBUILD_CFLAGS += $(cpu-as-y)
 
 # Default to the common case.
index 62a0da42c7fdee6b9198a277421ae9d0f61016d7..f708be367b030b672ffe58684e20fbcebc90c77a 100644 (file)
@@ -16,7 +16,7 @@
 ifndef CONFIG_64BIT
 LDFLAGS                := -m elf_s390
 KBUILD_CFLAGS  += -m31
-AFLAGS         += -m31
+KBUILD_AFLAGS  += -m31
 UTS_MACHINE    := s390
 STACK_SIZE     := 8192
 CHECKFLAGS     += -D__s390__ -msize-long
@@ -24,7 +24,7 @@ else
 LDFLAGS                := -m elf64_s390
 MODFLAGS       += -fpic -D__PIC__
 KBUILD_CFLAGS  += -m64
-AFLAGS         += -m64
+KBUILD_AFLAGS  += -m64
 UTS_MACHINE    := s390x
 STACK_SIZE     := 16384
 CHECKFLAGS     += -D__s390__ -D__s390x__
@@ -79,7 +79,7 @@ endif
 
 KBUILD_CFLAGS  += -mbackchain -msoft-float $(cflags-y)
 KBUILD_CFLAGS  += -pipe -fno-strength-reduce -Wno-sign-compare
-AFLAGS         += $(aflags-y)
+KBUILD_AFLAGS  += $(aflags-y)
 
 OBJCOPYFLAGS   := -O binary
 LDFLAGS_vmlinux := -e start
index cd8a411acc95b302c4c41f714cccad7e01577cb0..0353296c2c93f9feb94184c18098a4094bca98aa 100644 (file)
@@ -92,7 +92,7 @@ LDFLAGS                       += -EB
 endif
 
 KBUILD_CFLAGS          += -pipe $(cflags-y)
-AFLAGS         += $(cflags-y)
+KBUILD_AFLAGS          += $(cflags-y)
 
 head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o
 
index 2ce781a7cbf075e98a8830a6725d156001dc8c8e..fef28e267a52fc1e2943d85c7bf3daea8603170e 100644 (file)
@@ -17,7 +17,7 @@ CHECKFLAGS    += -D__sparc__
 
 #KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7
 KBUILD_CFLAGS += -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
-AFLAGS := $(AFLAGS) -m32
+KBUILD_AFLAGS += -m32
 
 #LDFLAGS_vmlinux = -N -Ttext 0xf0004000
 #  Since 2.5.40, the first stage is left not btfix-ed.
index b083dc458ce922000d5b5195f36edf55d3c3b1de..6c92a42efe76430ca9f2efa82398a16f2973f4ab 100644 (file)
@@ -45,7 +45,7 @@ else
   KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
            -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
            $(CC_UNDECL)
-  AFLAGS += -m64 -mcpu=ultrasparc $(CC_UNDECL)
+  KBUILD_AFLAGS += -m64 -mcpu=ultrasparc $(CC_UNDECL)
 endif
 
 ifeq ($(CONFIG_MCOUNT),y)
index 18123bf7b6496d96863a745d085ca087d4d75117..d08d3bc518e32bbe7df4c75e88f468dfb429d625 100644 (file)
@@ -62,7 +62,7 @@ KBUILD_CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\"   \
        $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap      \
        -Din6addr_loopback=kernel_in6addr_loopback
 
-AFLAGS += $(ARCH_INCLUDE)
+KBUILD_AFLAGS += $(ARCH_INCLUDE)
 
 USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
        $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
index 26bc786fc61445c4709360b104ef5d004379bf66..d10e4dc0dae85698cea8fc6f88fbbe29be802e0c 100644 (file)
@@ -16,7 +16,7 @@ OBJCOPYFLAGS                  := -O binary -R .note -R .comment -S
 ifeq ("$(origin SUBARCH)", "command line")
 ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)")
 KBUILD_CFLAGS          += $(call cc-option,-m32)
-AFLAGS                 += $(call cc-option,-m32)
+KBUILD_AFLAGS          += $(call cc-option,-m32)
 LINK-y                 += $(call cc-option,-m32)
 UML_OBJCOPYFLAGS       += -F $(ELF_FORMAT)
 
index 36d2bb5e41926a6a90ebe6e7dc89c809158f89f4..8836f0df36aa703d07ac3c8f96632114d9a7495b 100644 (file)
@@ -12,7 +12,7 @@ ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__
 KBUILD_CFLAGS += $(_extra_flags_)
 
 CHECKFLAGS  += -m64
-AFLAGS += -m64
+KBUILD_AFLAGS += -m64
 LDFLAGS += -m elf_x86_64
 CPPFLAGS += -m64
 
index af200268fddb812d39e4902e5f4c70a0a6b375c7..a9814a7ae60efb1a6690a00b97f0ad01e7850697 100644 (file)
@@ -1,7 +1,7 @@
 OBJ = built-in.o
 
 .S.o:
-       $(CC) $(AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
+       $(CC) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
 
 OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \
        ptrace_user.o sysrq.o
@@ -57,13 +57,13 @@ ppc_defs.h: mk_defs.c ppc_defs.head \
 checksum.o: checksum.S
        rm -f asm
        ln -s $(TOPDIR)/include/asm-ppc asm
-       $(CC) $(EXTRA_AFLAGS) $(AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
+       $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
        rm -f asm
 
 misc.o: misc.S ppc_defs.h
        rm -f asm
        ln -s $(TOPDIR)/include/asm-ppc asm
-       $(CC) $(EXTRA_AFLAGS) $(AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
+       $(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
        rm -f asm
 
 clean-files := $(OBJS) ppc_defs.h checksum.S semaphore.c mk_defs.c
index 646292aaf1fcebd920f9b58933fea68f158f6dbf..d6ed8e5e1ccc2bab83f49df77091043c47021645 100644 (file)
@@ -61,7 +61,7 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
                        $(call cc-option, -fno-unit-at-a-time)) \
                   $(call cc-option, -fno-stack-protector) \
                   $(call cc-option, -mpreferred-stack-boundary=2)
-AFLAGS         := $(KBUILD_CFLAGS) -D__ASSEMBLY__
+KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
 
 $(obj)/zImage:  IMAGE_OFFSET := 0x1000
 $(obj)/zImage:  EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK)
index 3013ad01fe69dfa025811c797296d8de82962a9a..7801e8dd90b2f42258bc60ba73519a5ddb1defe4 100644 (file)
@@ -10,7 +10,7 @@ KBUILD_CFLAGS := -m64 -D__KERNEL__ $(LINUXINCLUDE) -O2  \
          -fno-strict-aliasing -fPIC -mcmodel=small \
           $(call cc-option, -ffreestanding) \
           $(call cc-option, -fno-stack-protector)
-AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
+KBUILD_AFLAGS  := $(KBUILD_CFLAGS) -D__ASSEMBLY__
 LDFLAGS := -m elf_x86_64
 
 LDFLAGS_vmlinux := -T
index 3fc33004e8c6ebc240f73e5b1cbc9187819a9f08..9daa32d1d2a1d3d6b5844a904855616375bb6ce1 100644 (file)
@@ -61,18 +61,18 @@ cflags-y += -maccumulate-outgoing-args
 
 # do binutils support CFI?
 cflags-y += $(call as-instr,.cfi_startproc\n.cfi_rel_offset rsp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
-AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_rel_offset rsp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
+KBUILD_AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_rel_offset rsp${comma}0\n.cfi_endproc,-DCONFIG_AS_CFI=1,)
 
 # is .cfi_signal_frame supported too?
 cflags-y += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
-AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
+KBUILD_AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1,)
 
 cflags-$(CONFIG_CC_STACKPROTECTOR) += $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-x86_64-has-stack-protector.sh "$(CC)" -fstack-protector )
 cflags-$(CONFIG_CC_STACKPROTECTOR_ALL) += $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-x86_64-has-stack-protector.sh "$(CC)" -fstack-protector-all )
 
 KBUILD_CFLAGS += $(cflags-y)
 CFLAGS_KERNEL += $(cflags-kernel-y)
-AFLAGS += -m64
+KBUILD_AFLAGS += -m64
 
 head-y := arch/x86/kernel/head_64.o arch/x86/kernel/head64.o arch/x86/kernel/init_task_64.o
 
index b1a7c7d42e15facc076559913a7c9ce00de37ef9..de7bb284c6116d8ea3997ae224a25e3081aaf619 100644 (file)
@@ -81,7 +81,7 @@ as-option = $(call try-run,\
 # Usage: cflags-y += $(call as-instr,instr,option1,option2)
 
 as-instr = $(call try-run,\
-       echo -e "$(1)" | $(CC) $(AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))
+       echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))
 
 # cc-option
 # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
index 51ae412929a0ae3c39199514a4a71668fe4fa1d7..2837adaa9850bc246afc7909296d8421293786fc 100644 (file)
@@ -85,7 +85,7 @@ modname_flags  = $(if $(filter 1,$(words $(modname))),\
                  -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
 
 _c_flags       = $(KBUILD_CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o)
-_a_flags       = $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
+_a_flags       = $(KBUILD_AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
 _cpp_flags     = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F))
 
 # If building the kernel in a separate objtree expand all occurrences