]> Git Repo - linux.git/commitdiff
Merge tag 'kbuild-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
authorLinus Torvalds <[email protected]>
Mon, 11 Mar 2019 00:48:21 +0000 (17:48 -0700)
committerLinus Torvalds <[email protected]>
Mon, 11 Mar 2019 00:48:21 +0000 (17:48 -0700)
Pull Kbuild updates from Masahiro Yamada:

 - do not generate unneeded top-level built-in.a

 - let git ignore O= directory entirely

 - optimize scripts/kallsyms slightly

 - exclude DWARF info from *.s regardless of config options

 - fix GCC toolchain search path for Clang to prepare ld.lld support

 - do not generate modules.order when CONFIG_MODULES is disabled

 - simplify single target rules and remove VPATH for external module
   build

 - allow to add optional flags to dpkg-buildpackage when building
   deb-pkg

 - move some compiler option tests from Makefile to Kconfig

 - various Makefile cleanups

* tag 'kbuild-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (40 commits)
  kbuild: remove scripts/basic/% build target
  kbuild: use -Werror=implicit-... instead of -Werror-implicit-...
  kbuild: clean up scripts/gcc-version.sh
  kbuild: remove cc-version macro
  kbuild: update comment block of scripts/clang-version.sh
  kbuild: remove commented-out INITRD_COMPRESS
  kbuild: move -gsplit-dwarf, -gdwarf-4 option tests to Kconfig
  kbuild: [bin]deb-pkg: add DPKG_FLAGS variable
  kbuild: move ".config not found!" message from Kconfig to Makefile
  kbuild: invoke syncconfig if include/config/auto.conf.cmd is missing
  kbuild: simplify single target rules
  kbuild: remove empty rules for makefiles
  kbuild: make -r/-R effective in top Makefile for old Make versions
  kbuild: move tools_silent to a more relevant place
  kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
  kbuild: refactor cc-cross-prefix implementation
  kbuild: hardcode genksyms path and remove GENKSYMS variable
  scripts/gdb: refactor rules for symlink creation
  kbuild: create symlink to vmlinux-gdb.py in scripts_gdb target
  scripts/gdb: do not descend into scripts/gdb from scripts
  ...

1  2 
Documentation/devicetree/bindings/Makefile
Kbuild
Makefile
arch/x86/realmode/rm/Makefile
init/Kconfig
lib/Kconfig.debug
scripts/kallsyms.c

index 50daa0b3b032fb90001c42025865a5cd48999b65,e4eb5d1ea3b5c5522f22b7525711454766b27f1d..63b139f9ae287c76273bde4500d5add45a620b2b
@@@ -15,13 -15,9 +15,13 @@@ DT_TMP_SCHEMA := processed-schema.yam
  extra-y += $(DT_TMP_SCHEMA)
  
  quiet_cmd_mk_schema = SCHEMA  $@
-       cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(filter-out FORCE, $^)
+       cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(real-prereqs)
  
 -DT_DOCS = $(shell cd $(srctree)/$(src) && find * -name '*.yaml')
 +DT_DOCS = $(shell \
 +      cd $(srctree)/$(src) && \
 +      find * \( -name '*.yaml' ! -name $(DT_TMP_SCHEMA) \) \
 +      )
 +
  DT_SCHEMA_FILES ?= $(addprefix $(src)/,$(DT_DOCS))
  
  extra-y += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))
diff --combined Kbuild
index 4a4c47c38d1d8a725988bda065dd3dc6a6a9b035,a07bbd62f0526aa93f1e67478d73e327b25a6903..8637fd14135f2cb6059c2a6b8d8da93c4c551718
--- 1/Kbuild
--- 2/Kbuild
+++ b/Kbuild
@@@ -1,16 -1,9 +1,9 @@@
  # SPDX-License-Identifier: GPL-2.0
  #
  # Kbuild for top-level directory of the kernel
- # This file takes care of the following:
- # 1) Generate bounds.h
- # 2) Generate timeconst.h
- # 3) Generate asm-offsets.h (may need bounds.h and timeconst.h)
- # 4) Check for missing system calls
- # 5) check atomics headers are up-to-date
- # 6) Generate constants.py (may need bounds.h)
  
  #####
- # 1) Generate bounds.h
+ # Generate bounds.h
  
  bounds-file := include/generated/bounds.h
  
@@@ -21,7 -14,7 +14,7 @@@ $(bounds-file): kernel/bounds.s FORC
        $(call filechk,offsets,__LINUX_BOUNDS_H__)
  
  #####
- # 2) Generate timeconst.h
+ # Generate timeconst.h
  
  timeconst-file := include/generated/timeconst.h
  
@@@ -33,8 -26,7 +26,7 @@@ $(timeconst-file): kernel/time/timecons
        $(call filechk,gentimeconst)
  
  #####
- # 3) Generate asm-offsets.h
- #
+ # Generate asm-offsets.h
  
  offsets-file := include/generated/asm-offsets.h
  
