aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/kbuild/kbuild.txt10
-rw-r--r--Documentation/kbuild/makefiles.txt9
-rw-r--r--Makefile4
-rw-r--r--arch/ia64/Makefile4
-rw-r--r--arch/m32r/Makefile2
-rw-r--r--scripts/Makefile.build4
6 files changed, 26 insertions, 7 deletions
diff --git a/Documentation/kbuild/kbuild.txt b/Documentation/kbuild/kbuild.txt
index d9c655433ec6..e903f20077cf 100644
--- a/Documentation/kbuild/kbuild.txt
+++ b/Documentation/kbuild/kbuild.txt
@@ -28,10 +28,20 @@ AFLAGS_MODULE
28-------------------------------------------------- 28--------------------------------------------------
29Addtional module specific options to use for $(AS). 29Addtional module specific options to use for $(AS).
30 30
31AFLAGS_KERNEL
32--------------------------------------------------
33Addtional options for $(AS) when used for assembler
34code for code that is compiled as built-in.
35
31KCFLAGS 36KCFLAGS
32-------------------------------------------------- 37--------------------------------------------------
33Additional options to the C compiler (for built-in and modules). 38Additional options to the C compiler (for built-in and modules).
34 39
40CFLAGS_KERNEL
41--------------------------------------------------
42Addtional options for $(CC) when used to compile
43code that is compiled as built-in.
44
35CFLAGS_MODULE 45CFLAGS_MODULE
36-------------------------------------------------- 46--------------------------------------------------
37Addtional module specific options to use for $(CC). 47Addtional module specific options to use for $(CC).
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 802341abf702..5c878cc6c0b4 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -923,9 +923,9 @@ When kbuild executes, the following steps are followed (roughly):
923 The first example utilises the trick that a config option expands 923 The first example utilises the trick that a config option expands
924 to 'y' when selected. 924 to 'y' when selected.
925 925
926 CFLAGS_KERNEL $(CC) options specific for built-in 926 KBUILD_AFLAGS_KERNEL $(AS) options specific for built-in
927 927
928 $(CFLAGS_KERNEL) contains extra C compiler flags used to compile 928 $(KBUILD_AFLAGS_KERNEL) contains extra C compiler flags used to compile
929 resident kernel code. 929 resident kernel code.
930 930
931 KBUILD_AFLAGS_MODULE Options for $(AS) when building modules 931 KBUILD_AFLAGS_MODULE Options for $(AS) when building modules
@@ -934,6 +934,11 @@ When kbuild executes, the following steps are followed (roughly):
934 are used for $(AS). 934 are used for $(AS).
935 From commandline AFLAGS_MODULE shall be used (see kbuild.txt). 935 From commandline AFLAGS_MODULE shall be used (see kbuild.txt).
936 936
937 KBUILD_CFLAGS_KERNEL $(CC) options specific for built-in
938
939 $(KBUILD_CFLAGS_KERNEL) contains extra C compiler flags used to compile
940 resident kernel code.
941
937 KBUILD_CFLAGS_MODULE Options for $(CC) when building modules 942 KBUILD_CFLAGS_MODULE Options for $(CC) when building modules
938 943
939 $(KBUILD_CFLAGS_MODULE) is used to add arch specific options that 944 $(KBUILD_CFLAGS_MODULE) is used to add arch specific options that
diff --git a/Makefile b/Makefile
index 3dbd62b0bcfe..7af9d5479461 100644
--- a/Makefile
+++ b/Makefile
@@ -353,6 +353,8 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
353 -Werror-implicit-function-declaration \ 353 -Werror-implicit-function-declaration \
354 -Wno-format-security \ 354 -Wno-format-security \
355 -fno-delete-null-pointer-checks 355 -fno-delete-null-pointer-checks
356KBUILD_AFLAGS_KERNEL :=
357KBUILD_CFLAGS_KERNEL :=
356KBUILD_AFLAGS := -D__ASSEMBLY__ 358KBUILD_AFLAGS := -D__ASSEMBLY__
357KBUILD_AFLAGS_MODULE := -DMODULE 359KBUILD_AFLAGS_MODULE := -DMODULE
358KBUILD_CFLAGS_MODULE := -DMODULE 360KBUILD_CFLAGS_MODULE := -DMODULE
@@ -372,6 +374,7 @@ export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
372export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV 374export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV
373export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE 375export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
374export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE 376export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
377export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
375 378
376# When compiling out-of-tree modules, put MODVERDIR in the module 379# When compiling out-of-tree modules, put MODVERDIR in the module
377# tree rather than in the kernel tree. The kernel tree might 380# tree rather than in the kernel tree. The kernel tree might
@@ -1481,6 +1484,7 @@ cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \
1481 $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*) 1484 $(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*)
1482 1485
1483a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ 1486a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
1487 $(KBUILD_AFLAGS_KERNEL) \
1484 $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) \ 1488 $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) \
1485 $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o) 1489 $(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)
1486 1490
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile
index 5ab6af3361a8..62b10f5f2540 100644
--- a/arch/ia64/Makefile
+++ b/arch/ia64/Makefile
@@ -23,12 +23,12 @@ CHECKFLAGS += -m64 -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__
23OBJCOPYFLAGS := --strip-all 23OBJCOPYFLAGS := --strip-all
24LDFLAGS_vmlinux := -static 24LDFLAGS_vmlinux := -static
25KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds 25KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds
26AFLAGS_KERNEL := -mconstant-gp 26KBUILD_AFLAGS_KERNEL := -mconstant-gp
27EXTRA := 27EXTRA :=
28 28
29cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \ 29cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \
30 -falign-functions=32 -frename-registers -fno-optimize-sibling-calls 30 -falign-functions=32 -frename-registers -fno-optimize-sibling-calls
31CFLAGS_KERNEL := -mconstant-gp 31KBUILD_CFLAGS_KERNEL := -mconstant-gp
32 32
33GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") 33GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)")
34KBUILD_CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") 34KBUILD_CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)")
diff --git a/arch/m32r/Makefile b/arch/m32r/Makefile
index 14a3c2314fef..8ff5ba0ea26c 100644
--- a/arch/m32r/Makefile
+++ b/arch/m32r/Makefile
@@ -12,7 +12,7 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S
12LDFLAGS_vmlinux := 12LDFLAGS_vmlinux :=
13 13
14KBUILD_CFLAGS += -pipe -fno-schedule-insns 14KBUILD_CFLAGS += -pipe -fno-schedule-insns
15CFLAGS_KERNEL += -mmodel=medium 15KBUILD_CFLAGS_KERNEL += -mmodel=medium
16KBUILD_CFLAGS_MODULE += -mmodel=large 16KBUILD_CFLAGS_MODULE += -mmodel=large
17 17
18ifdef CONFIG_CHIP_VDEC2 18ifdef CONFIG_CHIP_VDEC2
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 5e7c40e16545..a1a5cf95a68d 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -118,7 +118,7 @@ endif
118modkern_cflags = \ 118modkern_cflags = \
119 $(if $(part-of-module), \ 119 $(if $(part-of-module), \
120 $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \ 120 $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \
121 $(CFLAGS_KERNEL)) 121 $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL))
122quiet_modtag := $(empty) $(empty) 122quiet_modtag := $(empty) $(empty)
123 123
124$(real-objs-m) : part-of-module := y 124$(real-objs-m) : part-of-module := y
@@ -251,7 +251,7 @@ $(obj)/%.lst: $(src)/%.c FORCE
251# Compile assembler sources (.S) 251# Compile assembler sources (.S)
252# --------------------------------------------------------------------------- 252# ---------------------------------------------------------------------------
253 253
254modkern_aflags := $(AFLAGS_KERNEL) 254modkern_aflags := $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL)
255 255
256$(real-objs-m) : modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) 256$(real-objs-m) : modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
257$(real-objs-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) 257$(real-objs-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)