projects/linux·commit f4d2ef48

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

f4d2ef48 · Linus Torvalds <[email protected]> · 2025-04-05 15:46:50 -07:00

Pull Kbuild updates from Masahiro Yamada:

 - Improve performance in gendwarfksyms

 - Remove deprecated EXTRA_*FLAGS and KBUILD_ENABLE_EXTRA_GCC_CHECKS

 - Support CONFIG_HEADERS_INSTALL for ARCH=um

 - Use more relative paths to sources files for better reproducibility

 - Support the loong64 Debian architecture

 - Add Kbuild bash completion

 - Introduce intermediate vmlinux.unstripped for architectures that need
   static relocations to be stripped from the final vmlinux

 - Fix versioning in Debian packages for -rc releases

 - Treat missing MODULE_DESCRIPTION() as an error

 - Convert Nios2 Makefiles to use the generic rule for built-in DTB

 - Add debuginfo support to the RPM package

* tag 'kbuild-v6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (40 commits)
  kbuild: rpm-pkg: build a debuginfo RPM
  kconfig: merge_config: use an empty file as initfile
  nios2: migrate to the generic rule for built-in DTB
  rust: kbuild: skip `--remap-path-prefix` for `rustdoc`
  kbuild: pacman-pkg: hardcode module installation path
  kbuild: deb-pkg: don't set KBUILD_BUILD_VERSION unconditionally
  modpost: require a MODULE_DESCRIPTION()
  kbuild: make all file references relative to source root
  x86: drop unnecessary prefix map configuration
  kbuild: deb-pkg: add comment about future removal of KDEB_COMPRESS
  kbuild: Add a help message for "headers"
  kbuild: deb-pkg: remove "version" variable in mkdebian
  kbuild: deb-pkg: fix versioning for -rc releases
  Documentation/kbuild: Fix indentation in modules.rst example
  x86: Get rid of Makefile.postlink
  kbuild: Create intermediate vmlinux build with relocations preserved
  kbuild: Introduce Kconfig symbol for linking vmlinux with relocations
  kbuild: link-vmlinux.sh: Make output file name configurable
  kbuild: do not generate .tmp_vmlinux*.map when CONFIG_VMLINUX_MAP=y
  Revert "kheaders: Ignore silly-rename files"
  ...
Commit
f4d2ef48250ad057e4f00087967b5ff366da9f39
Parents
758e4c86 · a7c699d0

Merge commit. Changes below are compared with the first parent: 758e4c86.

Changes

62 files changed · +890 −350