@@@ -47,8 -39,7 +39,7 @@@ $(offsets-file): arch/$(SRCARCH)/kernel
        $(call filechk,offsets,__ASM_OFFSETS_H__)
  
  #####
- # 4) Check for missing system calls
- #
+ # Check for missing system calls
  
  always += missing-syscalls
  targets += missing-syscalls
@@@ -59,27 -50,5 +50,17 @@@ quiet_cmd_syscalls = CALL    $
  missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
        $(call cmd,syscalls)
  
- # 5) Check atomic headers are up-to-date
- #
 +#####
- #####
- # 6) Generate constants for Python GDB integration
- #
- extra-$(CONFIG_GDB_SCRIPTS) += build_constants_py
- build_constants_py: $(timeconst-file) $(bounds-file)
-       @$(MAKE) $(build)=scripts/gdb/linux $@
++# Check atomic headers are up-to-date
 +
 +always += old-atomics
 +targets += old-atomics
 +
 +quiet_cmd_atomics = CALL    $<
 +      cmd_atomics = $(CONFIG_SHELL) $<
 +
 +old-atomics: scripts/atomic/check-atomics.sh FORCE
 +      $(call cmd,atomics)
 +
  # Keep these three files during make clean
  no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file)
diff --combined Makefile
index f070e0d65186ee2cdd79dbea90f60e95b5b22eae,cfb49aa41eff9515b76ba4280856ce140c2211bf..9ef547fc7ffe970058735c8a95687454f05eda59
+++ b/Makefile
@@@ -2,7 -2,7 +2,7 @@@
  VERSION = 5
  PATCHLEVEL = 0
  SUBLEVEL = 0
 -EXTRAVERSION = -rc4
 +EXTRAVERSION =
  NAME = Shy Crocodile
  
  # *DOCUMENTATION*
  PHONY := _all
  _all:
  
- # Do not use make's built-in rules and variables
- # (this increases performance and avoids hard-to-debug behaviour)
- MAKEFLAGS += -rR
- # Avoid funny character set dependencies
- unexport LC_ALL
- LC_COLLATE=C
- LC_NUMERIC=C
- export LC_COLLATE LC_NUMERIC
- # Avoid interference with shell env settings
- unexport GREP_OPTIONS
  # We are using a recursive build, so we need to do a little thinking
  # to get the ordering right.
  #
  # descending is started. They are now explicitly listed as the
  # prepare rule.
  
+ ifneq ($(sub-make-done),1)
+ # Do not use make's built-in rules and variables
+ # (this increases performance and avoids hard-to-debug behaviour)
+ MAKEFLAGS += -rR
+ # 'MAKEFLAGS += -rR' does not become immediately effective for old
+ # GNU Make versions. Cancel implicit rules for this Makefile.
+ $(lastword $(MAKEFILE_LIST)): ;
+ # Avoid funny character set dependencies
+ unexport LC_ALL
+ LC_COLLATE=C
+ LC_NUMERIC=C
+ export LC_COLLATE LC_NUMERIC
+ # Avoid interference with shell env settings
+ unexport GREP_OPTIONS
  # Beautify output
  # ---------------------------------------------------------------------------
  #
@@@ -90,7 -96,6 +96,6 @@@ endi
  
  ifneq ($(findstring s,$(filter-out --%,$(MAKEFLAGS))),)
    quiet=silent_
-   tools_silent=s
  endif
  
  export quiet Q KBUILD_VERBOSE
  
  # KBUILD_SRC is not intended to be used by the regular user (for now),
  # it is set on invocation of make with KBUILD_OUTPUT or O= specified.
- ifeq ($(KBUILD_SRC),)
  
  # OK, Make called in directory where kernel src resides
  # Do we want to locate output files in a separate directory?
