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

Commit 2bb732cd 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:
  kbuild: make KBUILD_NOCMDDEP=1 handle empty built-in.o
  scripts/kallsyms.c: fix potential segfault
  scripts/gen_initramfs_list.sh: Convert to a /bin/sh script
  kbuild: Fix GNU make v3.80 compatibility
  kbuild: Fix passing -Wno-* options to gcc 4.4+
  kbuild: move scripts/basic/docproc.c to scripts/docproc.c
  kbuild: Fix Makefile.asm-generic for um
  kbuild: Allow to combine multiple W= levels
  kbuild: Disable -Wunused-but-set-variable for gcc 4.6.0
  Fix handling of backlash character in LINUX_COMPILE_BY name
  kbuild: asm-generic support
  kbuild: implement several W= levels
  kbuild: Fix build with binutils <= 2.19
  initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries
  kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros
  kbuild: Drop unused LINUX_COMPILE_TIME and LINUX_COMPILE_DOMAIN macros
  kbuild: Use the deterministic mode of ar
  kbuild: Call gzip with -n
  kbuild: move KALLSYMS_EXTRA_PASS from Kconfig to Makefile
  Kconfig: improve KALLSYMS_ALL documentation

Fix up trivial conflict in Makefile
parents f50d1d9e c4d5ee13
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -57,6 +57,7 @@ modules.builtin
include/config
include/config
include/linux/version.h
include/linux/version.h
include/generated
include/generated
arch/*/include/generated


# stgit generated dirs
# stgit generated dirs
patches-*
patches-*
+1 −1
Original line number Original line Diff line number Diff line
@@ -73,7 +73,7 @@ installmandocs: mandocs
###
###
#External programs used
#External programs used
KERNELDOC = $(srctree)/scripts/kernel-doc
KERNELDOC = $(srctree)/scripts/kernel-doc
DOCPROC   = $(objtree)/scripts/basic/docproc
DOCPROC   = $(objtree)/scripts/docproc


XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl
XMLTOFLAGS = -m $(srctree)/Documentation/DocBook/stylesheet.xsl
XMLTOFLAGS += --skip-validation
XMLTOFLAGS += --skip-validation
+13 −0
Original line number Original line Diff line number Diff line
@@ -201,3 +201,16 @@ KBUILD_ENABLE_EXTRA_GCC_CHECKS
--------------------------------------------------
--------------------------------------------------
If enabled over the make command line with "W=1", it turns on additional
If enabled over the make command line with "W=1", it turns on additional
gcc -W... options for more extensive build-time checking.
gcc -W... options for more extensive build-time checking.

KBUILD_BUILD_TIMESTAMP
--------------------------------------------------
Setting this to a date string overrides the timestamp used in the
UTS_VERSION definition (uname -v in the running kernel). The value has to
be a string that can be passed to date -d. The default value
is the output of the date command at one point during build.

KBUILD_BUILD_USER, KBUILD_BUILD_HOST
--------------------------------------------------
These two variables allow to override the user@host string displayed during
boot and in /proc/version. The default value is the output of the commands
whoami and host, respectively.
+53 −0
Original line number Original line Diff line number Diff line
@@ -40,11 +40,13 @@ This document describes the Linux kernel Makefiles.
	   --- 6.6 Commands useful for building a boot image
	   --- 6.6 Commands useful for building a boot image
	   --- 6.7 Custom kbuild commands
	   --- 6.7 Custom kbuild commands
	   --- 6.8 Preprocessing linker scripts
	   --- 6.8 Preprocessing linker scripts
	   --- 6.9 Generic header files


	=== 7 Kbuild syntax for exported headers
	=== 7 Kbuild syntax for exported headers
		--- 7.1 header-y
		--- 7.1 header-y
		--- 7.2 objhdr-y
		--- 7.2 objhdr-y
		--- 7.3 destination-y
		--- 7.3 destination-y
		--- 7.4 generic-y


	=== 8 Kbuild Variables
	=== 8 Kbuild Variables
	=== 9 Makefile language
	=== 9 Makefile language
@@ -499,6 +501,18 @@ more details, with real examples.
	gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used.
	gcc >= 3.00. For gcc < 3.00, -malign-functions=4 is used.
	Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options
	Note: cc-option-align uses KBUILD_CFLAGS for $(CC) options


    cc-disable-warning
	cc-disable-warning checks if gcc supports a given warning and returns
	the commandline switch to disable it. This special function is needed,
	because gcc 4.4 and later accept any unknown -Wno-* option and only
	warn about it if there is another warning in the source file.

	Example:
		KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)

	In the above example, -Wno-unused-but-set-variable will be added to
	KBUILD_CFLAGS only if gcc really accepts it.

    cc-version
    cc-version
	cc-version returns a numerical version of the $(CC) compiler version.
	cc-version returns a numerical version of the $(CC) compiler version.
	The format is <major><minor> where both are two digits. So for example
	The format is <major><minor> where both are two digits. So for example
@@ -955,6 +969,11 @@ When kbuild executes, the following steps are followed (roughly):
	used when linking modules. This is often a linker script.
	used when linking modules. This is often a linker script.
	From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).
	From commandline LDFLAGS_MODULE shall be used (see kbuild.txt).


    KBUILD_ARFLAGS   Options for $(AR) when creating archives

	$(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
	mode) if this option is supported by $(AR).

--- 6.2 Add prerequisites to archprepare:
--- 6.2 Add prerequisites to archprepare:


	The archprepare: rule is used to list prerequisites that need to be
	The archprepare: rule is used to list prerequisites that need to be
@@ -1209,6 +1228,14 @@ When kbuild executes, the following steps are followed (roughly):
	The kbuild infrastructure for *lds file are used in several
	The kbuild infrastructure for *lds file are used in several
	architecture-specific files.
	architecture-specific files.


--- 6.9 Generic header files

	The directory include/asm-generic contains the header files
	that may be shared between individual architectures.
	The recommended approach how to use a generic header file is
	to list the file in the Kbuild file.
	See "7.4 generic-y" for further info on syntax etc.

=== 7 Kbuild syntax for exported headers
=== 7 Kbuild syntax for exported headers


The kernel include a set of headers that is exported to userspace.
The kernel include a set of headers that is exported to userspace.
@@ -1265,6 +1292,32 @@ See subsequent chapter for the syntax of the Kbuild file.
	In the example above all exported headers in the Kbuild file
	In the example above all exported headers in the Kbuild file
	will be located in the directory "include/linux" when exported.
	will be located in the directory "include/linux" when exported.


	--- 7.4 generic-y

	If an architecture uses a verbatim copy of a header from
	include/asm-generic then this is listed in the file
	arch/$(ARCH)/include/asm/Kbuild like this:

		Example:
			#arch/x86/include/asm/Kbuild
			generic-y += termios.h
			generic-y += rtc.h

	During the prepare phase of the build a wrapper include
	file is generated in the directory:

		arch/$(ARCH)/include/generated/asm

	When a header is exported where the architecture uses
	the generic header a similar wrapper is generated as part
	of the set of exported headers in the directory:

		usr/include/asm

	The generated wrapper will in both cases look like the following:

		Example: termios.h
			#include <asm-generic/termios.h>


=== 8 Kbuild Variables
=== 8 Kbuild Variables


+37 −13
Original line number Original line Diff line number Diff line
@@ -103,7 +103,7 @@ ifeq ("$(origin O)", "command line")
endif
endif


ifeq ("$(origin W)", "command line")
ifeq ("$(origin W)", "command line")
  export KBUILD_ENABLE_EXTRA_GCC_CHECKS := 1
  export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W)
endif
endif


# That's our default target when none is given on the command line
# That's our default target when none is given on the command line
@@ -349,7 +349,8 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage


# Use LINUXINCLUDE when you must reference the include/ directory.
# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
# Needed to be compatible with the O= option
LINUXINCLUDE    := -I$(srctree)/arch/$(hdr-arch)/include -Iinclude \
LINUXINCLUDE    := -I$(srctree)/arch/$(hdr-arch)/include \
                   -Iarch/$(hdr-arch)/include/generated -Iinclude \
                   $(if $(KBUILD_SRC), -I$(srctree)/include) \
                   $(if $(KBUILD_SRC), -I$(srctree)/include) \
                   -include include/generated/autoconf.h
                   -include include/generated/autoconf.h


@@ -382,6 +383,7 @@ export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE CFLAGS_GCOV
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
export KBUILD_ARFLAGS


# When compiling out-of-tree modules, put MODVERDIR in the module
# When compiling out-of-tree modules, put MODVERDIR in the module
# tree rather than in the kernel tree. The kernel tree might
# tree rather than in the kernel tree. The kernel tree might
@@ -416,6 +418,12 @@ ifneq ($(KBUILD_SRC),)
	    $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
	    $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
endif
endif


# Support for using generic headers in asm-generic
PHONY += asm-generic
asm-generic:
	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-generic \
	            obj=arch/$(SRCARCH)/include/generated/asm

# To make sure we do not include .config for any of the *config targets
# To make sure we do not include .config for any of the *config targets
# catch them early, and hand them over to scripts/kconfig/Makefile
# catch them early, and hand them over to scripts/kconfig/Makefile
# It is allowed to specify more targets when calling make, including
# It is allowed to specify more targets when calling make, including
@@ -559,6 +567,10 @@ ifndef CONFIG_CC_STACKPROTECTOR
KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
endif
endif


# This warning generated too much noise in a regular build.
# Use make W=1 to enable this warning (see scripts/Makefile.build)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable)

ifdef CONFIG_FRAME_POINTER
ifdef CONFIG_FRAME_POINTER
KBUILD_CFLAGS	+= -fno-omit-frame-pointer -fno-optimize-sibling-calls
KBUILD_CFLAGS	+= -fno-omit-frame-pointer -fno-optimize-sibling-calls
else
else
@@ -604,7 +616,7 @@ CHECKFLAGS += $(NOSTDINC_FLAGS)
KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)


# disable pointer signed / unsigned warnings in gcc 4.0
# disable pointer signed / unsigned warnings in gcc 4.0
KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-sign)


# disable invalid "can't wrap" optimizations for signed / pointers
# disable invalid "can't wrap" optimizations for signed / pointers
KBUILD_CFLAGS	+= $(call cc-option,-fno-strict-overflow)
KBUILD_CFLAGS	+= $(call cc-option,-fno-strict-overflow)
@@ -612,6 +624,9 @@ KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
# conserve stack if available
# conserve stack if available
KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)


# use the deterministic mode of AR if available
KBUILD_ARFLAGS := $(call ar-option,D)

# check for 'asm goto'
# check for 'asm goto'
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y)
ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC)), y)
	KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
	KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO
@@ -797,15 +812,17 @@ ifdef CONFIG_KALLSYMS
# o The correct .tmp_kallsyms2.o is linked into the final vmlinux.
# o The correct .tmp_kallsyms2.o is linked into the final vmlinux.
# o Verify that the System.map from vmlinux matches the map from
# o Verify that the System.map from vmlinux matches the map from
#   .tmp_vmlinux2, just in case we did not generate kallsyms correctly.
#   .tmp_vmlinux2, just in case we did not generate kallsyms correctly.
# o If CONFIG_KALLSYMS_EXTRA_PASS is set, do an extra pass using
# o If 'make KALLSYMS_EXTRA_PASS=1" was used, do an extra pass using
#   .tmp_vmlinux3 and .tmp_kallsyms3.o.  This is only meant as a
#   .tmp_vmlinux3 and .tmp_kallsyms3.o.  This is only meant as a
#   temporary bypass to allow the kernel to be built while the
#   temporary bypass to allow the kernel to be built while the
#   maintainers work out what went wrong with kallsyms.
#   maintainers work out what went wrong with kallsyms.


ifdef CONFIG_KALLSYMS_EXTRA_PASS
last_kallsyms := 3
else
last_kallsyms := 2
last_kallsyms := 2

ifdef KALLSYMS_EXTRA_PASS
ifneq ($(KALLSYMS_EXTRA_PASS),0)
last_kallsyms := 3
endif
endif
endif


kallsyms.o := .tmp_kallsyms$(last_kallsyms).o
kallsyms.o := .tmp_kallsyms$(last_kallsyms).o
@@ -816,7 +833,8 @@ define verify_kallsyms
	  $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map
	  $(cmd_sysmap) .tmp_vmlinux$(last_kallsyms) .tmp_System.map
	$(Q)cmp -s System.map .tmp_System.map ||                             \
	$(Q)cmp -s System.map .tmp_System.map ||                             \
		(echo Inconsistent kallsyms data;                            \
		(echo Inconsistent kallsyms data;                            \
		 echo Try setting CONFIG_KALLSYMS_EXTRA_PASS;                \
		 echo This is a bug - please report about it;                \
		 echo Try "make KALLSYMS_EXTRA_PASS=1" as a workaround;      \
		 rm .tmp_kallsyms* ; /bin/false )
		 rm .tmp_kallsyms* ; /bin/false )
endef
endef


@@ -947,7 +965,7 @@ ifneq ($(KBUILD_SRC),)
endif
endif


# prepare2 creates a makefile if using a separate output directory
# prepare2 creates a makefile if using a separate output directory
prepare2: prepare3 outputmakefile
prepare2: prepare3 outputmakefile asm-generic


prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
prepare1: prepare2 include/linux/version.h include/generated/utsrelease.h \
                   include/config/auto.conf
                   include/config/auto.conf
@@ -1021,7 +1039,7 @@ hdr-inst := -rR -f $(srctree)/scripts/Makefile.headersinst obj
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)
hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm)


PHONY += __headers
PHONY += __headers
__headers: include/linux/version.h scripts_basic FORCE
__headers: include/linux/version.h scripts_basic asm-generic FORCE
	$(Q)$(MAKE) $(build)=scripts build_unifdef
	$(Q)$(MAKE) $(build)=scripts build_unifdef


PHONY += headers_install_all
PHONY += headers_install_all
@@ -1136,7 +1154,8 @@ CLEAN_FILES += vmlinux System.map \
                .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map
                .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map


# Directories & files removed with 'make mrproper'
# Directories & files removed with 'make mrproper'
MRPROPER_DIRS  += include/config usr/include include/generated
MRPROPER_DIRS  += include/config usr/include include/generated          \
                  arch/*/include/generated
