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

Commit 3b7b3e6e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull kbuild updates from Michal Marek:
 - make clean also considers $(extra-m) and $(extra-) to be consistent
 - cleanup and fixes in scripts/Makefile.host
 - allow to override the name of the Python 2 executable with make
   PYTHON=... (only needed for ia64 in practice)
 - option to split debugingo into *.dwo files to save disk space if the
   compiler supports it (CONFIG_DEBUG_INFO_SPLIT)
 - option to use dwarf4 debuginfo if the compiler supports it
   (CONFIG_DEBUG_INFO_DWARF4)
 - fix for disabling certain warnings with clang
 - fix for unneeded rebuild with dash when a command contains
   backslashes

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kbuild: Fix handling of backslashes in *.cmd files
  kbuild, LLVMLinux: Supress warnings unless W=1-3
  Kbuild: Add a option to enable dwarf4 v2
  kbuild: Support split debug info v4
  kbuild: allow to override Python command name
  kbuild: clean-up and bug fix of scripts/Makefile.host
  kbuild: clean up scripts/Makefile.host
  kbuild: drop shared library support from Makefile.host
  kbuild: fix a bug of C++ host program handling
  kbuild: fix a typo in scripts/Makefile.host
  scripts/Makefile.clean: clean also $(extra-m) and $(extra-)
parents e3b1fd56 164f0d2e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
*.gcno
modules.builtin
Module.symvers
*.dwo

#
# Top-level generic files
+8 −31
Original line number Diff line number Diff line
@@ -23,11 +23,10 @@ This document describes the Linux kernel Makefiles.
	=== 4 Host Program support
	   --- 4.1 Simple Host Program
	   --- 4.2 Composite Host Programs
	   --- 4.3 Defining shared libraries
	   --- 4.4 Using C++ for host programs
	   --- 4.5 Controlling compiler options for host programs
	   --- 4.6 When host programs are actually built
	   --- 4.7 Using hostprogs-$(CONFIG_FOO)
	   --- 4.3 Using C++ for host programs
	   --- 4.4 Controlling compiler options for host programs
	   --- 4.5 When host programs are actually built
	   --- 4.6 Using hostprogs-$(CONFIG_FOO)

	=== 5 Kbuild clean infrastructure

@@ -643,29 +642,7 @@ Both possibilities are described in the following.
	Finally, the two .o files are linked to the executable, lxdialog.
	Note: The syntax <executable>-y is not permitted for host-programs.

--- 4.3 Defining shared libraries

	Objects with extension .so are considered shared libraries, and
	will be compiled as position independent objects.
	Kbuild provides support for shared libraries, but the usage
	shall be restricted.
	In the following example the libkconfig.so shared library is used
	to link the executable conf.

	Example:
		#scripts/kconfig/Makefile
		hostprogs-y     := conf
		conf-objs       := conf.o libkconfig.so
		libkconfig-objs := expr.o type.o

	Shared libraries always require a corresponding -objs line, and
	in the example above the shared library libkconfig is composed by
	the two objects expr.o and type.o.
	expr.o and type.o will be built as position independent code and
	linked as a shared library libkconfig.so. C++ is not supported for
	shared libraries.

--- 4.4 Using C++ for host programs
--- 4.3 Using C++ for host programs

	kbuild offers support for host programs written in C++. This was
	introduced solely to support kconfig, and is not recommended
@@ -688,7 +665,7 @@ Both possibilities are described in the following.
		qconf-cxxobjs := qconf.o
		qconf-objs    := check.o

--- 4.5 Controlling compiler options for host programs
--- 4.4 Controlling compiler options for host programs

	When compiling host programs, it is possible to set specific flags.
	The programs will always be compiled utilising $(HOSTCC) passed
@@ -716,7 +693,7 @@ Both possibilities are described in the following.
	When linking qconf, it will be passed the extra option
	"-L$(QTDIR)/lib".

--- 4.6 When host programs are actually built
--- 4.5 When host programs are actually built

	Kbuild will only build host-programs when they are referenced
	as a prerequisite.