@@@ -120,9 -124,6 +124,6 @@@ ifeq ("$(origin O)", "command line"
    KBUILD_OUTPUT := $(O)
  endif
  
- # Cancel implicit rules on top Makefile
- $(CURDIR)/Makefile Makefile: ;
  ifneq ($(words $(subst :, ,$(CURDIR))), 1)
    $(error main directory cannot contain spaces nor colons)
  endif
@@@ -142,6 -143,13 +143,13 @@@ $(if $(KBUILD_OUTPUT),, 
  # 'sub-make' below.
  MAKEFLAGS += --include-dir=$(CURDIR)
  
+ else
+ # Do not print "Entering directory ..." at all for in-tree build.
+ MAKEFLAGS += --no-print-directory
+ endif # ifneq ($(KBUILD_OUTPUT),)
  PHONY += $(MAKECMDGOALS) sub-make
  
  $(filter-out _all sub-make $(CURDIR)/Makefile, $(MAKECMDGOALS)) _all: sub-make
  
  # Invoke a second make in the output directory, passing relevant variables
  sub-make:
-       $(Q)$(MAKE) -C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR) \
+       $(Q)$(MAKE) sub-make-done=1 \
+       $(if $(KBUILD_OUTPUT),-C $(KBUILD_OUTPUT) KBUILD_SRC=$(CURDIR)) \
        -f $(CURDIR)/Makefile $(filter-out _all sub-make,$(MAKECMDGOALS))
  
- # Leave processing to above invocation of make
- skip-makefile := 1
- endif # ifneq ($(KBUILD_OUTPUT),)
- endif # ifeq ($(KBUILD_SRC),)
+ else # sub-make-done
  # We process the rest of the Makefile if this is the final invocation of make
- ifeq ($(skip-makefile),)
  
  # Do not print "Entering directory ...",
  # but we want to display it when entering to the output directory
@@@ -215,7 -219,7 +219,7 @@@ objtree            := 
  src           := $(srctree)
  obj           := $(objtree)
  
- VPATH         := $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
+ VPATH         := $(srctree)
  
  export srctree objtree VPATH
  
@@@ -300,8 -304,6 +304,6 @@@ __build_one_by_one
  
  else
  
- # We need some generic definitions (do not try to remake the file).
- scripts/Kbuild.include: ;
  include scripts/Kbuild.include
  
  # Read KERNELRELEASE from include/config/kernel.release (if it exists)
@@@ -390,7 -392,6 +392,6 @@@ OBJDUMP            = $(CROSS_COMPILE)objdum
  LEX           = flex
  YACC          = bison
  AWK           = awk
- GENKSYMS      = scripts/genksyms/genksyms
  INSTALLKERNEL  := installkernel
  DEPMOD                = /sbin/depmod
  PERL          = perl
@@@ -429,7 -430,7 +430,7 @@@ LINUXINCLUDE    := 
  KBUILD_AFLAGS   := -D__ASSEMBLY__ -fno-PIE
  KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
                   -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
-                  -Werror-implicit-function-declaration -Werror=implicit-int \
+                  -Werror=implicit-function-declaration -Werror=implicit-int \
                   -Wno-format-security \
                   -std=gnu89
  KBUILD_CPPFLAGS := -D__KERNEL__
@@@ -443,7 -444,7 +444,7 @@@ GCC_PLUGINS_CFLAGS :
  
  export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
  export CPP AR NM STRIP OBJCOPY OBJDUMP KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS
- export MAKE LEX YACC AWK GENKSYMS INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
+ export MAKE LEX YACC AWK INSTALLKERNEL PERL PYTHON PYTHON2 PYTHON3 UTS_MACHINE
  export HOSTCXX KBUILD_HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS
  
  export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
@@@ -476,23 -477,23 +477,23 @@@ scripts_basic
        $(Q)$(MAKE) $(build)=scripts/basic
        $(Q)rm -f .tmp_quiet_recordmcount
  
- # To avoid any implicit rule to kick in, define an empty command.
- scripts/basic/%: scripts_basic ;
  PHONY += outputmakefile
  # outputmakefile generates a Makefile in the output directory, if using a
  # separate output directory. This allows convenient use of make in the
  # output directory.
+ # At the same time when output Makefile generated, generate .gitignore to
+ # ignore whole output directory
  outputmakefile:
  ifneq ($(KBUILD_SRC),)
        $(Q)ln -fsn $(srctree) source
        $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
+       $(Q){ echo "# this is build directory, ignore it"; echo "*"; } > .gitignore
  endif
  
  ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),)
  ifneq ($(CROSS_COMPILE),)
  CLANG_FLAGS   := --target=$(notdir $(CROSS_COMPILE:%-=%))
- GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))
+ GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
  CLANG_FLAGS   += --prefix=$(GCC_TOOLCHAIN_DIR)
  GCC_TOOLCHAIN := $(realpath $(GCC_TOOLCHAIN_DIR)/..)
  endif
@@@ -583,7 -584,7 +584,7 @@@ export KBUILD_MODULES KBUILD_BUILTI
  ifeq ($(KBUILD_EXTMOD),)
  # Objects we will link into vmlinux / subdirs we need to visit
  init-y                := init/
 -drivers-y     := drivers/ sound/ firmware/
 +drivers-y     := drivers/ sound/
  net-y         := net/
  libs-y                := lib/
  core-y                := usr/
@@@ -624,13 -625,22 +625,22 @@@ ifeq ($(may-sync-config),1
  # because some architectures define CROSS_COMPILE there.
  -include include/config/auto.conf.cmd
  
- # To avoid any implicit rule to kick in, define an empty command
- $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
+ $(KCONFIG_CONFIG):
+       @echo >&2 '***'
+       @echo >&2 '*** Configuration file "$@" not found!'
+       @echo >&2 '***'
+       @echo >&2 '*** Please run some configurator (e.g. "make oldconfig" or'
+       @echo >&2 '*** "make menuconfig" or "make xconfig").'
+       @echo >&2 '***'
+       @/bin/false
  
  # The actual configuration files used during the build are stored in
  # include/generated/ and include/config/. Update them if .config is newer than
  # include/config/auto.conf (which mirrors .config).
- include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
+ #
+ # This exploits the 'multi-target pattern rule' trick.
+ # The syncconfig should be executed only once to make all the targets.
+ %/auto.conf %/auto.conf.cmd %/tristate.conf: $(KCONFIG_CONFIG)
        $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
  else
  # External modules and some install targets need include/generated/autoconf.h
@@@ -658,17 -668,13 +668,13 @@@ KBUILD_CFLAGS   += $(call cc-disable-warn
  
  ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
  KBUILD_CFLAGS += $(call cc-option,-Oz,-Os)
- KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,)
- else
- ifdef CONFIG_PROFILE_ALL_BRANCHES
- KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)
  else
  KBUILD_CFLAGS   += -O2
  endif
