projects/linux·commit d7b0827f

Merge tag 'kbuild-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

d7b0827f · Linus Torvalds <[email protected]> · 2019-09-20 08:36:47 -07:00

Pull Kbuild updates from Masahiro Yamada:

 - add modpost warn exported symbols marked as 'static' because 'static'
   and EXPORT_SYMBOL is an odd combination

 - break the build early if gold linker is used

 - optimize the Bison rule to produce .c and .h files by a single
   pattern rule

 - handle PREEMPT_RT in the module vermagic and UTS_VERSION

 - warn CONFIG options leaked to the user-space except existing ones

 - make single targets work properly

 - rebuild modules when module linker scripts are updated

 - split the module final link stage into scripts/Makefile.modfinal

 - fix the missed error code in merge_config.sh

 - improve the error message displayed on the attempt of the O= build in
   unclean source tree

 - remove 'clean-dirs' syntax

 - disable -Wimplicit-fallthrough warning for Clang

 - add CONFIG_CC_OPTIMIZE_FOR_SIZE_O3 for ARC

 - remove ARCH_{CPP,A,C}FLAGS variables

 - add $(BASH) to run bash scripts

 - change *CFLAGS_<basetarget>.o to take the relative path to $(obj)
   instead of the basename

 - stop suppressing Clang's -Wunused-function warnings when W=1

 - fix linux/export.h to avoid genksyms calculating CRC of trimmed
   exported symbols

 - misc cleanups

* tag 'kbuild-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (63 commits)
  genksyms: convert to SPDX License Identifier for lex.l and parse.y
  modpost: use __section in the output to *.mod.c
  modpost: use MODULE_INFO() for __module_depends
  export.h, genksyms: do not make genksyms calculate CRC of trimmed symbols
  export.h: remove defined(__KERNEL__), which is no longer needed
  kbuild: allow Clang to find unused static inline functions for W=1 build
  kbuild: rename KBUILD_ENABLE_EXTRA_GCC_CHECKS to KBUILD_EXTRA_WARN
  kbuild: refactor scripts/Makefile.extrawarn
  merge_config.sh: ignore unwanted grep errors
  kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj)
  modpost: add NOFAIL to strndup
  modpost: add guid_t type definition
  kbuild: add $(BASH) to run scripts with bash-extension
  kbuild: remove ARCH_{CPP,A,C}FLAGS
  kbuild,arc: add CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 for ARC
  kbuild: Do not enable -Wimplicit-fallthrough for clang for now
  kbuild: clean up subdir-ymn calculation in Makefile.clean
  kbuild: remove unneeded '+' marker from cmd_clean
  kbuild: remove clean-dirs syntax
  kbuild: check clean srctree even earlier
  ...
Commit
d7b0827f28ab3a4fd65864451ffefa695e3255fd
Parents
574cc453 · 77564a48

Merge commit. Changes below are compared with the first parent: 574cc453.

Changes

96 files changed · +763 −686