@@ -747,7 +724,7 @@ Both possibilities are described in the following.
	This will tell kbuild to build lxdialog even if not referenced in
	any rule.

--- 4.7 Using hostprogs-$(CONFIG_FOO)
--- 4.6 Using hostprogs-$(CONFIG_FOO)

	A typical pattern in a Kbuild file looks like this:

+11 −1
Original line number Diff line number Diff line
@@ -372,6 +372,7 @@ GENKSYMS = scripts/genksyms/genksyms
INSTALLKERNEL  := installkernel
DEPMOD		= /sbin/depmod
PERL		= perl
PYTHON		= python
CHECK		= sparse

CHECKFLAGS     := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
@@ -422,7 +423,7 @@ KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(S
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC
export CPP AR NM STRIP OBJCOPY OBJDUMP
export MAKE AWK GENKSYMS INSTALLKERNEL PERL UTS_MACHINE
export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE
export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS

export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS
@@ -687,6 +688,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
# source of a reference will be _MergedGlobals and not on of the whitelisted names.
# See modpost pattern 2
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
else

# This warning generated too much noise in a regular build.
@@ -710,9 +712,16 @@ endif
KBUILD_CFLAGS   += $(call cc-option, -fno-var-tracking-assignments)

ifdef CONFIG_DEBUG_INFO
ifdef CONFIG_DEBUG_INFO_SPLIT
KBUILD_CFLAGS   += $(call cc-option, -gsplit-dwarf, -g)
else
KBUILD_CFLAGS	+= -g
endif
KBUILD_AFLAGS	+= -Wa,-gdwarf-2
endif
ifdef CONFIG_DEBUG_INFO_DWARF4
KBUILD_CFLAGS	+= $(call cc-option, -gdwarf-4,)
endif

ifdef CONFIG_DEBUG_INFO_REDUCED
KBUILD_CFLAGS 	+= $(call cc-option, -femit-struct-debug-baseonly) \
@@ -1398,6 +1407,7 @@ clean: $(clean-dirs)
	@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
		\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
		-o -name '*.ko.*' \
		-o -name '*.dwo'  \
		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
		-o -name '*.symtypes' -o -name 'modules.order' \
		-o -name modules.builtin -o -name '.tmp_*.o.*' \
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ vmlinux.gz: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $@

unwcheck: vmlinux
	-$(Q)READELF=$(READELF) python $(srctree)/arch/ia64/scripts/unwcheck.py $<
	-$(Q)READELF=$(READELF) $(PYTHON) $(srctree)/arch/ia64/scripts/unwcheck.py $<

archclean:
	$(Q)$(MAKE) $(clean)=$(boot)
+24 −0
Original line number Diff line number Diff line
@@ -143,6 +143,30 @@ config DEBUG_INFO_REDUCED
	  DEBUG_INFO build and compile times are reduced too.
	  Only works with newer gcc versions.

config DEBUG_INFO_SPLIT
	bool "Produce split debuginfo in .dwo files"
	depends on DEBUG_INFO
	help
	  Generate debug info into separate .dwo files. This significantly
	  reduces the build directory size for builds with DEBUG_INFO,
	  because it stores the information only once on disk in .dwo
	  files instead of multiple times in object files and executables.
	  In addition the debug information is also compressed.

	  Requires recent gcc (4.7+) and recent gdb/binutils.
	  Any tool that packages or reads debug information would need
	  to know about the .dwo files and include them.
	  Incompatible with older versions of ccache.

config DEBUG_INFO_DWARF4
	bool "Generate dwarf4 debuginfo"
	depends on DEBUG_INFO
	help
	  Generate dwarf4 debug info. This requires recent versions
	  of gcc and gdb. It makes the debug information larger.
	  But it significantly improves the success of resolving
	  variables in gdb on optimized code.

config ENABLE_WARN_DEPRECATED
	bool "Enable __deprecated logic"
	default y
Loading