MRPROPER_FILES += .config .config.old .version .old_version             \
MRPROPER_FILES += .config .config.old .version .old_version             \
                  include/linux/version.h                               \
                  include/linux/version.h                               \
		  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
		  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
@@ -1267,7 +1286,11 @@ help:
	@echo  '  make O=dir [targets] Locate all output files in "dir", including .config'
	@echo  '  make O=dir [targets] Locate all output files in "dir", including .config'
	@echo  '  make C=1   [targets] Check all c source with $$CHECK (sparse by default)'
	@echo  '  make C=1   [targets] Check all c source with $$CHECK (sparse by default)'
	@echo  '  make C=2   [targets] Force check of all c source with $$CHECK'
	@echo  '  make C=2   [targets] Force check of all c source with $$CHECK'
	@echo  '  make W=1   [targets] Enable extra gcc checks'
	@echo  '  make W=n   [targets] Enable extra gcc checks, n=1,2,3 where'
	@echo  '		1: warnings which may be relevant and do not occur too often'
	@echo  '		2: warnings which occur quite often but may still be relevant'
	@echo  '		3: more obscure warnings, can most likely be ignored'
	@echo  '		Multiple levels can be combined with W=12 or W=123'
	@echo  '  make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'
	@echo  '  make RECORDMCOUNT_WARN=1 [targets] Warn about ignored mcount sections'
	@echo  ''
	@echo  ''
	@echo  'Execute "make" or "make all" to build all targets marked with [*] '
	@echo  'Execute "make" or "make all" to build all targets marked with [*] '
@@ -1291,6 +1314,7 @@ $(help-board-dirs): help-%:
# Documentation targets
# Documentation targets
# ---------------------------------------------------------------------------
# ---------------------------------------------------------------------------
%docs: scripts_basic FORCE
%docs: scripts_basic FORCE
	$(Q)$(MAKE) $(build)=scripts build_docproc
	$(Q)$(MAKE) $(build)=Documentation/DocBook $@
	$(Q)$(MAKE) $(build)=Documentation/DocBook $@


else # KBUILD_EXTMOD
else # KBUILD_EXTMOD
@@ -1375,7 +1399,7 @@ endif # KBUILD_EXTMOD
clean: $(clean-dirs)
clean: $(clean-dirs)
	$(call cmd,rmdirs)
	$(call cmd,rmdirs)
	$(call cmd,rmfiles)
	$(call cmd,rmfiles)
	@find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
	@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
		\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
		\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
		-o -name '*.symtypes' -o -name 'modules.order' \
		-o -name '*.symtypes' -o -name 'modules.order' \
Loading