diff options
| -rw-r--r-- | Documentation/kbuild/kbuild.txt | 10 | ||||
| -rw-r--r-- | Documentation/kbuild/makefiles.txt | 9 | ||||
| -rw-r--r-- | Makefile | 4 | ||||
| -rw-r--r-- | arch/ia64/Makefile | 4 | ||||
| -rw-r--r-- | arch/m32r/Makefile | 2 | ||||
| -rw-r--r-- | scripts/Makefile.build | 4 |
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 | -------------------------------------------------- |
| 29 | Addtional module specific options to use for $(AS). | 29 | Addtional module specific options to use for $(AS). |
| 30 | 30 | ||
| 31 | AFLAGS_KERNEL | ||
| 32 | -------------------------------------------------- | ||
| 33 | Addtional options for $(AS) when used for assembler | ||
| 34 | code for code that is compiled as built-in. | ||
| 35 | |||
| 31 | KCFLAGS | 36 | KCFLAGS |
| 32 | -------------------------------------------------- | 37 | -------------------------------------------------- |
| 33 | Additional options to the C compiler (for built-in and modules). | 38 | Additional options to the C compiler (for built-in and modules). |
| 34 | 39 | ||
| 40 | CFLAGS_KERNEL | ||
| 41 | -------------------------------------------------- | ||
| 42 | Addtional options for $(CC) when used to compile | ||
| 43 | code that is compiled as built-in. | ||
| 44 | |||
| 35 | CFLAGS_MODULE | 45 | CFLAGS_MODULE |
| 36 | -------------------------------------------------- | 46 | -------------------------------------------------- |
| 37 | Addtional module specific options to use for $(CC). | 47 | Addtional 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 |
| @@ -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 |
| 356 | KBUILD_AFLAGS_KERNEL := | ||
| 357 | KBUILD_CFLAGS_KERNEL := | ||
| 356 | KBUILD_AFLAGS := -D__ASSEMBLY__ | 358 | KBUILD_AFLAGS := -D__ASSEMBLY__ |
| 357 | KBUILD_AFLAGS_MODULE := -DMODULE | 359 | KBUILD_AFLAGS_MODULE := -DMODULE |
| 358 | KBUILD_CFLAGS_MODULE := -DMODULE | 360 | KBUILD_CFLAGS_MODULE := -DMODULE |
| @@ -372,6 +374,7 @@ export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS | |||
| 372 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV | 374 | export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV |
| 373 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE | 375 | export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE |
| 374 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE | 376 | export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE |
| 377 | export 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 | ||
| 1483 | a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \ | 1486 | a_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__ | |||
| 23 | OBJCOPYFLAGS := --strip-all | 23 | OBJCOPYFLAGS := --strip-all |
| 24 | LDFLAGS_vmlinux := -static | 24 | LDFLAGS_vmlinux := -static |
| 25 | KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds | 25 | KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds |
| 26 | AFLAGS_KERNEL := -mconstant-gp | 26 | KBUILD_AFLAGS_KERNEL := -mconstant-gp |
| 27 | EXTRA := | 27 | EXTRA := |
| 28 | 28 | ||
| 29 | cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \ | 29 | cflags-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 |
| 31 | CFLAGS_KERNEL := -mconstant-gp | 31 | KBUILD_CFLAGS_KERNEL := -mconstant-gp |
| 32 | 32 | ||
| 33 | GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") | 33 | GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)") |
| 34 | KBUILD_CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)") | 34 | KBUILD_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 | |||
| 12 | LDFLAGS_vmlinux := | 12 | LDFLAGS_vmlinux := |
| 13 | 13 | ||
| 14 | KBUILD_CFLAGS += -pipe -fno-schedule-insns | 14 | KBUILD_CFLAGS += -pipe -fno-schedule-insns |
| 15 | CFLAGS_KERNEL += -mmodel=medium | 15 | KBUILD_CFLAGS_KERNEL += -mmodel=medium |
| 16 | KBUILD_CFLAGS_MODULE += -mmodel=large | 16 | KBUILD_CFLAGS_MODULE += -mmodel=large |
| 17 | 17 | ||
| 18 | ifdef CONFIG_CHIP_VDEC2 | 18 | ifdef 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 | |||
| 118 | modkern_cflags = \ | 118 | modkern_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)) |
| 122 | quiet_modtag := $(empty) $(empty) | 122 | quiet_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 | ||
| 254 | modkern_aflags := $(AFLAGS_KERNEL) | 254 | modkern_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) |
