Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204826
b: refs/heads/master
c: 80c00ba
h: refs/heads/master
v: v3
  • Loading branch information
Sam Ravnborg authored and Michal Marek committed Aug 3, 2010
1 parent 599c5d3 commit d9b7e98
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6588169d516560f68672e2928680b71c647b7806
refs/heads/master: 80c00ba942ee39c9a95c06959223560400bbb86e
10 changes: 10 additions & 0 deletions trunk/Documentation/kbuild/kbuild.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,20 @@ AFLAGS_MODULE
--------------------------------------------------
Addtional module specific options to use for $(AS).

AFLAGS_KERNEL
--------------------------------------------------
Addtional options for $(AS) when used for assembler
code for code that is compiled as built-in.

KCFLAGS
--------------------------------------------------
Additional options to the C compiler (for built-in and modules).

CFLAGS_KERNEL
--------------------------------------------------
Addtional options for $(CC) when used to compile
code that is compiled as built-in.

CFLAGS_MODULE
--------------------------------------------------
Addtional module specific options to use for $(CC).
Expand Down
9 changes: 7 additions & 2 deletions trunk/Documentation/kbuild/makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -923,9 +923,9 @@ When kbuild executes, the following steps are followed (roughly):
The first example utilises the trick that a config option expands
to 'y' when selected.

CFLAGS_KERNEL $(CC) options specific for built-in
KBUILD_AFLAGS_KERNEL $(AS) options specific for built-in

$(CFLAGS_KERNEL) contains extra C compiler flags used to compile
$(KBUILD_AFLAGS_KERNEL) contains extra C compiler flags used to compile
resident kernel code.

KBUILD_AFLAGS_MODULE Options for $(AS) when building modules
Expand All @@ -934,6 +934,11 @@ When kbuild executes, the following steps are followed (roughly):
are used for $(AS).
From commandline AFLAGS_MODULE shall be used (see kbuild.txt).

KBUILD_CFLAGS_KERNEL $(CC) options specific for built-in

$(KBUILD_CFLAGS_KERNEL) contains extra C compiler flags used to compile
resident kernel code.

KBUILD_CFLAGS_MODULE Options for $(CC) when building modules

$(KBUILD_CFLAGS_MODULE) is used to add arch specific options that
Expand Down
4 changes: 4 additions & 0 deletions trunk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
-Werror-implicit-function-declaration \
-Wno-format-security \
-fno-delete-null-pointer-checks
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS := -D__ASSEMBLY__
KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
Expand All @@ -372,6 +374,7 @@ export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL

# When compiling out-of-tree modules, put MODVERDIR in the module
# tree rather than in the kernel tree. The kernel tree might
Expand Down Expand Up @@ -1481,6 +1484,7 @@ cmd_crmodverdir = $(Q)mkdir -p $(MODVERDIR) \
$(if $(KBUILD_MODULES),; rm -f $(MODVERDIR)/*)

a_flags = -Wp,-MD,$(depfile) $(KBUILD_AFLAGS) $(AFLAGS_KERNEL) \
$(KBUILD_AFLAGS_KERNEL) \
$(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(KBUILD_CPPFLAGS) \
$(modkern_aflags) $(EXTRA_AFLAGS) $(AFLAGS_$(basetarget).o)

Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/ia64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ CHECKFLAGS += -m64 -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__
OBJCOPYFLAGS := --strip-all
LDFLAGS_vmlinux := -static
KBUILD_LDFLAGS_MODULE += -T $(srctree)/arch/ia64/module.lds
AFLAGS_KERNEL := -mconstant-gp
KBUILD_AFLAGS_KERNEL := -mconstant-gp
EXTRA :=

cflags-y := -pipe $(EXTRA) -ffixed-r13 -mfixed-range=f12-f15,f32-f127 \
-falign-functions=32 -frename-registers -fno-optimize-sibling-calls
CFLAGS_KERNEL := -mconstant-gp
KBUILD_CFLAGS_KERNEL := -mconstant-gp

GAS_STATUS = $(shell $(srctree)/arch/ia64/scripts/check-gas "$(CC)" "$(OBJDUMP)")
KBUILD_CPPFLAGS += $(shell $(srctree)/arch/ia64/scripts/toolchain-flags "$(CC)" "$(OBJDUMP)" "$(READELF)")
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/m32r/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ OBJCOPYFLAGS := -O binary -R .note -R .comment -S
LDFLAGS_vmlinux :=

KBUILD_CFLAGS += -pipe -fno-schedule-insns
CFLAGS_KERNEL += -mmodel=medium
KBUILD_CFLAGS_KERNEL += -mmodel=medium
KBUILD_CFLAGS_MODULE += -mmodel=large

ifdef CONFIG_CHIP_VDEC2
Expand Down
4 changes: 2 additions & 2 deletions trunk/scripts/Makefile.build
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ endif
modkern_cflags = \
$(if $(part-of-module), \
$(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \
$(CFLAGS_KERNEL))
$(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL))
quiet_modtag := $(empty) $(empty)

$(real-objs-m) : part-of-module := y
Expand Down Expand Up @@ -251,7 +251,7 @@ $(obj)/%.lst: $(src)/%.c FORCE
# Compile assembler sources (.S)
# ---------------------------------------------------------------------------

modkern_aflags := $(AFLAGS_KERNEL)
modkern_aflags := $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL)

$(real-objs-m) : modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
$(real-objs-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE)
Expand Down

0 comments on commit d9b7e98

Please sign in to comment.