From a0f97e06a43cf524e616f09e6af3398e1e9c1c5b Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 14 Oct 2007 22:21:35 +0200 Subject: 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 --- arch/um/Makefile | 10 +++++----- arch/um/Makefile-i386 | 4 ++-- arch/um/Makefile-os-Linux | 2 +- arch/um/Makefile-x86_64 | 2 +- arch/um/drivers/Makefile | 2 +- arch/um/sys-i386/Makefile | 2 +- arch/um/sys-x86_64/Makefile | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) (limited to 'arch/um') diff --git a/arch/um/Makefile b/arch/um/Makefile index 989224f21346..18123bf7b649 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -58,14 +58,14 @@ SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) # # These apply to USER_CFLAGS to. -CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ +KBUILD_CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ -Din6addr_loopback=kernel_in6addr_loopback AFLAGS += $(ARCH_INCLUDE) USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ - $(patsubst -I%,,$(CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ + $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ -D_FILE_OFFSET_BITS=64 include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) @@ -75,14 +75,14 @@ include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) # -Derrno=kernel_errno - This turns all kernel references to errno into # kernel_errno to separate them from the libc errno. This allows -fno-common -# in CFLAGS. Otherwise, it would cause ld to complain about the two different +# in KBUILD_CFLAGS. Otherwise, it would cause ld to complain about the two different # errnos. # These apply to kernelspace only. KERNEL_DEFINES = -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES) -CFLAGS += $(KERNEL_DEFINES) -CFLAGS += $(call cc-option,-fno-unit-at-a-time,) +KBUILD_CFLAGS += $(KERNEL_DEFINES) +KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time,) # These are needed for clean and mrproper, since in that case .config is not # included; the values here are meaningless diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386 index c9f1c5b24c9a..26bc786fc614 100644 --- a/arch/um/Makefile-i386 +++ b/arch/um/Makefile-i386 @@ -15,7 +15,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)") -CFLAGS += $(call cc-option,-m32) +KBUILD_CFLAGS += $(call cc-option,-m32) AFLAGS += $(call cc-option,-m32) LINK-y += $(call cc-option,-m32) UML_OBJCOPYFLAGS += -F $(ELF_FORMAT) @@ -36,4 +36,4 @@ cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) # an unresolved reference. cflags-y += -ffreestanding -CFLAGS += $(cflags-y) +KBUILD_CFLAGS += $(cflags-y) diff --git a/arch/um/Makefile-os-Linux b/arch/um/Makefile-os-Linux index 0c0f9a1cbbad..52859487c95d 100644 --- a/arch/um/Makefile-os-Linux +++ b/arch/um/Makefile-os-Linux @@ -5,4 +5,4 @@ # To get a definition of F_SETSIG USER_CFLAGS += -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -CFLAGS += -D_LARGEFILE64_SOURCE +KBUILD_CFLAGS += -D_LARGEFILE64_SOURCE diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64 index 69ecea63fdae..36d2bb5e4192 100644 --- a/arch/um/Makefile-x86_64 +++ b/arch/um/Makefile-x86_64 @@ -9,7 +9,7 @@ _extra_flags_ = -fno-builtin -m64 #We #undef __x86_64__ for kernelspace, not for userspace where #it's needed for headers to work! ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__ -CFLAGS += $(_extra_flags_) +KBUILD_CFLAGS += $(_extra_flags_) CHECKFLAGS += -m64 AFLAGS += -m64 diff --git a/arch/um/drivers/Makefile b/arch/um/drivers/Makefile index de17d4c6e02d..0f780dd0d4c4 100644 --- a/arch/um/drivers/Makefile +++ b/arch/um/drivers/Makefile @@ -17,7 +17,7 @@ ubd-objs := ubd_kern.o ubd_user.o port-objs := port_kern.o port_user.o harddog-objs := harddog_kern.o harddog_user.o -LDFLAGS_pcap.o := -r $(shell $(CC) $(CFLAGS) -print-file-name=libpcap.a) +LDFLAGS_pcap.o := -r $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libpcap.a) targets := pcap_kern.o pcap_user.o diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile index d6b3ecd4b77e..8909b07d9ee7 100644 --- a/arch/um/sys-i386/Makefile +++ b/arch/um/sys-i386/Makefile @@ -20,4 +20,4 @@ CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING) include arch/um/scripts/Makefile.rules -$(obj)/unmap.%: _c_flags = $(call unprofile,$(CFLAGS)) +$(obj)/unmap.%: _c_flags = $(call unprofile,$(KBUILD_CFLAGS)) diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile index 4d9e5efa6fb9..e446a9916fd7 100644 --- a/arch/um/sys-x86_64/Makefile +++ b/arch/um/sys-x86_64/Makefile @@ -28,4 +28,4 @@ CFLAGS_stub_segv.o := $(CFLAGS_NO_HARDENING) include arch/um/scripts/Makefile.rules -$(obj)/unmap.%: _c_flags = $(call unprofile,$(CFLAGS)) +$(obj)/unmap.%: _c_flags = $(call unprofile,$(KBUILD_CFLAGS)) -- cgit v1.2.3-59-g8ed1b From 222d394d30e74bb7a2a65029fcea68107b0d0eb6 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Mon, 15 Oct 2007 21:59:31 +0200 Subject: kbuild: enable 'make AFLAGS=...' to add additional options to AS 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 --- Documentation/kbuild/makefiles.txt | 5 +++-- Makefile | 8 ++++---- arch/arm/Makefile | 2 +- arch/arm/vfp/Makefile | 2 +- arch/avr32/Makefile | 4 ++-- arch/blackfin/Makefile | 2 +- arch/cris/Makefile | 2 +- arch/frv/Makefile | 10 +++++----- arch/h8300/Makefile | 2 +- arch/i386/Makefile | 6 +++--- arch/m32r/Makefile | 2 +- arch/m68knommu/Makefile | 2 +- arch/mips/Makefile | 2 +- arch/powerpc/Makefile | 4 ++-- arch/ppc/Makefile | 4 ++-- arch/s390/Makefile | 6 +++--- arch/sh/Makefile | 2 +- arch/sparc/Makefile | 2 +- arch/sparc64/Makefile | 2 +- arch/um/Makefile | 2 +- arch/um/Makefile-i386 | 2 +- arch/um/Makefile-x86_64 | 2 +- arch/um/sys-ppc/Makefile | 6 +++--- arch/x86/boot/Makefile | 2 +- arch/x86/boot/compressed/Makefile_64 | 2 +- arch/x86_64/Makefile | 6 +++--- scripts/Kbuild.include | 2 +- scripts/Makefile.lib | 2 +- 28 files changed, 48 insertions(+), 47 deletions(-) (limited to 'arch/um') diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 1ca535bcc8c7..f4779cd1542f 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -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 diff --git a/Makefile b/Makefile index 3bc86c698a4e..8d3f66441861 100644 --- 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) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 0b82865ab506..b762d235b81a 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -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__ diff --git a/arch/arm/vfp/Makefile b/arch/arm/vfp/Makefile index 7e136e77971a..39f6d8e1af73 100644 --- a/arch/arm/vfp/Makefile +++ b/arch/arm/vfp/Makefile @@ -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 diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile index 9883c8b55e1b..87918647be6d 100644 --- a/arch/avr32/Makefile +++ b/arch/avr32/Makefile @@ -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 diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile index 52a6ac072851..368933760d28 100644 --- a/arch/blackfin/Makefile +++ b/arch/blackfin/Makefile @@ -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 diff --git a/arch/cris/Makefile b/arch/cris/Makefile index 32ef6f3cce06..e6bf00c262e0 100644 --- a/arch/cris/Makefile +++ b/arch/cris/Makefile @@ -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 diff --git a/arch/frv/Makefile b/arch/frv/Makefile index ec89886ed455..310c47a663f8 100644 --- a/arch/frv/Makefile +++ b/arch/frv/Makefile @@ -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 diff --git a/arch/h8300/Makefile b/arch/h8300/Makefile index 330e05f28f90..a556447877b4 100644 --- a/arch/h8300/Makefile +++ b/arch/h8300/Makefile @@ -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- diff --git a/arch/i386/Makefile b/arch/i386/Makefile index fc3c8e88b744..f036d2dee3de 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile @@ -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 diff --git a/arch/m32r/Makefile b/arch/m32r/Makefile index c80618ab60ea..4072a07ebf8e 100644 --- a/arch/m32r/Makefile +++ b/arch/m32r/Makefile @@ -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 diff --git a/arch/m68knommu/Makefile b/arch/m68knommu/Makefile index 1c1fbb69ff26..92227aaaa26e 100644 --- a/arch/m68knommu/Makefile +++ b/arch/m68knommu/Makefile @@ -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__ diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 64512abef61d..6b663bec4752 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -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)" diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 51309848c11d..462bb89b67e8 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -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 diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile index 43802e95c892..dd63ccb66732 100644 --- a/arch/ppc/Makefile +++ b/arch/ppc/Makefile @@ -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. diff --git a/arch/s390/Makefile b/arch/s390/Makefile index 62a0da42c7fd..f708be367b03 100644 --- a/arch/s390/Makefile +++ b/arch/s390/Makefile @@ -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 diff --git a/arch/sh/Makefile b/arch/sh/Makefile index cd8a411acc95..0353296c2c93 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile @@ -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 diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile index 2ce781a7cbf0..fef28e267a52 100644 --- a/arch/sparc/Makefile +++ b/arch/sparc/Makefile @@ -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. diff --git a/arch/sparc64/Makefile b/arch/sparc64/Makefile index b083dc458ce9..6c92a42efe76 100644 --- a/arch/sparc64/Makefile +++ b/arch/sparc64/Makefile @@ -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) diff --git a/arch/um/Makefile b/arch/um/Makefile index 18123bf7b649..d08d3bc518e3 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -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) \ diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386 index 26bc786fc614..d10e4dc0dae8 100644 --- a/arch/um/Makefile-i386 +++ b/arch/um/Makefile-i386 @@ -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) diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64 index 36d2bb5e4192..8836f0df36aa 100644 --- a/arch/um/Makefile-x86_64 +++ b/arch/um/Makefile-x86_64 @@ -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 diff --git a/arch/um/sys-ppc/Makefile b/arch/um/sys-ppc/Makefile index af200268fddb..a9814a7ae60e 100644 --- a/arch/um/sys-ppc/Makefile +++ b/arch/um/sys-ppc/Makefile @@ -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 diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index 646292aaf1fc..d6ed8e5e1ccc 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile @@ -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) diff --git a/arch/x86/boot/compressed/Makefile_64 b/arch/x86/boot/compressed/Makefile_64 index 3013ad01fe69..7801e8dd90b2 100644 --- a/arch/x86/boot/compressed/Makefile_64 +++ b/arch/x86/boot/compressed/Makefile_64 @@ -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 diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile index 3fc33004e8c6..9daa32d1d2a1 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86_64/Makefile @@ -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 diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index b1a7c7d42e15..de7bb284c611 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -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) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 51ae412929a0..2837adaa9850 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -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 -- cgit v1.2.3-59-g8ed1b From 06c5040cdb13d27adad118f2fbfae905a1911b37 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Mon, 15 Oct 2007 22:17:25 +0200 Subject: kbuild: enable 'make CPPFLAGS=...' to add additional options to CPP The variable CPPFLAGS is a wellknown variable and the usage by kbuild may result in unexpected behaviour. This patch replace use of CPPFLAGS with KBUILD_CPPFLAGS all over the tree and enabling one to use: make CPPFLAGS=... to specify additional CPP commandline options. Patch was tested on following architectures: alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k, s390 Signed-off-by: Sam Ravnborg --- Documentation/kbuild/makefiles.txt | 2 +- Makefile | 13 +++++++------ arch/arm/Makefile | 4 ++-- arch/ia64/Makefile | 2 +- arch/powerpc/Makefile | 2 +- arch/ppc/Makefile | 2 +- arch/um/Makefile-x86_64 | 2 +- drivers/atm/Makefile | 2 +- scripts/Makefile.lib | 6 +++--- 9 files changed, 18 insertions(+), 17 deletions(-) (limited to 'arch/um') diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index f4779cd1542f..08fbe6cd309d 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -1099,7 +1099,7 @@ When kbuild executes, the following steps are followed (roughly): specified options when building the target vmlinux.lds. When building the *.lds target, kbuild uses the variables: - CPPFLAGS : Set in top-level Makefile + KBUILD_CPPFLAGS : Set in top-level Makefile EXTRA_CPPFLAGS : May be set in the kbuild makefile CPPFLAGS_$(@F) : Target specific flags. Note that the full filename is used in this diff --git a/Makefile b/Makefile index ad0add0fa7d4..ed65de7078c7 100644 --- a/Makefile +++ b/Makefile @@ -318,7 +318,7 @@ LINUXINCLUDE := -Iinclude \ $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include) \ -include include/linux/autoconf.h -CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) +KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXINCLUDE) KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -fno-strict-aliasing -fno-common \ @@ -334,7 +334,7 @@ export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS -export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS +export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE @@ -523,9 +523,10 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,) # disable pointer signed / unsigned warnings in gcc 4.0 KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) -# Add user supplied AFLAGS and CFLAGS as the last assignments -KBUILD_AFLAGS += $(AFLAGS) -KBUILD_CFLAGS += $(CFLAGS) +# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments +KBUILD_CPPFLAGS += $(CPPFLAGS) +KBUILD_AFLAGS += $(AFLAGS) +KBUILD_CFLAGS += $(CFLAGS) # Use --build-id when available. LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ @@ -1507,7 +1508,7 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)) a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ - $(NOSTDINC_FLAGS) $(CPPFLAGS) \ + $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) quiet_cmd_as_o_S = AS $@ diff --git a/arch/arm/Makefile b/arch/arm/Makefile index b762d235b81a..0d450e757e0e 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -32,11 +32,11 @@ KBUILD_CFLAGS +=-fno-omit-frame-pointer -mapcs -mno-sched-prolog endif ifeq ($(CONFIG_CPU_BIG_ENDIAN),y) -CPPFLAGS += -mbig-endian +KBUILD_CPPFLAGS += -mbig-endian AS += -EB LD += -EB else -CPPFLAGS += -mlittle-endian +KBUILD_CPPFLAGS += -mlittle-endian AS += -EL LD += -EL endif diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index 9708a29c70b5..34951aa2370b 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile @@ -29,7 +29,7 @@ cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \ CFLAGS_KERNEL := -mconstant-gp GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") -CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") +KBUILD_CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") ifeq ($(GAS_STATUS),buggy) $(error Sorry, you need a newer version of the assember, one that is built from \ diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 462bb89b67e8..4e165342210a 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -75,7 +75,7 @@ CPPFLAGS-$(CONFIG_PPC32) := -Iarch/$(ARCH) 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) +KBUILD_CPPFLAGS += $(CPPFLAGS-y) KBUILD_AFLAGS += $(AFLAGS-y) KBUILD_CFLAGS += -msoft-float -pipe $(CFLAGS-y) CPP = $(CC) -E $(KBUILD_CFLAGS) diff --git a/arch/ppc/Makefile b/arch/ppc/Makefile index dd63ccb66732..95894ef7beaa 100644 --- a/arch/ppc/Makefile +++ b/arch/ppc/Makefile @@ -22,7 +22,7 @@ endif LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic # The -Iarch/$(ARCH)/include is temporary while we are merging -CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include +KBUILD_CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include KBUILD_AFLAGS += -Iarch/$(ARCH) KBUILD_CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \ -ffixed-r2 -mmultiple diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64 index 8836f0df36aa..bcfd6ea30030 100644 --- a/arch/um/Makefile-x86_64 +++ b/arch/um/Makefile-x86_64 @@ -14,7 +14,7 @@ KBUILD_CFLAGS += $(_extra_flags_) CHECKFLAGS += -m64 KBUILD_AFLAGS += -m64 LDFLAGS += -m elf_x86_64 -CPPFLAGS += -m64 +KBUILD_CPPFLAGS += -m64 ELF_ARCH := i386:x86-64 ELF_FORMAT := elf64-x86-64 diff --git a/drivers/atm/Makefile b/drivers/atm/Makefile index 1b16f8166b09..e4fa99658699 100644 --- a/drivers/atm/Makefile +++ b/drivers/atm/Makefile @@ -41,7 +41,7 @@ ifeq ($(CONFIG_ATM_FORE200E_PCA),y) # guess the target endianess to choose the right PCA-200E firmware image ifeq ($(CONFIG_ATM_FORE200E_PCA_DEFAULT_FW),y) byteorder.h := include$(if $(patsubst $(srctree),,$(objtree)),2)/asm/byteorder.h - CONFIG_ATM_FORE200E_PCA_FW := $(obj)/pca200e$(if $(shell $(CC) $(CPPFLAGS) -E -dM $(byteorder.h) | grep ' __LITTLE_ENDIAN '),.bin,_ecd.bin2) + CONFIG_ATM_FORE200E_PCA_FW := $(obj)/pca200e$(if $(shell $(CC) $(KBUILD_CPPFLAGS) -E -dM $(byteorder.h) | grep ' __LITTLE_ENDIAN '),.bin,_ecd.bin2) endif endif diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 2837adaa9850..95e6e0fbdbd0 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -86,7 +86,7 @@ modname_flags = $(if $(filter 1,$(words $(modname))),\ _c_flags = $(KBUILD_CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$(basetarget).o) _a_flags = $(KBUILD_AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) -_cpp_flags = $(CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F)) +_cpp_flags = $(KBUILD_CPPFLAGS) $(EXTRA_CPPFLAGS) $(CPPFLAGS_$(@F)) # If building the kernel in a separate objtree expand all occurrences # of -Idir to -I$(srctree)/dir except for absolute paths (starting with '/'). @@ -106,11 +106,11 @@ __a_flags = $(call flags,_a_flags) __cpp_flags = $(call flags,_cpp_flags) endif -c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ +c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ $(__c_flags) $(modkern_cflags) \ -D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags) -a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(CPPFLAGS) \ +a_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) \ $(__a_flags) $(modkern_aflags) cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(__cpp_flags) -- cgit v1.2.3-59-g8ed1b