FileStatusAddDelContent
.gitignoremodified+1−0View file
Documentation/dev-tools/checkpatch.rstmodified+0−18View file
Documentation/kbuild/bash-completion.rstadded+65−0View file
Documentation/kbuild/index.rstmodified+2−0View file
Documentation/kbuild/kconfig-language.rstmodified+18−11View file
Documentation/kbuild/makefiles.rstmodified+14−3View file
Documentation/kbuild/modules.rstmodified+1−1View file
Documentation/kbuild/reproducible-builds.rstmodified+0−17View file
MAINTAINERSmodified+1−0View file
Makefilemodified+16−7View file
arch/Kconfigmodified+7−0View file
arch/arm64/Makefilemodified+1−1View file
arch/mips/Kconfigmodified+1−0View file
arch/mips/Makefilemodified+0−4View file
arch/mips/Makefile.postlinkmodified+1−1View file
arch/nios2/Kbuildmodified+1−1View file
arch/nios2/boot/dts/Makefilemodified+2−2View file
arch/nios2/kernel/prom.cmodified+1−1View file
arch/nios2/platform/Kconfig.platformmodified+6−5View file
arch/riscv/Kconfigmodified+1−0View file
arch/riscv/Makefilemodified+1−1View file
arch/riscv/Makefile.postlinkmodified+1−10View file
arch/riscv/boot/Makefilemodified+1−4View file
arch/s390/Kconfigmodified+1−0View file
arch/s390/Makefilemodified+1−1View file
arch/s390/Makefile.postlinkmodified+1−3View file
arch/x86/Kconfigmodified+1−0View file
arch/x86/Makefilemodified+0−6View file
arch/x86/Makefile.postlinkdeleted+0−40View before deletion
arch/x86/boot/Makefilemodified+0−1View file
arch/x86/boot/compressed/Makefilemodified+6−4View file
kernel/gen_kheaders.shmodified+0−1View file
lib/Kconfig.debugmodified+3−4View file
rust/Makefilemodified+6−2View file
scripts/Makefile.buildmodified+0−4View file
scripts/Makefile.compilermodified+4−0View file
scripts/Makefile.extrawarnmodified+0−3View file
scripts/Makefile.libmodified+0−8View file
scripts/Makefile.vmlinuxmodified+26−8View file
scripts/bash-completion/makeadded+451−0View file
scripts/checkpatch.plmodified+0−14View file
scripts/clang-tools/gen_compile_commands.pymodified+4−4View file
scripts/configmodified+16−10View file
scripts/gendwarfksyms/die.cmodified+1−1View file
scripts/gendwarfksyms/dwarf.cmodified+82−70View file
scripts/gendwarfksyms/gendwarfksyms.hmodified+2−0View file
scripts/gendwarfksyms/types.cmodified+1−1View file
scripts/generate_builtin_ranges.awkmodified+5−0View file
scripts/genksyms/lex.lmodified+1−5View file
scripts/kconfig/confdata.cmodified+12−7View file
scripts/kconfig/merge_config.shmodified+2−2View file
scripts/kconfig/symbol.cmodified+1−1View file
scripts/link-vmlinux.shmodified+15−9View file
scripts/mod/modpost.cmodified+20−25View file
scripts/mod/modpost.hmodified+1−0View file
scripts/mod/sumversion.cmodified+6−11View file
scripts/package/PKGBUILDmodified+3−3View file
scripts/package/debian/rulesmodified+8−2View file
scripts/package/kernel.specmodified+44−2View file
scripts/package/mkdebianmodified+13−10View file
scripts/package/mkspecmodified+10−0View file
scripts/show_deltamodified+1−1View file

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

.gitignore

View file
diff --git a/.gitignore b/.gitignore
index 5937c74..f2f63e4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,6 +65,7 @@ modules.order
/vmlinux.32
/vmlinux.map
/vmlinux.symvers
+/vmlinux.unstripped
/vmlinux-gdb.py
/vmlinuz
/System.map

Documentation/dev-tools/checkpatch.rst