FileStatusAddDelContent
.gitignoremodified+1−1View file
Documentation/kbuild/kbuild.rstmodified+9−19View file
Documentation/kbuild/makefiles.rstmodified+25−42View file
Kbuildmodified+0−7View file
Makefilemodified+151−145View file
arch/Kconfigmodified+7−0View file
arch/alpha/Kconfigmodified+1−0View file
arch/arc/Makefilemodified+0−8View file
arch/arc/configs/axs101_defconfigmodified+1−0View file
arch/arc/configs/axs103_defconfigmodified+1−0View file
arch/arc/configs/axs103_smp_defconfigmodified+1−0View file
arch/arc/configs/haps_hs_defconfigmodified+1−0View file
arch/arc/configs/haps_hs_smp_defconfigmodified+1−0View file
arch/arc/configs/hsdk_defconfigmodified+1−0View file
arch/arc/configs/nps_defconfigmodified+1−0View file
arch/arc/configs/nsim_700_defconfigmodified+1−0View file
arch/arc/configs/nsim_hs_defconfigmodified+1−0View file
arch/arc/configs/nsim_hs_smp_defconfigmodified+1−0View file
arch/arc/configs/nsimosci_defconfigmodified+1−0View file
arch/arc/configs/nsimosci_hs_defconfigmodified+1−0View file
arch/arc/configs/nsimosci_hs_smp_defconfigmodified+1−0View file
arch/arc/configs/tb10x_defconfigmodified+1−0View file
arch/arc/configs/vdk_hs38_defconfigmodified+1−0View file
arch/arc/configs/vdk_hs38_smp_defconfigmodified+1−0View file
arch/arm/Makefilemodified+1−1View file
arch/arm/kvm/Makefilemodified+3−2View file
arch/arm64/Kconfigmodified+1−0View file
arch/arm64/Makefilemodified+1−1View file
arch/ia64/Kconfigmodified+1−0View file
arch/ia64/Makefilemodified+1−1View file
arch/m68k/Kconfigmodified+1−0View file
arch/m68k/Makefilemodified+1−1View file
arch/mips/Kconfigmodified+1−0View file
arch/mips/boot/Makefilemodified+1−1View file
arch/parisc/Makefilemodified+1−1View file
arch/powerpc/Kconfigmodified+1−0View file
arch/powerpc/Makefilemodified+1−1View file
arch/powerpc/Makefile.postlinkmodified+1−1View file
arch/powerpc/kernel/prom_init_check.shmodified+1−1View file
arch/riscv/Kconfigmodified+1−0View file
arch/riscv/Makefilemodified+1−1View file
arch/s390/Kconfigmodified+1−0View file
arch/sparc/Kconfigmodified+1−0View file
arch/um/Kconfigmodified+1−0View file
arch/x86/Kconfigmodified+1−0View file
arch/x86/entry/vdso/Makefilemodified+2−1View file
drivers/gpu/drm/amd/display/dc/calcs/Makefilemodified+3−3View file
drivers/gpu/drm/amd/display/dc/dcn20/Makefilemodified+2−2View file
drivers/gpu/drm/amd/display/dc/dcn21/Makefilemodified+1−1View file
drivers/gpu/drm/amd/display/dc/dml/Makefilemodified+11−14View file
drivers/gpu/drm/amd/display/dc/dsc/Makefilemodified+3−4View file
drivers/gpu/drm/i915/Makefilemodified+1−1View file
drivers/net/ethernet/aquantia/atlantic/hw_atl/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/mellanox/mlx5/core/accel/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/mellanox/mlx5/core/diag/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/mellanox/mlx5/core/en/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/mellanox/mlx5/core/en/xsk/Makefiledeleted+0−1View before deletion
drivers/net/ethernet/mellanox/mlx5/core/en_accel/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/mellanox/mlx5/core/fpga/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/mellanox/mlx5/core/ipoib/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/mellanox/mlx5/core/lib/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/netronome/nfp/bpf/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/netronome/nfp/flower/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/netronome/nfp/nfpcore/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000/Makefiledeleted+0−2View before deletion
drivers/net/ethernet/netronome/nfp/nic/Makefiledeleted+0−2View before deletion
include/linux/compiler_types.hmodified+14−6View file
include/linux/export.hmodified+16−26View file
include/linux/vermagic.hmodified+2−0View file
init/Kconfigmodified+20−6View file
init/Makefilemodified+3−2View file
kernel/Makefilemodified+1−1View file
scripts/Kconfig.includemodified+3−0View file
scripts/Makefilemodified+1−1View file
scripts/Makefile.buildmodified+43−30View file
scripts/Makefile.cleanmodified+5−26View file
scripts/Makefile.extrawarnmodified+69−52View file
scripts/Makefile.hostmodified+28−11View file
scripts/Makefile.libmodified+28−35View file
scripts/Makefile.modfinaladded+60−0View file
scripts/Makefile.modpostmodified+12−68View file
scripts/package/Makefile → scripts/Makefile.packagerenamed+24−19View file
scripts/basic/Makefilemodified+2−12View file
scripts/genksyms/Makefilemodified+2−9View file
scripts/genksyms/keywords.cmodified+1−5View file
scripts/genksyms/lex.lmodified+10−22View file
scripts/genksyms/parse.ymodified+10−22View file
scripts/headers_install.shmodified+72−0View file
scripts/kconfig/Makefilemodified+5−5View file
scripts/kconfig/merge_config.shmodified+6−6View file
scripts/link-vmlinux.shmodified+21−19View file
scripts/mkcompile_hmodified+3−1View file
scripts/mkmakefilemodified+2−2View file
scripts/mod/file2alias.cmodified+5−0View file
scripts/mod/modpost.cmodified+38−10View file
usr/include/Makefilemodified+1−3View file

