Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da9e82b3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  modpost: support objects with more than 64k sections
  trivial: fix a typo in a filename
  frv: clean up arch/frv/Makefile
  kbuild: allow assignment to {A,C}FLAGS_KERNEL on the command line
  kbuild: allow assignment to {A,C,LD}FLAGS_MODULE on the command line
  Kbuild: Add option to set -femit-struct-debug-baseonly
  Makefile: "make kernelrelease" should show the correct full kernel version
  Makefile.build: make KBUILD_SYMTYPES work again
parents 90d3417a 772320e8
Loading
Loading
Loading
Loading
+24 −2
Original line number Diff line number Diff line
@@ -22,11 +22,33 @@ building C files and assembler files.

KAFLAGS
--------------------------------------------------
Additional options to the assembler.
Additional options to the assembler (for built-in and modules).

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.
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).

LDFLAGS_MODULE
--------------------------------------------------
Additional options used for $(LD) when linking modules.

KBUILD_VERBOSE
--------------------------------------------------
+22 −5
Original line number Diff line number Diff line
@@ -921,16 +921,33 @@ 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.

    CFLAGS_MODULE	$(CC) options specific for modules
    KBUILD_AFLAGS_MODULE   Options for $(AS) when building modules

	$(CFLAGS_MODULE) contains extra C compiler flags used to compile code
	for loadable kernel modules.
	$(KBUILD_AFLAGS_MODULE) is used to add arch specific options that
	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
	are used for $(CC).
	From commandline CFLAGS_MODULE shall be used (see kbuild.txt).

    KBUILD_LDFLAGS_MODULE   Options for $(LD) when linking modules

	$(KBUILD_LDFLAGS_MODULE) is used to add arch specific options
	used when linking modules. This is often a linker script.
	From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).

--- 6.2 Add prerequisites to archprepare:

+20 −9
Original line number Diff line number Diff line
@@ -332,10 +332,9 @@ CHECK = sparse

CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
		  -Wbitwise -Wno-return-void $(CF)
MODFLAGS	= -DMODULE
CFLAGS_MODULE   = $(MODFLAGS)
AFLAGS_MODULE   = $(MODFLAGS)
LDFLAGS_MODULE  = -T $(srctree)/scripts/module-common.lds
CFLAGS_MODULE   =
AFLAGS_MODULE   =
LDFLAGS_MODULE  =
CFLAGS_KERNEL	=
AFLAGS_KERNEL	=
CFLAGS_GCOV	= -fprofile-arcs -ftest-coverage
@@ -354,7 +353,12 @@ 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
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds

# Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
@@ -369,6 +373,8 @@ export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
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
@@ -414,7 +420,7 @@ endif
no-dot-config-targets := clean mrproper distclean \
			 cscope TAGS tags help %docs check% \
			 include/linux/version.h headers_% \
			 kernelrelease kernelversion
			 kernelversion

config-targets := 0
mixed-targets  := 0
@@ -557,6 +563,10 @@ KBUILD_CFLAGS += -g
KBUILD_AFLAGS	+= -gdwarf-2
endif

ifdef CONFIG_DEBUG_INFO_REDUCED
KBUILD_CFLAGS 	+= $(call cc-option, -femit-struct-debug-baseonly)
endif

ifdef CONFIG_FUNCTION_TRACER
KBUILD_CFLAGS	+= -pg
endif
@@ -603,7 +613,7 @@ endif
# Use --build-id when available.
LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\
			      $(call cc-ldoption, -Wl$(comma)--build-id,))
LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
KBUILD_LDFLAGS_MODULE += $(LDFLAGS_BUILD_ID)
LDFLAGS_vmlinux += $(LDFLAGS_BUILD_ID)

ifeq ($(CONFIG_STRIP_ASM_SYMS),y)
@@ -1393,9 +1403,9 @@ checkstack:
	$(OBJDUMP) -d vmlinux $$(find . -name '*.ko') | \
	$(PERL) $(src)/scripts/checkstack.pl $(CHECKSTACK_ARCH)

kernelrelease:
	$(if $(wildcard include/config/kernel.release), $(Q)echo $(KERNELRELEASE), \
	$(error kernelrelease not valid - run 'make prepare' to update it))
kernelrelease: include/config/kernel.release
	@echo $(KERNELRELEASE)

kernelversion:
	@echo $(KERNELVERSION)

@@ -1472,6 +1482,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)

+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ KBUILD_DEFCONFIG := atstk1002_defconfig

KBUILD_CFLAGS	+= -pipe -fno-builtin -mno-pic
KBUILD_AFLAGS	+= -mrelax -mno-pic
CFLAGS_MODULE	+= -mno-relax
KBUILD_CFLAGS_MODULE += -mno-relax
LDFLAGS_vmlinux	+= --relax

cpuflags-$(CONFIG_PLATFORM_AT32AP)	+= -march=ap
+2 −2
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ ifeq ($(CONFIG_ROMKERNEL),y)
KBUILD_CFLAGS           += -mlong-calls
endif
KBUILD_AFLAGS           += $(call cc-option,-mno-fdpic)
CFLAGS_MODULE    += -mlong-calls
LDFLAGS_MODULE   += -m elf32bfin
KBUILD_CFLAGS_MODULE    += -mlong-calls
KBUILD_LDFLAGS_MODULE   += -m elf32bfin
KALLSYMS         += --symbol-prefix=_

KBUILD_DEFCONFIG := BF537-STAMP_defconfig
Loading