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

Commit f7ce1f5e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild:
  kbuild: fix depmod comment
  kbuild: Add new Kbuild variable KBUILD_EXTRA_SYMBOLS
  kbuild: support loading extra symbols in modpost
  Add option to enable -Wframe-larger-than= on gcc 4.4
  kbuild: add kconfig symbols to tags output
  kbuild: fix some minor typoes
  kbuild: error out on missing MODULE_LICENSE
parents dd0e101d 0254da07
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -486,7 +486,7 @@ Module.symvers contains a list of all exported symbols from a kernel build.
	Sometimes, an external module uses exported symbols from another
	Sometimes, an external module uses exported symbols from another
	external module. Kbuild needs to have full knowledge on all symbols
	external module. Kbuild needs to have full knowledge on all symbols
	to avoid spitting out warnings about undefined symbols.
	to avoid spitting out warnings about undefined symbols.
	Two solutions exist to let kbuild know all symbols of more than
	Three solutions exist to let kbuild know all symbols of more than
	one external module.
	one external module.
	The method with a top-level kbuild file is recommended but may be
	The method with a top-level kbuild file is recommended but may be
	impractical in certain situations.
	impractical in certain situations.
@@ -523,6 +523,13 @@ Module.symvers contains a list of all exported symbols from a kernel build.
		containing the sum of all symbols defined and not part of the
		containing the sum of all symbols defined and not part of the
		kernel.
		kernel.


	Use make variable KBUILD_EXTRA_SYMBOLS in the Makefile
		If it is impractical to copy Module.symvers from another
		module, you can assign a space separated list of files to
		KBUILD_EXTRA_SYMBOLS in your Makfile. These files will be
		loaded by modpost during the initialisation of its symbol
		tables.

=== 8. Tips & Tricks
=== 8. Tips & Tricks


--- 8.1 Testing for CONFIG_FOO_BAR
--- 8.1 Testing for CONFIG_FOO_BAR
+6 −3
Original line number Original line Diff line number Diff line
@@ -507,6 +507,10 @@ else
KBUILD_CFLAGS	+= -O2
KBUILD_CFLAGS	+= -O2
endif
endif


ifneq (CONFIG_FRAME_WARN,0)
KBUILD_CFLAGS += $(call cc-option,-Wframe-larger-than=${CONFIG_FRAME_WARN})
endif

# Force gcc to behave correct even for buggy distributions
# Force gcc to behave correct even for buggy distributions
# Arch Makefiles may override this setting
# Arch Makefiles may override this setting
KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
KBUILD_CFLAGS += $(call cc-option, -fno-stack-protector)
@@ -1396,7 +1400,7 @@ define xtags
	    $(all-kconfigs) | xargs $1 -a \
	    $(all-kconfigs) | xargs $1 -a \
		--langdef=kconfig \
		--langdef=kconfig \
		--language-force=kconfig \
		--language-force=kconfig \
		--regex-kconfig='/^[[:blank:]]*config[[:blank:]]+([[:alnum:]_]+)/\1/'; \
		--regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/\2/'; \
	    $(all-defconfigs) | xargs -r $1 -a \
	    $(all-defconfigs) | xargs -r $1 -a \
		--langdef=dotconfig \
		--langdef=dotconfig \
		--language-force=dotconfig \
		--language-force=dotconfig \
@@ -1404,7 +1408,7 @@ define xtags
	elif $1 --version 2>&1 | grep -iq emacs; then \
	elif $1 --version 2>&1 | grep -iq emacs; then \
	    $(all-sources) | xargs $1 -a; \
	    $(all-sources) | xargs $1 -a; \
	    $(all-kconfigs) | xargs $1 -a \
	    $(all-kconfigs) | xargs $1 -a \
		--regex='/^[ \t]*config[ \t]+\([a-zA-Z0-9_]+\)/\1/'; \
		--regex='/^[ \t]*(menu|)config[ \t]+\([a-zA-Z0-9_]+\)/\2/'; \
	    $(all-defconfigs) | xargs -r $1 -a \
	    $(all-defconfigs) | xargs -r $1 -a \
		--regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
		--regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/'; \
	else \
	else \
@@ -1539,7 +1543,6 @@ quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))
      cmd_rmfiles = rm -f $(rm-files)
      cmd_rmfiles = rm -f $(rm-files)


# Run depmod only if we have System.map and depmod is executable
# Run depmod only if we have System.map and depmod is executable
# and we build for the host arch
quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
quiet_cmd_depmod = DEPMOD  $(KERNELRELEASE)
      cmd_depmod = \
      cmd_depmod = \
	if [ -r System.map -a -x $(DEPMOD) ]; then                              \
	if [ -r System.map -a -x $(DEPMOD) ]; then                              \
+11 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,17 @@ config ENABLE_MUST_CHECK
	  suppress the "warning: ignoring return value of 'foo', declared with
	  suppress the "warning: ignoring return value of 'foo', declared with
	  attribute warn_unused_result" messages.
	  attribute warn_unused_result" messages.


config FRAME_WARN
	int "Warn for stack frames larger than (needs gcc 4.4)"
	range 0 8192
	default 1024 if !64BIT
	default 2048 if 64BIT
	help
	  Tell gcc to warn at build time for stack frames larger than this.
	  Setting this too low will cause a lot of warnings.
	  Setting it to 0 disables the warning.
	  Requires gcc 4.4

config MAGIC_SYSRQ
config MAGIC_SYSRQ
	bool "Magic SysRq key"
	bool "Magic SysRq key"
	depends on !UML
	depends on !UML
+3 −3
Original line number Original line Diff line number Diff line
@@ -27,12 +27,12 @@ ccflags-y :=
cppflags-y :=
cppflags-y :=
ldflags-y  :=
ldflags-y  :=


# Read .config if it exist, otherwise ignore
# Read auto.conf if it exists, otherwise ignore
-include include/config/auto.conf
-include include/config/auto.conf


include scripts/Kbuild.include
include scripts/Kbuild.include


# For backward compatibility check that these variables does not change
# For backward compatibility check that these variables do not change
save-cflags := $(CFLAGS)
save-cflags := $(CFLAGS)


# The filename Kbuild has precedence over Makefile
# The filename Kbuild has precedence over Makefile
@@ -55,7 +55,7 @@ hostprogs-y += $(host-progs)
endif
endif
endif
endif


# Do not include host rules unles needed
# Do not include host rules unless needed
ifneq ($(hostprogs-y)$(hostprogs-m),)
ifneq ($(hostprogs-y)$(hostprogs-m),)
include scripts/Makefile.host
include scripts/Makefile.host
endif
endif
+1 −1
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@ subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-))


subdir-ymn	:= $(addprefix $(obj)/,$(subdir-ymn))
subdir-ymn	:= $(addprefix $(obj)/,$(subdir-ymn))


# build a list of files to remove, usually releative to the current
# build a list of files to remove, usually relative to the current
# directory
# directory


__clean-files	:= $(extra-y) $(always)                  \
__clean-files	:= $(extra-y) $(always)                  \
Loading