Only the first 600 diff lines are shown. Download the complete patch.

.gitignore

View file
diff --git a/.gitignore b/.gitignore
index 2030c7a..ce2c634 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,7 +34,6 @@
*.mod.c
*.o
*.o.*
-*.order
*.patch
*.s
*.so
@@ -46,6 +45,7 @@
*.xz
Module.symvers
modules.builtin
+modules.order
#
# Top-level generic files

Documentation/kbuild/kbuild.rst

View file
diff --git a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst
index 61b2181..f1e5dce 100644
--- a/Documentation/kbuild/kbuild.rst
+++ b/Documentation/kbuild/kbuild.rst
@@ -105,6 +105,15 @@ The output directory can also be specified using "O=...".
Setting "O=..." takes precedence over KBUILD_OUTPUT.
+KBUILD_EXTRA_WARN
+-----------------
+Specify the extra build checks. The same value can be assigned by passing
+W=... from the command line.
+
+See `make help` for the list of the supported values.
+
+Setting "W=..." takes precedence over KBUILD_EXTRA_WARN.
+
KBUILD_DEBARCH
--------------
For the deb-pkg target, allows overriding the normal heuristics deployed by
@@ -241,11 +250,6 @@ To get all available archs you can also specify all. E.g.::
$ make ALLSOURCE_ARCHS=all tags
-KBUILD_ENABLE_EXTRA_GCC_CHECKS
-------------------------------
-If enabled over the make command line with "W=1", it turns on additional
-gcc -W... options for more extensive build-time checking.
-
KBUILD_BUILD_TIMESTAMP
----------------------
Setting this to a date string overrides the timestamp used in the
@@ -258,17 +262,3 @@ 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.
-
-KBUILD_LDS
-----------
-The linker script with full path. Assigned by the top-level Makefile.
-
-KBUILD_VMLINUX_OBJS
--------------------
-All object files for vmlinux. They are linked to vmlinux in the same
-order as listed in KBUILD_VMLINUX_OBJS.
-
-KBUILD_VMLINUX_LIBS
--------------------
-All .a "lib" files for vmlinux. KBUILD_VMLINUX_OBJS and KBUILD_VMLINUX_LIBS
-together specify all the object files used to link vmlinux.

Documentation/kbuild/makefiles.rst

