summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-04-29 14:24:39 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-04-29 14:24:39 -0700
commitb0030af53a74a08c77ea11d3888da21542af2d0e (patch)
tree04130d622fdb59ee3ee1bbc015110f4054e32a8b /init
parent9d31d2338950293ec19d9b095fbaa9030899dcb4 (diff)
parentf634ca650f724347892068489c7920631a3aac6a (diff)
Merge tag 'kbuild-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada: - Evaluate $(call cc-option,...) etc. only for build targets - Add CONFIG_VMLINUX_MAP to generate .map file when linking vmlinux - Remove unnecessary --gcc-toolchains Clang flag because the --prefix flag finds the toolchains - Do not pass Clang's --prefix flag when using the integrated as - Check the assembler version in Kconfig time - Add new CONFIG options, AS_VERSION, AS_IS_GNU, AS_IS_LLVM to clean up some dependencies in Kconfig - Fix invalid Module.symvers creation when building only modules without vmlinux - Fix false-positive modpost warnings when CONFIG_TRIM_UNUSED_KSYMS is set, but there is no module to build - Refactor module installation Makefile - Support zstd for module compression - Convert alpha and ia64 to use generic shell scripts to generate the syscall headers - Add a new elfnote to indicate if the kernel was built with LTO, which will be used by pahole - Flatten the directory structure under include/config/ so CONFIG options and filenames match - Change the deb source package name from linux-$(KERNELRELEASE) to linux-upstream * tag 'kbuild-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (42 commits) kbuild: Add $(KBUILD_HOSTLDFLAGS) to 'has_libelf' test kbuild: deb-pkg: change the source package name to linux-upstream tools: do not include scripts/Kbuild.include kbuild: redo fake deps at include/config/*.h kbuild: remove TMPO from try-run MAINTAINERS: add pattern for dummy-tools kbuild: add an elfnote for whether vmlinux is built with lto ia64: syscalls: switch to generic syscallhdr.sh ia64: syscalls: switch to generic syscalltbl.sh alpha: syscalls: switch to generic syscallhdr.sh alpha: syscalls: switch to generic syscalltbl.sh sysctl: use min() helper for namecmp() kbuild: add support for zstd compressed modules kbuild: remove CONFIG_MODULE_COMPRESS kbuild: merge scripts/Makefile.modsign to scripts/Makefile.modinst kbuild: move module strip/compression code into scripts/Makefile.modinst kbuild: refactor scripts/Makefile.modinst kbuild: rename extmod-prefix to extmod_prefix kbuild: check module name conflict for external modules as well kbuild: show the target directory for depmod log ...
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig65
-rw-r--r--init/version.c2
2 files changed, 47 insertions, 20 deletions
diff --git a/init/Kconfig b/init/Kconfig
index ca559ccdaa32..d97d205cd1ef 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -21,7 +21,7 @@ config CC_VERSION_TEXT
- Ensure full rebuild when the compiler is updated
include/linux/compiler-version.h contains this option in the comment
- line so fixdep adds include/config/cc/version/text.h into the
+ line so fixdep adds include/config/CC_VERSION_TEXT into the
auto-generated dependency. When the compiler is updated, syncconfig
will touch it and then every file will be rebuilt.
@@ -41,6 +41,18 @@ config CLANG_VERSION
default $(cc-version) if CC_IS_CLANG
default 0
+config AS_IS_GNU
+ def_bool $(success,test "$(as-name)" = GNU)
+
+config AS_IS_LLVM
+ def_bool $(success,test "$(as-name)" = LLVM)
+
+config AS_VERSION
+ int
+ # Use clang version if this is the integrated assembler
+ default CLANG_VERSION if AS_IS_LLVM
+ default $(as-version)
+
config LD_IS_BFD
def_bool $(success,test "$(ld-name)" = BFD)
@@ -2229,40 +2241,53 @@ config MODULE_SIG_HASH
default "sha384" if MODULE_SIG_SHA384
default "sha512" if MODULE_SIG_SHA512
-config MODULE_COMPRESS
- bool "Compress modules on installation"
+choice
+ prompt "Module compression mode"
help
+ This option allows you to choose the algorithm which will be used to
+ compress modules when 'make modules_install' is run. (or, you can
+ choose to not compress modules at all.)
- Compresses kernel modules when 'make modules_install' is run; gzip or
- xz depending on "Compression algorithm" below.
+ External modules will also be compressed in the same way during the
+ installation.
- module-init-tools MAY support gzip, and kmod MAY support gzip and xz.
+ For modules inside an initrd or initramfs, it's more efficient to
+ compress the whole initrd or initramfs instead.
- Out-of-tree kernel modules installed using Kbuild will also be
- compressed upon installation.
+ This is fully compatible with signed modules.
- Note: for modules inside an initrd or initramfs, it's more efficient
- to compress the whole initrd or initramfs instead.
+ Please note that the tool used to load modules needs to support the
+ corresponding algorithm. module-init-tools MAY support gzip, and kmod
+ MAY support gzip, xz and zstd.
- Note: This is fully compatible with signed modules.
+ Your build system needs to provide the appropriate compression tool
+ to compress the modules.
- If in doubt, say N.
+ If in doubt, select 'None'.
-choice
- prompt "Compression algorithm"
- depends on MODULE_COMPRESS
- default MODULE_COMPRESS_GZIP
+config MODULE_COMPRESS_NONE
+ bool "None"
help
- This determines which sort of compression will be used during
- 'make modules_install'.
-
- GZIP (default) and XZ are supported.
+ Do not compress modules. The installed modules are suffixed
+ with .ko.
config MODULE_COMPRESS_GZIP
bool "GZIP"
+ help
+ Compress modules with GZIP. The installed modules are suffixed
+ with .ko.gz.
config MODULE_COMPRESS_XZ
bool "XZ"
+ help
+ Compress modules with XZ. The installed modules are suffixed
+ with .ko.xz.
+
+config MODULE_COMPRESS_ZSTD
+ bool "ZSTD"
+ help
+ Compress modules with ZSTD. The installed modules are suffixed
+ with .ko.zst.
endchoice
diff --git a/init/version.c b/init/version.c
index 92afc782b043..1a356f5493e8 100644
--- a/init/version.c
+++ b/init/version.c
@@ -9,6 +9,7 @@
#include <generated/compile.h>
#include <linux/build-salt.h>
+#include <linux/elfnote-lto.h>
#include <linux/export.h>
#include <linux/uts.h>
#include <linux/utsname.h>
@@ -45,3 +46,4 @@ const char linux_proc_banner[] =
" (" LINUX_COMPILER ") %s\n";
BUILD_SALT;
+BUILD_LTO_INFO;