- endif
  
- KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \
-                       $(call cc-disable-warning,maybe-uninitialized,))
+ ifdef CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED
+ KBUILD_CFLAGS   += -Wno-maybe-uninitialized
+ endif
  
  # Tell gcc to never replace conditional load with a non-conditional one
  KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
@@@ -729,25 -735,28 +735,28 @@@ KBUILD_CFLAGS   += -fomit-frame-pointe
  endif
  endif
  
KBUILD_CFLAGS   += $(call cc-option, -fno-var-tracking-assignments)
DEBUG_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)
+ DEBUG_CFLAGS  += -gsplit-dwarf
  else
KBUILD_CFLAGS += -g
DEBUG_CFLAGS  += -g
  endif
  KBUILD_AFLAGS += -Wa,-gdwarf-2
  endif
  ifdef CONFIG_DEBUG_INFO_DWARF4
- KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,)
+ DEBUG_CFLAGS  += -gdwarf-4
  endif
  
  ifdef CONFIG_DEBUG_INFO_REDUCED
KBUILD_CFLAGS         += $(call cc-option, -femit-struct-debug-baseonly) \
DEBUG_CFLAGS  += $(call cc-option, -femit-struct-debug-baseonly) \
                   $(call cc-option,-fno-var-tracking)
  endif
  
+ KBUILD_CFLAGS += $(DEBUG_CFLAGS)
+ export DEBUG_CFLAGS
  ifdef CONFIG_FUNCTION_TRACER
  ifdef CONFIG_FTRACE_MCOUNT_RECORD
    # gcc 5 supports generating the mcount tables directly
@@@ -922,19 -931,6 +931,6 @@@ ifdef CONFIG_MODULE_COMPRES
  endif # CONFIG_MODULE_COMPRESS
  export mod_compress_cmd
  
- # Select initial ramdisk compression format, default is gzip(1).
- # This shall be used by the dracut(8) tool while creating an initramfs image.
- #
- INITRD_COMPRESS-y                  := gzip
- INITRD_COMPRESS-$(CONFIG_RD_BZIP2) := bzip2
- INITRD_COMPRESS-$(CONFIG_RD_LZMA)  := lzma
- INITRD_COMPRESS-$(CONFIG_RD_XZ)    := xz
- INITRD_COMPRESS-$(CONFIG_RD_LZO)   := lzo
- INITRD_COMPRESS-$(CONFIG_RD_LZ4)   := lz4
- # do not export INITRD_COMPRESS, since we didn't actually
- # choose a sane default compression above.
- # export INITRD_COMPRESS := $(INITRD_COMPRESS-y)
  ifdef CONFIG_MODULE_SIG_ALL
  $(eval $(call config_filename,MODULE_SIG_KEY))
  
@@@ -976,15 -972,15 +972,15 @@@ libs-y2         := $(patsubst %/, %/built-in.a
  virt-y                := $(patsubst %/, %/built-in.a, $(virt-y))
  
  # Externally visible symbols (used by link-vmlinux.sh)
- export KBUILD_VMLINUX_INIT := $(head-y) $(init-y)
export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y2) $(drivers-y) $(net-y) $(virt-y)
+ export KBUILD_VMLINUX_OBJS := $(head-y) $(init-y) $(core-y) $(libs-y2) \
                            $(drivers-y) $(net-y) $(virt-y)
  export KBUILD_VMLINUX_LIBS := $(libs-y1)
  export KBUILD_LDS          := arch/$(SRCARCH)/kernel/vmlinux.lds
  export LDFLAGS_vmlinux
  # used by scripts/package/Makefile
  export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Documentation include samples scripts tools)
  
- vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_INIT) $(KBUILD_VMLINUX_MAIN) $(KBUILD_VMLINUX_LIBS)
+ vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)
  
  # Recurse until adjust_autoksyms.sh is satisfied
  PHONY += autoksyms_recursive
@@@ -1015,9 -1011,6 +1011,6 @@@ cmd_link-vmlinux 
        $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
  
  vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
- ifdef CONFIG_GDB_SCRIPTS
-       $(Q)ln -fsn $(abspath $(srctree)/scripts/gdb/vmlinux-gdb.py)
- endif
        +$(call if_changed,link-vmlinux)
  
  targets := vmlinux
@@@ -1062,7 -1055,7 +1055,7 @@@ scripts: scripts_basic scripts_dt
  # archprepare is used in arch Makefiles and when processed asm symlink,
  # version.h and scripts_basic is processed / created.
  