View file
diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/makefiles.rst
index f4f0f7f..6ba9d53 100644
--- a/Documentation/kbuild/makefiles.rst
+++ b/Documentation/kbuild/makefiles.rst
@@ -471,21 +471,6 @@ more details, with real examples.
The second argument is optional, and if supplied will be used
if first argument is not supported.
- cc-ldoption
- cc-ldoption is used to check if $(CC) when used to link object files
- supports the given option. An optional second option may be
- specified if first option are not supported.
-
- Example::
-
- #arch/x86/kernel/Makefile
- vsyscall-flags += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv)
-
- In the above example, vsyscall-flags will be assigned the option
- -Wl$(comma)--hash-style=sysv if it is supported by $(CC).
- The second argument is optional, and if supplied will be used
- if first argument is not supported.
-
as-instr
as-instr checks if the assembler reports a specific instruction
and then outputs either option1 or option2
@@ -765,7 +750,8 @@ Files matching the patterns "*.[oas]", "*.ko", plus some additional files
generated by kbuild are deleted all over the kernel src tree when
"make clean" is executed.
-Additional files can be specified in kbuild makefiles by use of $(clean-files).
+Additional files or directories can be specified in kbuild makefiles by use of
+$(clean-files).
Example::
@@ -776,23 +762,8 @@ When executing "make clean", the file "crc32table.h" will be deleted.
Kbuild will assume files to be in the same relative directory as the
Makefile, except if prefixed with $(objtree).
-To delete a directory hierarchy use:
-
- Example::
-
- #scripts/package/Makefile
- clean-dirs := $(objtree)/debian/
-
-This will delete the directory debian in the toplevel directory, including all
-subdirectories.
-
-To exclude certain files from make clean, use the $(no-clean-files) variable.
-This is only a special case used in the top level Kbuild file:
-
- Example::
-
- #Kbuild
- no-clean-files := $(bounds-file) $(offsets-file)
+To exclude certain files or directories from make clean, use the
+$(no-clean-files) variable.
Usually kbuild descends down in subdirectories due to "obj-* := dir/",
but in the architecture makefiles where the kbuild infrastructure
@@ -988,13 +959,25 @@ When kbuild executes, the following steps are followed (roughly):
$(KBUILD_ARFLAGS) set by the top level Makefile to "D" (deterministic
mode) if this option is supported by $(AR).
- ARCH_CPPFLAGS, ARCH_AFLAGS, ARCH_CFLAGS Overrides the kbuild defaults
+ KBUILD_LDS
+
+ The linker script with full path. Assigned by the top-level Makefile.
+
+ KBUILD_LDS_MODULE
+
+ The module linker script with full path. Assigned by the top-level
+ Makefile and additionally by the arch Makefile.
+
+ KBUILD_VMLINUX_OBJS
+
+ All object files for vmlinux. They are linked to vmlinux in the same
+ order as listed in KBUILD_VMLINUX_OBJS.
- These variables are appended to the KBUILD_CPPFLAGS,
- KBUILD_AFLAGS, and KBUILD_CFLAGS, respectively, after the
- top-level Makefile has set any other flags. This provides a
- means for an architecture to override the defaults.
+ KBUILD_VMLINUX_LIBS
+ All .a "lib" files for vmlinux. KBUILD_VMLINUX_OBJS and
+ KBUILD_VMLINUX_LIBS together specify all the object files used to
+ link vmlinux.
6.2 Add prerequisites to archheaders
------------------------------------
@@ -1139,7 +1122,7 @@ When kbuild executes, the following steps are followed (roughly):
header-test-y
- header-test-y specifies headers (*.h) in the current directory that
+ header-test-y specifies headers (`*.h`) in the current directory that
should be compile tested to ensure they are self-contained,
i.e. compilable as standalone units. If CONFIG_HEADER_TEST is enabled,
this builds them as part of extra-y.
@@ -1147,11 +1130,11 @@ When kbuild executes, the following steps are followed (roughly):
header-test-pattern-y
This works as a weaker version of header-test-y, and accepts wildcard
- patterns. The typical usage is:
+ patterns. The typical usage is::
- header-test-pattern-y += *.h
+ header-test-pattern-y += *.h
- This specifies all the files that matches to '*.h' in the current
+ This specifies all the files that matches to `*.h` in the current
directory, but the files in 'header-test-' are excluded.
6.7 Commands useful for building a boot image

Kbuild