View file
diff --git a/Documentation/dev-tools/checkpatch.rst b/Documentation/dev-tools/checkpatch.rst
index abb3ff6..76bd0dd 100644
--- a/Documentation/dev-tools/checkpatch.rst
+++ b/Documentation/dev-tools/checkpatch.rst
@@ -342,24 +342,6 @@ API usage
See: https://www.kernel.org/doc/html/latest/RCU/whatisRCU.html#full-list-of-rcu-apis
- **DEPRECATED_VARIABLE**
- EXTRA_{A,C,CPP,LD}FLAGS are deprecated and should be replaced by the new
- flags added via commit f77bf01425b1 ("kbuild: introduce ccflags-y,
- asflags-y and ldflags-y").
-
- The following conversion scheme maybe used::
-
- EXTRA_AFLAGS -> asflags-y
- EXTRA_CFLAGS -> ccflags-y
- EXTRA_CPPFLAGS -> cppflags-y
- EXTRA_LDFLAGS -> ldflags-y
-
- See:
-
- 1. https://lore.kernel.org/lkml/[email protected]/
- 2. https://lore.kernel.org/lkml/[email protected]/
- 3. https://www.kernel.org/doc/html/latest/kbuild/makefiles.html#compilation-flags
-
**DEVICE_ATTR_FUNCTIONS**
The function names used in DEVICE_ATTR is unusual.
Typically, the store and show functions are used with <attr>_store and

Documentation/kbuild/bash-completion.rst

View file
diff --git a/Documentation/kbuild/bash-completion.rst b/Documentation/kbuild/bash-completion.rst
new file mode 100644
index 0000000..2b52dbc
--- /dev/null
+++ b/Documentation/kbuild/bash-completion.rst
@@ -0,0 +1,65 @@
+.. SPDX-License-Identifier: GPL-2.0-only
+
+==========================
+Bash completion for Kbuild
+==========================
+
+The kernel build system is written using Makefiles, and Bash completion
+for the `make` command is available through the `bash-completion`_ project.
+
+However, the Makefiles for the kernel build are complex. The generic completion
+rules for the `make` command do not provide meaningful suggestions for the
+kernel build system, except for the options of the `make` command itself.
+
+To enhance completion for various variables and targets, the kernel source
+includes its own completion script at `scripts/bash-completion/make`.
+
+This script provides additional completions when working within the kernel tree.
+Outside the kernel tree, it defaults to the generic completion rules for the
+`make` command.
+
+Prerequisites
+=============
+
+The script relies on helper functions provided by `bash-completion`_ project.
+Please ensure it is installed on your system. On most distributions, you can
+install the `bash-completion` package through the standard package manager.
+
+How to use
+==========
+
+You can source the script directly::
+
+ $ source scripts/bash-completion/make
+
+Or, you can copy it into the search path for Bash completion scripts.
+For example::
+
+ $ mkdir -p ~/.local/share/bash-completion/completions
+ $ cp scripts/bash-completion/make ~/.local/share/bash-completion/completions/
+
+Details
+=======
+
+The additional completion for Kbuild is enabled in the following cases:
+
+ - You are in the root directory of the kernel source.
+ - You are in the top-level build directory created by the O= option
+ (checked via the `source` symlink pointing to the kernel source).
+ - The -C make option specifies the kernel source or build directory.
+ - The -f make option specifies a file in the kernel source or build directory.
+
+If none of the above are met, it falls back to the generic completion rules.
+
+The completion supports:
+
+ - Commonly used targets, such as `all`, `menuconfig`, `dtbs`, etc.
+ - Make (or environment) variables, such as `ARCH`, `LLVM`, etc.
+ - Single-target builds (`foo/bar/baz.o`)
+ - Configuration files (`*_defconfig` and `*.config`)
+
+Some variables offer intelligent behavior. For instance, `CROSS_COMPILE=`
+followed by a TAB displays installed toolchains. The list of defconfig files
+shown depends on the value of the `ARCH=` variable.
+
+.. _bash-completion: https://github.com/scop/bash-completion/

Documentation/kbuild/index.rst

View file
diff --git a/Documentation/kbuild/index.rst b/Documentation/kbuild/index.rst
index e82af05..3731ab2 100644
--- a/Documentation/kbuild/index.rst
+++ b/Documentation/kbuild/index.rst
@@ -23,6 +23,8 @@ Kernel Build System
llvm
gendwarfksyms
+ bash-completion
+
.. only:: subproject and html
Indices

Documentation/kbuild/kconfig-language.rst

View file
diff --git a/Documentation/kbuild/kconfig-language.rst b/Documentation/kbuild/kconfig-language.rst
index 2619fdf..a91abb8 100644
--- a/Documentation/kbuild/kconfig-language.rst
+++ b/Documentation/kbuild/kconfig-language.rst
@@ -194,16 +194,6 @@ applicable everywhere (see syntax).
ability to hook into a secondary subsystem while allowing the user to
configure that subsystem out without also having to unset these drivers.
- Note: If the combination of FOO=y and BAZ=m causes a link error,
- you can guard the function call with IS_REACHABLE()::
-
- foo_init()
- {
- if (IS_REACHABLE(CONFIG_BAZ))
- baz_register(&foo);
- ...
- }
-
Note: If the feature provided by BAZ is highly desirable for FOO,
FOO should imply not only BAZ, but also its dependency BAR::
@@ -588,7 +578,9 @@ uses the slightly counterintuitive::
depends on BAR || !BAR
This means that there is either a dependency on BAR that disallows
-the combination of FOO=y with BAR=m, or BAR is completely disabled.
+the combination of FOO=y with BAR=m, or BAR is completely disabled. The BAR
+module must provide all the stubs for !BAR case.
+
For a more formalized approach if there are multiple drivers that have
the same dependency, a helper symbol can be used, like::
@@ -599,6 +591,21 @@ the same dependency, a helper symbol can be used, like::
config BAR_OPTIONAL
def_tristate BAR || !BAR
+Much less favorable way to express optional dependency is IS_REACHABLE() within
+the module code, useful for example when the module BAR does not provide
+!BAR stubs::
+
+ foo_init()
+ {
+ if (IS_REACHABLE(CONFIG_BAR))
+ bar_register(&foo);
+ ...
+ }
+
+IS_REACHABLE() is generally discouraged, because the code will be silently
+discarded, when CONFIG_BAR=m and this code is built-in. This is not what users
+usually expect when enabling BAR as module.
+
Kconfig recursive dependency limitations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Documentation/kbuild/makefiles.rst

View file
diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/makefiles.rst
index d36519f..3b9a8bc 100644
--- a/Documentation/kbuild/makefiles.rst
+++ b/Documentation/kbuild/makefiles.rst
@@ -318,9 +318,6 @@ ccflags-y, asflags-y and ldflags-y
These three flags apply only to the kbuild makefile in which they
are assigned. They are used for all the normal cc, as and ld
invocations happening during a recursive build.
- Note: Flags with the same behaviour were previously named:
- EXTRA_CFLAGS, EXTRA_AFLAGS and EXTRA_LDFLAGS.
- They are still supported but their usage is deprecated.
ccflags-y specifies options for compiling with $(CC).
@@ -670,6 +667,20 @@ cc-cross-prefix
endif
endif
+$(RUSTC) support functions
+--------------------------
+
+rustc-min-version
+ rustc-min-version tests if the value of $(CONFIG_RUSTC_VERSION) is greater
+ than or equal to the provided value and evaluates to y if so.
+
+ Example::
+
+ rustflags-$(call rustc-min-version, 108500) := -Cfoo
+
+ In this example, rustflags-y will be assigned the value -Cfoo if
+ $(CONFIG_RUSTC_VERSION) is >= 1.85.0.
+
$(LD) support functions
-----------------------

Documentation/kbuild/modules.rst

View file
diff --git a/Documentation/kbuild/modules.rst b/Documentation/kbuild/modules.rst
index a42f00d..d070360 100644
--- a/Documentation/kbuild/modules.rst
+++ b/Documentation/kbuild/modules.rst
@@ -318,7 +318,7 @@ Several Subdirectories
| |__ include
| |__ hardwareif.h
|__ include
- |__ complex.h
+ |__ complex.h
To build the module complex.ko, we then need the following
kbuild file::

Documentation/kbuild/reproducible-builds.rst

View file
diff --git a/Documentation/kbuild/reproducible-builds.rst b/Documentation/kbuild/reproducible-builds.rst
index f2dcc39..a776248 100644
--- a/Documentation/kbuild/reproducible-builds.rst
+++ b/Documentation/kbuild/reproducible-builds.rst
@@ -46,21 +46,6 @@ The kernel embeds the building user and host names in
`KBUILD_BUILD_USER and KBUILD_BUILD_HOST`_ variables. If you are
building from a git commit, you could use its committer address.
-Absolute filenames
-------------------
-
-When the kernel is built out-of-tree, debug information may include
-absolute filenames for the source files. This must be overridden by
-including the ``-fdebug-prefix-map`` option in the `KCFLAGS`_ variable.
-
-Depending on the compiler used, the ``__FILE__`` macro may also expand
-to an absolute filename in an out-of-tree build. Kbuild automatically
-uses the ``-fmacro-prefix-map`` option to prevent this, if it is
-supported.
-
-The Reproducible Builds web site has more information about these
-`prefix-map options`_.
-
Generated files in source packages
----------------------------------
@@ -131,7 +116,5 @@ See ``scripts/setlocalversion`` for details.
.. _KBUILD_BUILD_TIMESTAMP: kbuild.html#kbuild-build-timestamp
.. _KBUILD_BUILD_USER and KBUILD_BUILD_HOST: kbuild.html#kbuild-build-user-kbuild-build-host
-.. _KCFLAGS: kbuild.html#kcflags
-.. _prefix-map options: https://reproducible-builds.org/docs/build-path/
.. _Reproducible Builds project: https://reproducible-builds.org/
.. _SOURCE_DATE_EPOCH: https://reproducible-builds.org/docs/source-date-epoch/

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 349ec68..96b8270 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12850,6 +12850,7 @@ F: Makefile
F: scripts/*vmlinux*
F: scripts/Kbuild*
F: scripts/Makefile*
+F: scripts/bash-completion/
F: scripts/basic/
F: scripts/clang-tools/
F: scripts/dummy-tools/

Makefile

View file
diff --git a/Makefile b/Makefile
index d138b17..e55726a 100644
--- a/Makefile
+++ b/Makefile
@@ -151,9 +151,6 @@ endif
export KBUILD_EXTMOD
-# backward compatibility
-KBUILD_EXTRA_WARN ?= $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)
-
ifeq ("$(origin W)", "command line")
KBUILD_EXTRA_WARN := $(W)
endif
@@ -928,6 +925,9 @@ KBUILD_CFLAGS += $(CC_AUTO_VAR_INIT_ZERO_ENABLER)
endif
endif
+# Explicitly clear padding bits during variable initialization
+KBUILD_CFLAGS += $(call cc-option,-fzero-init-padding-bits=all)
+
# While VLAs have been removed, GCC produces unreachable stack probes
# for the randomize_kstack_offset feature. Disable it for all compilers.
KBUILD_CFLAGS += $(call cc-option, -fno-stack-clash-protection)
@@ -1070,7 +1070,8 @@ endif
# change __FILE__ to the relative path to the source directory
ifdef building_out_of_srctree
-KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srcroot)/=)
+KBUILD_CPPFLAGS += $(call cc-option,-ffile-prefix-map=$(srcroot)/=)
+KBUILD_RUSTFLAGS += --remap-path-prefix=$(srcroot)/=
endif
# include additional Makefiles when needed
@@ -1122,6 +1123,10 @@ ifdef CONFIG_LD_ORPHAN_WARN
LDFLAGS_vmlinux += --orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL)
endif
+ifneq ($(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS),)
+LDFLAGS_vmlinux += --emit-relocs --discard-none
+endif
+
# Align the bit size of userspace programs with the kernel
KBUILD_USERCFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
KBUILD_USERLDFLAGS += $(filter -m32 -m64 --target=%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS))
@@ -1364,9 +1369,12 @@ hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj
PHONY += headers
headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts
- $(if $(filter um, $(SRCARCH)), $(error Headers not exportable for UML))
+ifdef HEADER_ARCH
+ $(Q)$(MAKE) -f $(srctree)/Makefile HEADER_ARCH= SRCARCH=$(HEADER_ARCH) headers
+else
$(Q)$(MAKE) $(hdr-inst)=include/uapi
$(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi
+endif
ifdef CONFIG_HEADERS_INSTALL
prepare: headers
@@ -1564,7 +1572,7 @@ endif # CONFIG_MODULES
# Directories & files removed with 'make clean'
CLEAN_FILES += vmlinux.symvers modules-only.symvers \
modules.builtin modules.builtin.modinfo modules.nsdeps \
- modules.builtin.ranges vmlinux.o.map \
+ modules.builtin.ranges vmlinux.o.map vmlinux.unstripped \
compile_commands.json rust/test \
rust-project.json .vmlinux.objs .vmlinux.export.c \
.builtin-dtbs-list .builtin-dtb.S
@@ -1667,7 +1675,8 @@ help:
@echo ' kernelrelease - Output the release version string (use with make -s)'
@echo ' kernelversion - Output the version stored in Makefile (use with make -s)'
@echo ' image_name - Output the image name (use with make -s)'
- @echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \
+ @echo ' headers - Build ready-to-install UAPI headers in usr/include'
+ @echo ' headers_install - Install sanitised kernel UAPI headers to INSTALL_HDR_PATH'; \
echo ' (default: $(INSTALL_HDR_PATH))'; \
echo ''
@echo 'Static analysers:'

arch/Kconfig

View file
diff --git a/arch/Kconfig b/arch/Kconfig
index 9f6eb09..b0adb66 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1699,6 +1699,13 @@ config ARCH_HAS_KERNEL_FPU_SUPPORT
Architectures that select this option can run floating-point code in
the kernel, as described in Documentation/core-api/floating-point.rst.
+config ARCH_VMLINUX_NEEDS_RELOCS
+ bool
+ help
+ Whether the architecture needs vmlinux to be built with static
+ relocations preserved. This is used by some architectures to
+ construct bespoke relocation tables for KASLR.
+
source "kernel/gcov/Kconfig"
source "scripts/gcc-plugins/Kconfig"

arch/arm64/Makefile

View file
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 2b25d67..1d5dfcd 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -48,7 +48,7 @@ KBUILD_CFLAGS += $(CC_FLAGS_NO_FPU) \
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
KBUILD_AFLAGS += $(compat_vdso)
-ifeq ($(call test-ge, $(CONFIG_RUSTC_VERSION), 108500),y)
+ifeq ($(call rustc-min-version, 108500),y)
KBUILD_RUSTFLAGS += --target=aarch64-unknown-none-softfloat
else
KBUILD_RUSTFLAGS += --target=aarch64-unknown-none -Ctarget-feature="-neon"

arch/mips/Kconfig

View file
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 8592826..fc0772c 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -2618,6 +2618,7 @@ config RELOCATABLE
CPU_MIPS32_R6 || CPU_MIPS64_R6 || \
CPU_P5600 || CAVIUM_OCTEON_SOC || \
CPU_LOONGSON64
+ select ARCH_VMLINUX_NEEDS_RELOCS
help
This builds a kernel image that retains relocation information
so it can be loaded someplace besides the default 1MB.

arch/mips/Makefile

View file
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index be8cb44..d9057e2 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -100,10 +100,6 @@ LDFLAGS_vmlinux += -G 0 -static -n -nostdlib
KBUILD_AFLAGS_MODULE += -mlong-calls
KBUILD_CFLAGS_MODULE += -mlong-calls
-ifeq ($(CONFIG_RELOCATABLE),y)
-LDFLAGS_vmlinux += --emit-relocs
-endif
-
cflags-y += -ffreestanding
cflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB

arch/mips/Makefile.postlink

View file
diff --git a/arch/mips/Makefile.postlink b/arch/mips/Makefile.postlink
index 6cfdc14..ea0add7 100644
--- a/arch/mips/Makefile.postlink
+++ b/arch/mips/Makefile.postlink
@@ -22,7 +22,7 @@ quiet_cmd_relocs = RELOCS $@
# `@true` prevents complaint when there is nothing to be done
-vmlinux: FORCE
+vmlinux vmlinux.unstripped: FORCE
@true
ifeq ($(CONFIG_CPU_LOONGSON3_WORKAROUNDS),y)
$(call if_changed,ls3_llsc)

arch/nios2/Kbuild

View file
diff --git a/arch/nios2/Kbuild b/arch/nios2/Kbuild
index fc2952e..fa64c59 100644
--- a/arch/nios2/Kbuild
+++ b/arch/nios2/Kbuild
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
-obj-y += kernel/ mm/ platform/ boot/dts/
+obj-y += kernel/ mm/ platform/
# for cleaning
subdir- += boot

arch/nios2/boot/dts/Makefile

View file
diff --git a/arch/nios2/boot/dts/Makefile b/arch/nios2/boot/dts/Makefile
index 1a2e899..1b8f41c 100644
--- a/arch/nios2/boot/dts/Makefile
+++ b/arch/nios2/boot/dts/Makefile
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-2.0
-obj-y := $(patsubst %.dts,%.dtb.o,$(CONFIG_NIOS2_DTB_SOURCE))
+dtb-y := $(addsuffix .dtb, $(CONFIG_BUILTIN_DTB_NAME))
-dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts))
+dtb-$(CONFIG_OF_ALL_DTBS) += $(patsubst $(src)/%.dts,%.dtb, $(wildcard $(src)/*.dts))

arch/nios2/kernel/prom.c

View file
diff --git a/arch/nios2/kernel/prom.c b/arch/nios2/kernel/prom.c
index db04924..4f8c14d 100644
--- a/arch/nios2/kernel/prom.c
+++ b/arch/nios2/kernel/prom.c
@@ -32,7 +32,7 @@ void __init early_init_devtree(void *params)
}
#endif
-#ifdef CONFIG_NIOS2_DTB_SOURCE_BOOL
+#ifdef CONFIG_BUILTIN_DTB
if (be32_to_cpu((__be32) *dtb) == OF_DT_HEADER)
params = (void *)__dtb_start;
#endif

arch/nios2/platform/Kconfig.platform

View file
diff --git a/arch/nios2/platform/Kconfig.platform b/arch/nios2/platform/Kconfig.platform
index e849daf..c75cadd 100644
--- a/arch/nios2/platform/Kconfig.platform
+++ b/arch/nios2/platform/Kconfig.platform
@@ -35,19 +35,20 @@ config NIOS2_DTB_PHYS_ADDR
help
Physical address of a dtb blob.
-config NIOS2_DTB_SOURCE_BOOL
+config BUILTIN_DTB
bool "Compile and link device tree into kernel image"
depends on !COMPILE_TEST
+ select GENERIC_BUILTIN_DTB
help
This allows you to specify a dts (device tree source) file
which will be compiled and linked into the kernel image.
-config NIOS2_DTB_SOURCE
- string "Device tree source file"
- depends on NIOS2_DTB_SOURCE_BOOL
+config BUILTIN_DTB_NAME
+ string "Built-in device tree name"
+ depends on BUILTIN_DTB
default ""
help
- Absolute path to the device tree source (dts) file describing your
+ Relative path to the device tree without suffix describing your
system.
comment "Nios II instructions"

arch/riscv/Kconfig

View file
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 1fd197a..bbec87b 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -1108,6 +1108,7 @@ config RELOCATABLE
bool "Build a relocatable kernel"
depends on !XIP_KERNEL
select MODULE_SECTIONS if MODULES
+ select ARCH_VMLINUX_NEEDS_RELOCS
help
This builds a kernel as a Position Independent Executable (PIE),
which retains all relocation metadata required to relocate the

arch/riscv/Makefile

View file
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 600df90..539d2ae 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -8,7 +8,7 @@
LDFLAGS_vmlinux := -z norelro
ifeq ($(CONFIG_RELOCATABLE),y)
- LDFLAGS_vmlinux += -shared -Bsymbolic -z notext --emit-relocs
+ LDFLAGS_vmlinux += -shared -Bsymbolic -z notext
KBUILD_CFLAGS += -fPIE
endif
ifeq ($(CONFIG_DYNAMIC_FTRACE),y)

arch/riscv/Makefile.postlink

View file
diff --git a/arch/riscv/Makefile.postlink b/arch/riscv/Makefile.postlink
index 6b05809..0e4cf8a 100644
--- a/arch/riscv/Makefile.postlink
+++ b/arch/riscv/Makefile.postlink
@@ -10,26 +10,17 @@ __archpost:
-include include/config/auto.conf
include $(srctree)/scripts/Kbuild.include
-include $(srctree)/scripts/Makefile.lib
quiet_cmd_relocs_check = CHKREL $@
cmd_relocs_check = \
$(CONFIG_SHELL) $(srctree)/arch/riscv/tools/relocs_check.sh "$(OBJDUMP)" "$(NM)" "$@"
-ifdef CONFIG_RELOCATABLE
-quiet_cmd_cp_vmlinux_relocs = CPREL vmlinux.relocs
-cmd_cp_vmlinux_relocs = cp vmlinux vmlinux.relocs
-
-endif
-
# `@true` prevents complaint when there is nothing to be done
-vmlinux: FORCE
+vmlinux vmlinux.unstripped: FORCE
@true
ifdef CONFIG_RELOCATABLE
$(call if_changed,relocs_check)
- $(call if_changed,cp_vmlinux_relocs)
- $(call if_changed,strip_relocs)
endif
clean:

arch/riscv/boot/Makefile

View file
diff --git a/arch/riscv/boot/Makefile b/arch/riscv/boot/Makefile
index b25d524..bfc3d0b 100644
--- a/arch/riscv/boot/Makefile
+++ b/arch/riscv/boot/Makefile
@@ -32,10 +32,7 @@ $(obj)/xipImage: vmlinux FORCE
endif
ifdef CONFIG_RELOCATABLE
-vmlinux.relocs: vmlinux
- @ (! [ -f vmlinux.relocs ] && echo "vmlinux.relocs can't be found, please remove vmlinux and try again") || true
-
-$(obj)/Image: vmlinux.relocs FORCE
+$(obj)/Image: vmlinux.unstripped FORCE
else
$(obj)/Image: vmlinux FORCE
endif

arch/s390/Kconfig

View file
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 44771ee..db8161e 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -631,6 +631,7 @@ endchoice
config RELOCATABLE
def_bool y
+ select ARCH_VMLINUX_NEEDS_RELOCS
help
This builds a kernel image that retains relocation information
so it can be loaded at an arbitrary address.

arch/s390/Makefile

View file
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index fd3b70d..b06dc53 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -15,7 +15,7 @@ KBUILD_CFLAGS_MODULE += -fPIC
KBUILD_AFLAGS += -m64
KBUILD_CFLAGS += -m64
KBUILD_CFLAGS += -fPIC
-LDFLAGS_vmlinux := $(call ld-option,-no-pie) --emit-relocs --discard-none
+LDFLAGS_vmlinux := $(call ld-option,-no-pie)
extra_tools := relocs
aflags_dwarf := -Wa,-gdwarf-2
KBUILD_AFLAGS_DECOMPRESSOR := $(CLANG_FLAGS) -m64 -D__ASSEMBLY__

arch/s390/Makefile.postlink

View file
diff --git a/arch/s390/Makefile.postlink b/arch/s390/Makefile.postlink
index 1ae5478..c2b7375 100644
--- a/arch/s390/Makefile.postlink
+++ b/arch/s390/Makefile.postlink
@@ -11,7 +11,6 @@ __archpost:
-include include/config/auto.conf
include $(srctree)/scripts/Kbuild.include
-include $(srctree)/scripts/Makefile.lib
CMD_RELOCS=arch/s390/tools/relocs
OUT_RELOCS = arch/s390/boot
@@ -20,9 +19,8 @@ quiet_cmd_relocs = RELOCS $(OUT_RELOCS)/relocs.S

This diff is incomplete. Download the complete patch.

arch/x86/Kconfig

View file

This diff is incomplete. Download the complete patch.

arch/x86/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/x86/Makefile.postlink

View before deletion

This diff is incomplete. Download the complete patch.

arch/x86/boot/Makefile

View file

This diff is incomplete. Download the complete patch.

arch/x86/boot/compressed/Makefile

View file

This diff is incomplete. Download the complete patch.

kernel/gen_kheaders.sh

View file

This diff is incomplete. Download the complete patch.

lib/Kconfig.debug

View file

This diff is incomplete. Download the complete patch.

rust/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.compiler

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.lib

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.vmlinux

View file

This diff is incomplete. Download the complete patch.

scripts/bash-completion/make

View file

This diff is incomplete. Download the complete patch.

scripts/checkpatch.pl

View file

This diff is incomplete. Download the complete patch.

scripts/clang-tools/gen_compile_commands.py

View file

This diff is incomplete. Download the complete patch.

scripts/config

View file

This diff is incomplete. Download the complete patch.

scripts/gendwarfksyms/die.c

View file

This diff is incomplete. Download the complete patch.

scripts/gendwarfksyms/dwarf.c

View file

This diff is incomplete. Download the complete patch.

scripts/gendwarfksyms/gendwarfksyms.h

View file

This diff is incomplete. Download the complete patch.

scripts/gendwarfksyms/types.c

View file

This diff is incomplete. Download the complete patch.

scripts/generate_builtin_ranges.awk

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/kconfig/confdata.c

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/kconfig/symbol.c

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/mod/modpost.c

View file

This diff is incomplete. Download the complete patch.

scripts/mod/modpost.h

View file

This diff is incomplete. Download the complete patch.

scripts/mod/sumversion.c

View file

This diff is incomplete. Download the complete patch.

scripts/package/PKGBUILD

View file

This diff is incomplete. Download the complete patch.

scripts/package/debian/rules

View file

This diff is incomplete. Download the complete patch.

scripts/package/kernel.spec

View file

This diff is incomplete. Download the complete patch.

scripts/package/mkdebian

View file

This diff is incomplete. Download the complete patch.

scripts/package/mkspec

View file

This diff is incomplete. Download the complete patch.

scripts/show_delta

View file

This diff is incomplete. Download the complete patch.