- PHONY += prepare archprepare prepare1 prepare2 prepare3
+ PHONY += prepare archprepare prepare1 prepare3
  
  # prepare3 is used to check if we are building in a separate output directory,
  # and if so do:
@@@ -1077,12 -1070,8 +1070,8 @@@ ifneq ($(KBUILD_SRC),
        fi;
  endif
  
- # prepare2 creates a makefile if using a separate output directory.
- # From this point forward, .config has been reprocessed, so any rules
- # that need to depend on updated CONFIG_* values can be checked here.
- prepare2: prepare3 outputmakefile asm-generic
- prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h
+ prepare1: prepare3 outputmakefile asm-generic $(version_h) $(autoksyms_h) \
+                                               include/generated/utsrelease.h
        $(cmd_crmodverdir)
  
  archprepare: archheaders archscripts prepare1 scripts
@@@ -1517,6 -1506,18 +1506,18 @@@ PHONY += $(DOC_TARGETS
  $(DOC_TARGETS): scripts_basic FORCE
        $(Q)$(MAKE) $(build)=Documentation $@
  
+ # Misc
+ # ---------------------------------------------------------------------------
+ PHONY += scripts_gdb
+ scripts_gdb: prepare
+       $(Q)$(MAKE) $(build)=scripts/gdb
+       $(Q)ln -fsn $(abspath $(srctree)/scripts/gdb/vmlinux-gdb.py)
+ ifdef CONFIG_GDB_SCRIPTS
+ all: scripts_gdb
+ endif
  else # KBUILD_EXTMOD
  
  ###
@@@ -1668,6 -1669,11 +1669,11 @@@ image_name
        @echo $(KBUILD_IMAGE)
  
  # Clear a bunch of variables before executing the submake
+ ifeq ($(quiet),silent_)
+ tools_silent=s
+ endif
  tools/: FORCE
        $(Q)mkdir -p $(objtree)/tools
        $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(src)/tools/
@@@ -1686,45 -1692,32 +1692,32 @@@ tools/%: FORC
  #  target-dir => where to store outputfile
  #  build-dir  => directory in kernel source tree to use
  
- ifeq ($(KBUILD_EXTMOD),)
-         build-dir  = $(patsubst %/,%,$(dir $@))
-         target-dir = $(dir $@)
- else
-         zap-slash=$(filter-out .,$(patsubst %/,%,$(dir $@)))
-         build-dir  = $(KBUILD_EXTMOD)$(if $(zap-slash),/$(zap-slash))
-         target-dir = $(if $(KBUILD_EXTMOD),$(dir $<),$(dir $@))
- endif
- %.s: %.c prepare FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
- %.i: %.c prepare FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
- %.o: %.c prepare FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
- %.lst: %.c prepare FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
- %.s: %.S prepare FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
- %.o: %.S prepare FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
- %.symtypes: %.c prepare FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
- %.ll: %.c prepare FORCE
-       $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@)
+ build-target = $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD)/)$@
+ build-dir = $(patsubst %/,%,$(dir $(build-target)))
+ %.i: prepare FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)
+ %.ll: prepare FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)
+ %.lst: prepare FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)
+ %.o: prepare FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)
+ %.s: prepare FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)
+ %.symtypes: prepare FORCE
+       $(Q)$(MAKE) $(build)=$(build-dir) $(build-target)
+ %.ko: %.o
+       $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
  
  # Modules
- /: prepare FORCE
-       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
-       $(build)=$(build-dir)
+ PHONY += /
+ /: ./
  # Make sure the latest headers are built for Documentation
  Documentation/ samples/: headers_install
  %/: prepare FORCE
-       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
-       $(build)=$(build-dir)
- %.ko: prepare FORCE
-       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
-       $(build)=$(build-dir) $(@:.ko=.o)
-       $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
+       $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir)
  
  # FIXME Should go into a make.lib or something
  # ===========================================================================