View file
diff --git a/Kbuild b/Kbuild
index 8637fd1..3109ac7 100644
--- a/Kbuild
+++ b/Kbuild
@@ -18,8 +18,6 @@ $(bounds-file): kernel/bounds.s FORCE
timeconst-file := include/generated/timeconst.h
-targets += $(timeconst-file)
-
filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<
$(timeconst-file): kernel/time/timeconst.bc FORCE
@@ -42,7 +40,6 @@ $(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
# Check for missing system calls
always += missing-syscalls
-targets += missing-syscalls
quiet_cmd_syscalls = CALL $<
cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
@@ -54,13 +51,9 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
# 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)

Makefile

View file
diff --git a/Makefile b/Makefile
index 2fa7cfa..656a8c9 100644
--- a/Makefile
+++ b/Makefile
@@ -230,6 +230,8 @@ endif
export KBUILD_CHECKSRC KBUILD_EXTMOD
+extmod-prefix = $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)
+
ifeq ($(abs_srctree),$(abs_objtree))
# building in the source tree
srctree := .
@@ -271,52 +273,62 @@ no-dot-config-targets := $(clean-targets) \
%asm-generic kernelversion %src-pkg
no-sync-config-targets := $(no-dot-config-targets) install %install \
kernelrelease
+single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/
-config-targets := 0
-mixed-targets := 0
-dot-config := 1
-may-sync-config := 1
+config-build :=
+mixed-build :=
+need-config := 1
+may-sync-config := 1
+single-build :=
ifneq ($(filter $(no-dot-config-targets), $(MAKECMDGOALS)),)
ifeq ($(filter-out $(no-dot-config-targets), $(MAKECMDGOALS)),)
- dot-config := 0
+ need-config :=
endif
endif
ifneq ($(filter $(no-sync-config-targets), $(MAKECMDGOALS)),)
ifeq ($(filter-out $(no-sync-config-targets), $(MAKECMDGOALS)),)
- may-sync-config := 0
+ may-sync-config :=
endif
endif
ifneq ($(KBUILD_EXTMOD),)
- may-sync-config := 0
+ may-sync-config :=
endif
ifeq ($(KBUILD_EXTMOD),)
ifneq ($(filter config %config,$(MAKECMDGOALS)),)
- config-targets := 1
+ config-build := 1
ifneq ($(words $(MAKECMDGOALS)),1)
- mixed-targets := 1
+ mixed-build := 1
endif
endif
endif
+# We cannot build single targets and the others at the same time
+ifneq ($(filter $(single-targets), $(MAKECMDGOALS)),)
+ single-build := 1
+ ifneq ($(filter-out $(single-targets), $(MAKECMDGOALS)),)
+ mixed-build := 1
+ endif
+endif
+
# For "make -j clean all", "make -j mrproper defconfig all", etc.
ifneq ($(filter $(clean-targets),$(MAKECMDGOALS)),)
ifneq ($(filter-out $(clean-targets),$(MAKECMDGOALS)),)
- mixed-targets := 1
+ mixed-build := 1
endif
endif
# install and modules_install need also be processed one by one
ifneq ($(filter install,$(MAKECMDGOALS)),)
ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
- mixed-targets := 1
+ mixed-build := 1
endif
endif
-ifeq ($(mixed-targets),1)
+ifdef mixed-build
# ===========================================================================
# We're called with mixed targets (*config and build targets).
# Handle them one by one.
@@ -332,7 +344,7 @@ __build_one_by_one:
$(MAKE) -f $(srctree)/Makefile $$i; \
done
-else
+else # !mixed-build
include scripts/Kbuild.include
@@ -392,9 +404,7 @@ KCONFIG_CONFIG ?= .config
export KCONFIG_CONFIG
# SHELL used by kbuild
-CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
- else if [ -x /bin/bash ]; then echo /bin/bash; \
- else echo sh; fi ; fi)
+CONFIG_SHELL := sh
HOST_LFS_CFLAGS := $(shell getconf LFS_CFLAGS 2>/dev/null)
HOST_LFS_LDFLAGS := $(shell getconf LFS_LDFLAGS 2>/dev/null)
@@ -431,6 +441,7 @@ PYTHON = python
PYTHON2 = python2
PYTHON3 = python3
CHECK = sparse
+BASH = bash
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
@@ -470,12 +481,13 @@ KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS_MODULE := -DMODULE
KBUILD_CFLAGS_MODULE := -DMODULE
-KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
+KBUILD_LDFLAGS_MODULE :=
+export KBUILD_LDS_MODULE := $(srctree)/scripts/module-common.lds
KBUILD_LDFLAGS :=
GCC_PLUGINS_CFLAGS :=
CLANG_FLAGS :=
-export ARCH SRCARCH CONFIG_SHELL HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
+export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE PAHOLE LEX YACC AWK INSTALLKERNEL
export PERL PYTHON PYTHON2 PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
@@ -506,6 +518,7 @@ scripts_basic:
$(Q)rm -f .tmp_quiet_recordmcount
PHONY += outputmakefile
+# Before starting out-of-tree build, make sure the source tree is clean.
# outputmakefile generates a Makefile in the output directory, if using a
# separate output directory. This allows convenient use of make in the
# output directory.
@@ -513,6 +526,15 @@ PHONY += outputmakefile
# ignore whole output directory
outputmakefile:
ifdef building_out_of_srctree
+ $(Q)if [ -f $(srctree)/.config -o \
+ -d $(srctree)/include/config -o \
+ -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
+ echo >&2 "***"; \
+ echo >&2 "*** The source tree is not clean, please run 'make$(if $(findstring command line, $(origin ARCH)), ARCH=$(ARCH)) mrproper'"; \
+ echo >&2 "*** in $(abs_srctree)";\
+ echo >&2 "***"; \
+ false; \
+ fi
$(Q)ln -fsn $(srctree) source
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree)
$(Q)test -e .gitignore || \
@@ -544,7 +566,7 @@ endif
# and from include/config/auto.conf.cmd to detect the compiler upgrade.
CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1)
-ifeq ($(config-targets),1)
+ifdef config-build
# ===========================================================================
# *config targets only - make sure prerequisites are updated, and descend
# in scripts/kconfig to make the *config target
@@ -555,13 +577,13 @@ ifeq ($(config-targets),1)
include arch/$(SRCARCH)/Makefile
export KBUILD_DEFCONFIG KBUILD_KCONFIG CC_VERSION_TEXT
-config: scripts_basic outputmakefile FORCE
+config: outputmakefile scripts_basic FORCE
$(Q)$(MAKE) $(build)=scripts/kconfig $@
-%config: scripts_basic outputmakefile FORCE
+%config: outputmakefile scripts_basic FORCE
$(Q)$(MAKE) $(build)=scripts/kconfig $@
-else
+else #!config-build
# ===========================================================================
# Build targets only - this includes vmlinux, arch specific targets, clean
# targets and others. In general all targets except *config targets.
@@ -604,7 +626,7 @@ endif
export KBUILD_MODULES KBUILD_BUILTIN
-ifeq ($(dot-config),1)
+ifdef need-config
include include/config/auto.conf
endif
@@ -645,15 +667,10 @@ RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc
export RETPOLINE_CFLAGS
export RETPOLINE_VDSO_CFLAGS
-# The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
-# values of the respective KBUILD_* variables
-ARCH_CPPFLAGS :=
-ARCH_AFLAGS :=
-ARCH_CFLAGS :=
include arch/$(SRCARCH)/Makefile
-ifeq ($(dot-config),1)
-ifeq ($(may-sync-config),1)
+ifdef need-config
+ifdef may-sync-config
# Read in dependencies to all Kconfig* files, make sure to run syncconfig if
# changes are detected. This should be included after arch/$(SRCARCH)/Makefile
# because some architectures define CROSS_COMPILE there.
@@ -676,7 +693,7 @@ $(KCONFIG_CONFIG):
# 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
+else # !may-sync-config
# External modules and some install targets need include/generated/autoconf.h
# and include/config/auto.conf but do not care if they are up-to-date.
# Use auto.conf to trigger the test
@@ -692,7 +709,7 @@ include/config/auto.conf:
/bin/false)
endif # may-sync-config
-endif # $(dot-config)
+endif # need-config
KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,)
KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,)
@@ -700,10 +717,12 @@ KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
-ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
-KBUILD_CFLAGS += -Os
-else
-KBUILD_CFLAGS += -O2
+ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
+KBUILD_CFLAGS += -O2
+else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
+KBUILD_CFLAGS += -O3
+else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
+KBUILD_CFLAGS += -Os
endif
ifdef CONFIG_CC_DISABLE_WARN_MAYBE_UNINITIALIZED
@@ -751,6 +770,11 @@ else
# These warnings generated too much noise in a regular build.
# Use make W=1 to enable them (see scripts/Makefile.extrawarn)
KBUILD_CFLAGS += -Wno-unused-but-set-variable
+
+# Warn about unmarked fall-throughs in switch statement.
+# Disabled for clang while comment to attribute conversion happens and
+# https://github.com/ClangBuiltLinux/linux/issues/636 is discussed.
+KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,)
endif
KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable)
@@ -845,9 +869,6 @@ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
# warn about C99 declaration after statement
KBUILD_CFLAGS += -Wdeclaration-after-statement
-# Warn about unmarked fall-throughs in switch statement.
-KBUILD_CFLAGS += $(call cc-option,-Wimplicit-fallthrough,)
-
# Variable Length Arrays (VLAs) should not be used anywhere in the kernel
KBUILD_CFLAGS += -Wvla
@@ -900,11 +921,10 @@ include scripts/Makefile.kasan
include scripts/Makefile.extrawarn
include scripts/Makefile.ubsan
-# Add any arch overrides and user supplied CPPFLAGS, AFLAGS and CFLAGS as the
-# last assignments
-KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
-KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS)
-KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS)
+# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
+KBUILD_CPPFLAGS += $(KCPPFLAGS)
+KBUILD_AFLAGS += $(KAFLAGS)
+KBUILD_CFLAGS += $(KCFLAGS)
KBUILD_LDFLAGS_MODULE += --build-id
LDFLAGS_vmlinux += --build-id
@@ -1007,7 +1027,7 @@ endif
PHONY += prepare0
-export MODORDER := $(if $(KBUILD_EXTMOD),$(KBUILD_EXTMOD)/)modules.order
+export MODORDER := $(extmod-prefix)modules.order
ifeq ($(KBUILD_EXTMOD),)
core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
@@ -1020,6 +1040,9 @@ vmlinux-alldirs := $(sort $(vmlinux-dirs) Documentation \
$(patsubst %/,%,$(filter %/, $(init-) $(core-) \
$(drivers-) $(net-) $(libs-) $(virt-))))
+build-dirs := $(vmlinux-dirs)
+clean-dirs := $(vmlinux-alldirs)
+
init-y := $(patsubst %/, %/built-in.a, $(init-y))
core-y := $(patsubst %/, %/built-in.a, $(core-y))
drivers-y := $(patsubst %/, %/built-in.a, $(drivers-y))
@@ -1042,7 +1065,7 @@ vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)
# Recurse until adjust_autoksyms.sh is satisfied
PHONY += autoksyms_recursive
ifdef CONFIG_TRIM_UNUSED_KSYMS
-autoksyms_recursive: $(vmlinux-deps) modules.order
+autoksyms_recursive: descend modules.order
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \
"$(MAKE) -f $(srctree)/Makefile vmlinux"
endif
@@ -1074,17 +1097,7 @@ targets := vmlinux
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
-$(sort $(vmlinux-deps)): $(vmlinux-dirs) ;
-
-# Handle descending into subdirectories listed in $(vmlinux-dirs)
-# Preset locale variables to speed up the build process. Limit locale
-# tweaks to this spot to avoid wrong language settings when running
-# make menuconfig etc.
-# Error messages still appears in the original language
-
-PHONY += $(vmlinux-dirs)
-$(vmlinux-dirs): prepare
- $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1
+$(sort $(vmlinux-deps)): descend ;
filechk_kernel.release = \
echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
@@ -1106,24 +1119,9 @@ scripts: scripts_basic scripts_dtc
# archprepare is used in arch Makefiles and when processed asm symlink,
# version.h and scripts_basic is processed / created.
-PHONY += prepare archprepare prepare3
+PHONY += prepare archprepare
-# prepare3 is used to check if we are building in a separate output directory,
-# and if so do:
-# 1) Check that make has not been executed in the kernel src $(srctree)
-prepare3: include/config/kernel.release
-ifdef building_out_of_srctree
- @$(kecho) ' Using $(srctree) as source for kernel'
- $(Q)if [ -f $(srctree)/.config -o \
- -d $(srctree)/include/config -o \
- -d $(srctree)/arch/$(SRCARCH)/include/generated ]; then \
- echo >&2 " $(srctree) is not clean, please run 'make ARCH=$(ARCH) mrproper'"; \
- echo >&2 " in the '$(srctree)' directory.";\
- /bin/false; \
- fi;
-endif
-
-archprepare: archheaders archscripts scripts prepare3 outputmakefile \
+archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
asm-generic $(version_h) $(autoksyms_h) include/generated/utsrelease.h
prepare0: archprepare
@@ -1248,7 +1246,7 @@ kselftest-merge:
$(if $(wildcard $(objtree)/.config),, $(error No .config exists, config your kernel first!))
$(Q)find $(srctree)/tools/testing/selftests -name config | \
xargs $(srctree)/scripts/kconfig/merge_config.sh -m $(objtree)/.config
- +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
+ $(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig
# ---------------------------------------------------------------------------
# Devicetree files
@@ -1259,11 +1257,11 @@ endif
ifneq ($(dtstree),)
-%.dtb: prepare3 scripts_dtc
+%.dtb: include/config/kernel.release scripts_dtc
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
PHONY += dtbs dtbs_install dt_binding_check
-dtbs dtbs_check: prepare3 scripts_dtc
+dtbs dtbs_check: include/config/kernel.release scripts_dtc
$(Q)$(MAKE) $(build)=$(dtstree)

This diff is incomplete. Download the complete patch.

arch/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/alpha/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/axs101_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/axs103_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/axs103_smp_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/haps_hs_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/haps_hs_smp_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/hsdk_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/nps_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/nsim_700_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/nsim_hs_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/nsim_hs_smp_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/nsimosci_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/nsimosci_hs_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/nsimosci_hs_smp_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/tb10x_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/vdk_hs38_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arc/configs/vdk_hs38_smp_defconfig

View file

This diff is incomplete. Download the complete patch.

arch/arm/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arm/kvm/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/arm64/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/arm64/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/ia64/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/ia64/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/m68k/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/m68k/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/mips/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/mips/boot/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/parisc/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/Makefile.postlink

View file

This diff is incomplete. Download the complete patch.

arch/powerpc/kernel/prom_init_check.sh

View file

This diff is incomplete. Download the complete patch.

arch/riscv/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/riscv/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/s390/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/sparc/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/um/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/x86/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/x86/entry/vdso/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/amd/display/dc/calcs/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/amd/display/dc/dcn20/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/amd/display/dc/dcn21/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/amd/display/dc/dml/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/amd/display/dc/dsc/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/gpu/drm/i915/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/aquantia/atlantic/hw_atl/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/accel/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/diag/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/en/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/en/xsk/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/en_accel/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/fpga/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/ipoib/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx5/core/lib/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/netronome/nfp/bpf/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/netronome/nfp/flower/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/netronome/nfp/nfpcore/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/netronome/nfp/nfpcore/nfp6000/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/netronome/nfp/nic/Makefile

View before deletion

This diff is incomplete. Download the complete patch.

include/linux/compiler_types.h

View file

This diff is incomplete. Download the complete patch.

include/linux/export.h

View file

This diff is incomplete. Download the complete patch.

include/linux/vermagic.h

View file

This diff is incomplete. Download the complete patch.

init/Kconfig

View file

This diff is incomplete. Download the complete patch.

init/Makefile

View file

This diff is incomplete. Download the complete patch.

kernel/Makefile

View file

This diff is incomplete. Download the complete patch.

scripts/Kconfig.include

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.build

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.clean

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.extrawarn

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.host

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.lib

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.modfinal

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.modpost

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.package

View file

This diff is incomplete. Download the complete patch.

scripts/basic/Makefile

View file

This diff is incomplete. Download the complete patch.

scripts/genksyms/Makefile

View file

This diff is incomplete. Download the complete patch.

scripts/genksyms/keywords.c

View file

This diff is incomplete. Download the complete patch.

scripts/genksyms/lex.l

View file

This diff is incomplete. Download the complete patch.

scripts/genksyms/parse.y

View file

This diff is incomplete. Download the complete patch.

scripts/headers_install.sh

View file

This diff is incomplete. Download the complete patch.

scripts/kconfig/Makefile

View file

This diff is incomplete. Download the complete patch.

scripts/kconfig/merge_config.sh

View file

This diff is incomplete. Download the complete patch.

scripts/link-vmlinux.sh

View file

This diff is incomplete. Download the complete patch.

scripts/mkcompile_h

View file

This diff is incomplete. Download the complete patch.

scripts/mkmakefile

View file

This diff is incomplete. Download the complete patch.

scripts/mod/file2alias.c

View file

This diff is incomplete. Download the complete patch.

scripts/mod/modpost.c

View file

This diff is incomplete. Download the complete patch.

usr/include/Makefile

View file

This diff is incomplete. Download the complete patch.