@@@ -1748,13 -1741,11 +1741,11 @@@ cmd_crmodverdir = $(Q)mkdir -p $(MODVER
  # read saved command lines for existing targets
  existing-targets := $(wildcard $(sort $(targets)))
  
- cmd_files := $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
- $(cmd_files): ;       # Do not try to update included dependency files
- -include $(cmd_files)
+ -include $(foreach f,$(existing-targets),$(dir $(f)).$(notdir $(f)).cmd)
  
  endif   # ifeq ($(config-targets),1)
  endif   # ifeq ($(mixed-targets),1)
- endif # skip-makefile
+ endif   # sub-make-done
  
  PHONY += FORCE
  FORCE:
index 96cb20de08af8a61836af68bb933f517915f3d1d,394377c9f7f8ee89174b77973105444520644d95..f60501a384f947b32941ad6a146491685161956b
@@@ -37,8 -37,7 +37,7 @@@ REALMODE_OBJS = $(addprefix $(obj)/,$(r
  sed-pasyms := -n -r -e 's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p'
  
  quiet_cmd_pasyms = PASYMS  $@
-       cmd_pasyms = $(NM) $(filter-out FORCE,$^) | \
-                  sed $(sed-pasyms) | sort | uniq > $@
+       cmd_pasyms = $(NM) $(real-prereqs) | sed $(sed-pasyms) | sort | uniq > $@
  
  targets += pasyms.h
  $(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
@@@ -47,7 -46,7 +46,7 @@@
  targets += realmode.lds
  $(obj)/realmode.lds: $(obj)/pasyms.h
  
 -LDFLAGS_realmode.elf := --emit-relocs -T
 +LDFLAGS_realmode.elf := -m elf_i386 --emit-relocs -T
  CPPFLAGS_realmode.lds += -P -C -I$(objtree)/$(obj)
  
  targets += realmode.elf
diff --combined init/Kconfig
index 811641cc81e8dfb5f070d44dab7d9451bbbfc38e,23a21ede2a40dd5ae9cfc2453efa4115f6545453..4592bf7997c000dc7a5537ca4c28b308713b9d65
@@@ -13,7 -13,7 +13,7 @@@ config CC_IS_GC
  
  config GCC_VERSION
        int
-       default $(shell,$(srctree)/scripts/gcc-version.sh -p $(CC) | sed 's/^0*//') if CC_IS_GCC
+       default $(shell,$(srctree)/scripts/gcc-version.sh $(CC)) if CC_IS_GCC
        default 0
  
  config CC_IS_CLANG
@@@ -26,6 -26,22 +26,22 @@@ config CLANG_VERSIO
  config CC_HAS_ASM_GOTO
        def_bool $(success,$(srctree)/scripts/gcc-goto.sh $(CC))
  
+ config CC_HAS_WARN_MAYBE_UNINITIALIZED
+       def_bool $(cc-option,-Wmaybe-uninitialized)
+       help
+         GCC >= 4.7 supports this option.
+ config CC_DISABLE_WARN_MAYBE_UNINITIALIZED
+       bool
+       depends on CC_HAS_WARN_MAYBE_UNINITIALIZED
+       default CC_IS_GCC && GCC_VERSION < 40900  # unreliable for GCC < 4.9
+       help
+         GCC's -Wmaybe-uninitialized is not reliable by definition.
+         Lots of false positive warnings are produced in some cases.
+         If this option is enabled, -Wno-maybe-uninitialzed is passed
+         to the compiler to suppress maybe-uninitialized warnings.
  config CONSTRUCTORS
        bool
        depends on !UML
@@@ -382,7 -398,6 +398,7 @@@ config VIRT_CPU_ACCOUNTING_GE
        bool "Full dynticks CPU time accounting"
        depends on HAVE_CONTEXT_TRACKING
        depends on HAVE_VIRT_CPU_ACCOUNTING_GEN
 +      depends on GENERIC_CLOCKEVENTS
        select VIRT_CPU_ACCOUNTING
        select CONTEXT_TRACKING
        help
@@@ -513,17 -528,6 +529,17 @@@ config PSI_DEFAULT_DISABLE
          per default but can be enabled through passing psi=1 on the
          kernel commandline during boot.
  
 +        This feature adds some code to the task wakeup and sleep
 +        paths of the scheduler. The overhead is too low to affect
 +        common scheduling-intense workloads in practice (such as
 +        webservers, memcache), but it does show up in artificial
 +        scheduler stress tests, such as hackbench.
 +
 +        If you are paranoid and not sure what the kernel will be
 +        used for, say Y.
 +
 +        Say N if unsure.
 +
  endmenu # "CPU/Task time and stats accounting"
  
  config CPU_ISOLATION
@@@ -837,7 -841,7 +853,7 @@@ config CGROUP_PID
          PIDs controller is designed to stop this from happening.
  
          It should be noted that organisational operations (such as attaching
 -        to a cgroup hierarchy will *not* be blocked by the PIDs controller),
 +        to a cgroup hierarchy) will *not* be blocked by the PIDs controller,
          since the PIDs limit only affects a process's ability to fork, not to
          attach to a cgroup.
  
@@@ -1114,6 -1118,7 +1130,7 @@@ config CC_OPTIMIZE_FOR_PERFORMANC
  
  config CC_OPTIMIZE_FOR_SIZE
        bool "Optimize for size"
+       imply CC_DISABLE_WARN_MAYBE_UNINITIALIZED  # avoid false positives
        help
          Enabling this option will pass "-Os" instead of "-O2" to
          your compiler resulting in a smaller kernel.
@@@ -1415,15 -1420,6 +1432,15 @@@ config AI
          by some high performance threaded applications. Disabling
          this option saves about 7k.
  
 +config IO_URING
 +      bool "Enable IO uring support" if EXPERT
 +      select ANON_INODES
 +      default y
 +      help
 +        This option enables support for the io_uring interface, enabling
 +        applications to submit and complete IO through submission and
 +        completion rings that are shared between the kernel and application.
 +
  config ADVISE_SYSCALLS
        bool "Enable madvise/fadvise syscalls" if EXPERT
        default y
diff --combined lib/Kconfig.debug
index bd62be80228e4b3d6b09c685c78663f977dde54a,dfc9949b6abe60527fc7d7e362238ba4a80c9cbb..0d9e81779e373745c3e28497df424b415a50c3ac
@@@ -17,23 -17,6 +17,23 @@@ config PRINTK_TIM
          The behavior is also controlled by the kernel command line
          parameter printk.time=1. See Documentation/admin-guide/kernel-parameters.rst
  
 +config PRINTK_CALLER
 +      bool "Show caller information on printks"
 +      depends on PRINTK
 +      help
 +        Selecting this option causes printk() to add a caller "thread id" (if
 +        in task context) or a caller "processor id" (if not in task context)
 +        to every message.
 +
 +        This option is intended for environments where multiple threads
 +        concurrently call printk() for many times, for it is difficult to
 +        interpret without knowing where these lines (or sometimes individual
 +        line which was divided into multiple lines due to race) came from.
 +
 +        Since toggling after boot makes the code racy, currently there is
 +        no option to enable/disable at the kernel command line parameter or
 +        sysfs interface.
 +
  config CONSOLE_LOGLEVEL_DEFAULT
        int "Default console loglevel (1-15)"
        range 1 15
@@@ -196,6 -179,7 +196,7 @@@ config DEBUG_INFO_REDUCE
  config DEBUG_INFO_SPLIT
        bool "Produce split debuginfo in .dwo files"
        depends on DEBUG_INFO
+       depends on $(cc-option,-gsplit-dwarf)
        help
          Generate debug info into separate .dwo files. This significantly
          reduces the build directory size for builds with DEBUG_INFO,
  config DEBUG_INFO_DWARF4
        bool "Generate dwarf4 debuginfo"
        depends on DEBUG_INFO
+       depends on $(cc-option,-gdwarf-4)
        help
          Generate dwarf4 debug info. This requires recent versions
          of gcc and gdb. It makes the debug information larger.
@@@ -239,6 -224,7 +241,6 @@@ config ENABLE_MUST_CHEC
  config FRAME_WARN
        int "Warn for stack frames larger than (needs gcc 4.4)"
        range 0 8192
 -      default 3072 if KASAN_EXTRA
        default 2048 if GCC_PLUGIN_LATENT_ENTROPY
        default 1280 if (!64BIT && PARISC)
        default 1024 if (!64BIT && !PARISC)
@@@ -282,6 -268,23 +284,6 @@@ config UNUSED_SYMBOL
          you really need it, and what the merge plan to the mainline kernel for
          your module is.
  
 -config PAGE_OWNER
 -      bool "Track page owner"
 -      depends on DEBUG_KERNEL && STACKTRACE_SUPPORT
 -      select DEBUG_FS
 -      select STACKTRACE
 -      select STACKDEPOT
 -      select PAGE_EXTENSION
 -      help
 -        This keeps track of what call chain is the owner of a page, may
 -        help to find bare alloc_page(s) leaks. Even if you include this
 -        feature on your build, it is disabled in default. You should pass
 -        "page_owner=on" to boot parameter in order to enable it. Eats
 -        a fair amount of memory if enabled. See tools/vm/page_owner_sort.c
 -        for user-space helper.
 -
 -        If unsure, say N.
 -
  config DEBUG_FS
        bool "Debug Filesystem"
        help
@@@ -1654,6 -1657,42 +1656,6 @@@ config PROVIDE_OHCI1394_DMA_INI
  
          See Documentation/debugging-via-ohci1394.txt for more information.
  
 -config DMA_API_DEBUG
 -      bool "Enable debugging of DMA-API usage"
 -      select NEED_DMA_MAP_STATE
 -      help
 -        Enable this option to debug the use of the DMA API by device drivers.
 -        With this option you will be able to detect common bugs in device
 -        drivers like double-freeing of DMA mappings or freeing mappings that
 -        were never allocated.
 -
 -        This also attempts to catch cases where a page owned by DMA is
 -        accessed by the cpu in a way that could cause data corruption.  For
 -        example, this enables cow_user_page() to check that the source page is
 -        not undergoing DMA.
 -
 -        This option causes a performance degradation.  Use only if you want to
 -        debug device drivers and dma interactions.
 -
 -        If unsure, say N.
 -
 -config DMA_API_DEBUG_SG
 -      bool "Debug DMA scatter-gather usage"
 -      default y
 -      depends on DMA_API_DEBUG
 -      help
 -        Perform extra checking that callers of dma_map_sg() have respected the
 -        appropriate segment length/boundary limits for the given device when
 -        preparing DMA scatterlists.
 -
 -        This is particularly likely to have been overlooked in cases where the
 -        dma_map_sg() API is used for general bulk mapping of pages rather than
 -        preparing literal scatter-gather descriptors, where there is a risk of
 -        unexpected behaviour from DMA API implementations if the scatterlist
 -        is technically out-of-spec.
 -
 -        If unsure, say N.
 -
  menuconfig RUNTIME_TESTING_MENU
        bool "Runtime Testing"
        def_bool y
@@@ -1663,6 -1702,7 +1665,6 @@@ if RUNTIME_TESTING_MEN
  config LKDTM
        tristate "Linux Kernel Dump Test Tool Module"
        depends on DEBUG_FS
 -      depends on BLOCK
        help
        This module enables testing of the different dumping mechanisms by
        inducing system failures at predefined crash points.
@@@ -1838,19 -1878,6 +1840,19 @@@ config TEST_LK
  
          If unsure, say N.
  
 +config TEST_VMALLOC
 +      tristate "Test module for stress/performance analysis of vmalloc allocator"
 +      default n
 +       depends on MMU
 +      depends on m
 +      help
 +        This builds the "test_vmalloc" module that should be used for
 +        stress and performance analysis. So, any new change for vmalloc
 +        subsystem can be evaluated from performance and stability point
 +        of view.
 +
 +        If unsure, say N.
 +
  config TEST_USER_COPY
        tristate "Test user/kernel boundary protections"
        depends on m
@@@ -1966,28 -1993,6 +1968,28 @@@ config TEST_MEMCAT_
  
          If unsure, say N.
  
 +config TEST_LIVEPATCH
 +      tristate "Test livepatching"
 +      default n
 +      depends on DYNAMIC_DEBUG
 +      depends on LIVEPATCH
 +      depends on m
 +      help
 +        Test kernel livepatching features for correctness.  The tests will
 +        load test modules that will be livepatched in various scenarios.
 +
 +        To run all the livepatching tests:
 +
 +        make -C tools/testing/selftests TARGETS=livepatch run_tests
 +
 +        Alternatively, individual tests may be invoked:
 +
 +        tools/testing/selftests/livepatch/test-callbacks.sh
 +        tools/testing/selftests/livepatch/test-livepatch.sh
 +        tools/testing/selftests/livepatch/test-shadow-vars.sh
 +
 +        If unsure, say N.
 +
  config TEST_OBJAGG
        tristate "Perform selftest on object aggreration manager"
        default n
          Enable this option to test object aggregation manager on boot
          (or module load).
  
 +
 +config TEST_STACKINIT
 +      tristate "Test level of stack variable initialization"
 +      help
 +        Test if the kernel is zero-initializing stack variables and
 +        padding. Coverage is controlled by compiler flags,
 +        CONFIG_GCC_PLUGIN_STRUCTLEAK, CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF,
 +        or CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL.
 +
          If unsure, say N.
  
  endif # RUNTIME_TESTING_MENU
diff --combined scripts/kallsyms.c
index f75e7bda48898e73b172490a28fb3e4c0f117e84,03ff265fe52264cfd704e11d024258d4f9b1dfc2..e17837f1d3f2bfd8cf712b6d2a0e3a42b88a94ae
@@@ -62,11 -62,11 +62,11 @@@ static int all_symbols = 0
  static int absolute_percpu = 0;
  static int base_relative = 0;
  
- int token_profit[0x10000];
static int token_profit[0x10000];
  
  /* the table that holds the result of the compression */
- unsigned char best_table[256][2];
- unsigned char best_table_len[256];
static unsigned char best_table[256][2];
static unsigned char best_table_len[256];
  
  
  static void usage(void)
@@@ -80,7 -80,7 +80,7 @@@
   * This ignores the intensely annoying "mapping symbols" found
   * in ARM ELF files: $a, $t and $d.
   */
- static inline int is_arm_mapping_symbol(const char *str)
+ static int is_arm_mapping_symbol(const char *str)
  {
        return str[0] == '$' && strchr("axtd", str[1])
               && (str[2] == '\0' || str[2] == '.');
@@@ -118,8 -118,8 +118,8 @@@ static int read_symbol(FILE *in, struc
                        fprintf(stderr, "Read error or end of file.\n");
                return -1;
        }
 -      if (strlen(sym) > KSYM_NAME_LEN) {
 -              fprintf(stderr, "Symbol %s too long for kallsyms (%zu vs %d).\n"
 +      if (strlen(sym) >= KSYM_NAME_LEN) {
 +              fprintf(stderr, "Symbol %s too long for kallsyms (%zu >= %d).\n"
                                "Please increase KSYM_NAME_LEN both in kernel and kallsyms.c\n",
                        sym, strlen(sym), KSYM_NAME_LEN);
                return -1;
@@@ -331,7 -331,7 +331,7 @@@ static void write_src(void
        unsigned int *markers;
        char buf[KSYM_NAME_LEN];
  
-       printf("#include <asm/types.h>\n");
+       printf("#include <asm/bitsperlong.h>\n");
        printf("#if BITS_PER_LONG == 64\n");
        printf("#define PTR .quad\n");
        printf("#define ALGN .balign 8\n");
@@@ -596,9 -596,6 +596,6 @@@ static void insert_real_symbols_in_tabl
  {
        unsigned int i, j, c;
  
-       memset(best_table, 0, sizeof(best_table));
-       memset(best_table_len, 0, sizeof(best_table_len));
        for (i = 0; i < table_cnt; i++) {
                for (j = 0; j < table[i].len; j++) {
                        c = table[i].sym[j];
This page took 0.156592 seconds and 4 git commands to generate.