Commit 0af5cb34 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull Kbuild updates from Masahiro Yamada:

 - Remove the support for -O3 (CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3)

 - Fix error of rpm-pkg cross-builds

 - Support riscv for checkstack tool

 - Re-enable -Wformwat warnings for Clang

 - Clean up modpost, Makefiles, and misc scripts

* tag 'kbuild-v5.20' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (30 commits)
  modpost: remove .symbol_white_list field entirely
  modpost: remove unneeded .symbol_white_list initializers
  modpost: add PATTERNS() helper macro
  modpost: shorten warning messages in report_sec_mismatch()
  Revert "Kbuild, lto, workaround: Don't warn for initcall_reference in modpost"
  modpost: use more reliable way to get fromsec in section_rel(a)()
  modpost: add array range check to sec_name()
  modpost: refactor get_secindex()
  kbuild: set EXIT trap before creating temporary directory
  modpost: remove unused Elf_Sword macro
  Makefile.extrawarn: re-enable -Wformat for clang
  kbuild: add dtbs_prepare target
  kconfig: Qt5: tell the user which packages are required
  modpost: use sym_get_data() to get module device_table data
  modpost: drop executable ELF support
  checkstack: add riscv support for scripts/checkstack.pl
  kconfig: shorten the temporary directory name for cc-option
  scripts: headers_install.sh: Update config leak ignore entries
  kbuild: error out if $(INSTALL_MOD_PATH) contains % or :
  kbuild: error out if $(KBUILD_EXTMOD) contains % or :
  ...
parents d4252071 672fb674
...@@ -672,7 +672,7 @@ Future kconfig work ...@@ -672,7 +672,7 @@ Future kconfig work
Work on kconfig is welcomed on both areas of clarifying semantics and on Work on kconfig is welcomed on both areas of clarifying semantics and on
evaluating the use of a full SAT solver for it. A full SAT solver can be evaluating the use of a full SAT solver for it. A full SAT solver can be
desirable to enable more complex dependency mappings and / or queries, desirable to enable more complex dependency mappings and / or queries,
for instance on possible use case for a SAT solver could be that of handling for instance one possible use case for a SAT solver could be that of handling
the current known recursive dependency issues. It is not known if this would the current known recursive dependency issues. It is not known if this would
address such issues but such evaluation is desirable. If support for a full SAT address such issues but such evaluation is desirable. If support for a full SAT
solver proves too complex or that it cannot address recursive dependency issues solver proves too complex or that it cannot address recursive dependency issues
......
...@@ -4783,7 +4783,6 @@ L: keyrings@vger.kernel.org ...@@ -4783,7 +4783,6 @@ L: keyrings@vger.kernel.org
S: Maintained S: Maintained
F: Documentation/admin-guide/module-signing.rst F: Documentation/admin-guide/module-signing.rst
F: certs/ F: certs/
F: scripts/check-blacklist-hashes.awk
F: scripts/sign-file.c F: scripts/sign-file.c
F: tools/certs/ F: tools/certs/
......
...@@ -129,6 +129,9 @@ endif ...@@ -129,6 +129,9 @@ endif
$(if $(word 2, $(KBUILD_EXTMOD)), \ $(if $(word 2, $(KBUILD_EXTMOD)), \
$(error building multiple external modules is not supported)) $(error building multiple external modules is not supported))
$(foreach x, % :, $(if $(findstring $x, $(KBUILD_EXTMOD)), \
$(error module directory path cannot contain '$x')))
# Remove trailing slashes # Remove trailing slashes
ifneq ($(filter %/, $(KBUILD_EXTMOD)),) ifneq ($(filter %/, $(KBUILD_EXTMOD)),)
KBUILD_EXTMOD := $(shell dirname $(KBUILD_EXTMOD).) KBUILD_EXTMOD := $(shell dirname $(KBUILD_EXTMOD).)
...@@ -755,8 +758,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) ...@@ -755,8 +758,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
KBUILD_CFLAGS += -O2 KBUILD_CFLAGS += -O2
else ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3
KBUILD_CFLAGS += -O3
else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE else ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += -Os KBUILD_CFLAGS += -Os
endif endif
...@@ -1370,16 +1371,21 @@ endif ...@@ -1370,16 +1371,21 @@ endif
ifneq ($(dtstree),) ifneq ($(dtstree),)
%.dtb: include/config/kernel.release scripts_dtc %.dtb: dtbs_prepare
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
%.dtbo: include/config/kernel.release scripts_dtc %.dtbo: dtbs_prepare
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
PHONY += dtbs dtbs_install dtbs_check PHONY += dtbs dtbs_prepare dtbs_install dtbs_check
dtbs: include/config/kernel.release scripts_dtc dtbs: dtbs_prepare
$(Q)$(MAKE) $(build)=$(dtstree) $(Q)$(MAKE) $(build)=$(dtstree)
# include/config/kernel.release is actually needed when installing DTBs because
# INSTALL_DTBS_PATH contains $(KERNELRELEASE). However, we do not want to make
# dtbs_install depend on it as dtbs_install may run as root.
dtbs_prepare: include/config/kernel.release scripts_dtc
ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),) ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
export CHECK_DTBS=y export CHECK_DTBS=y
dtbs: dt_binding_check dtbs: dt_binding_check
......
...@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y ...@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set # CONFIG_UTS_NS is not set
# CONFIG_PID_NS is not set # CONFIG_PID_NS is not set
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_VM_EVENT_COUNTERS is not set
......
...@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y ...@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set # CONFIG_UTS_NS is not set
# CONFIG_PID_NS is not set # CONFIG_PID_NS is not set
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_VM_EVENT_COUNTERS is not set
......
...@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y ...@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set # CONFIG_UTS_NS is not set
# CONFIG_PID_NS is not set # CONFIG_PID_NS is not set
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_VM_EVENT_COUNTERS is not set
......
...@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y ...@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set # CONFIG_UTS_NS is not set
# CONFIG_PID_NS is not set # CONFIG_PID_NS is not set
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_EXPERT=y CONFIG_EXPERT=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_COMPAT_BRK is not set # CONFIG_COMPAT_BRK is not set
......
...@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y ...@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set # CONFIG_UTS_NS is not set
# CONFIG_PID_NS is not set # CONFIG_PID_NS is not set
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_VM_EVENT_COUNTERS is not set
......
...@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y ...@@ -9,7 +9,6 @@ CONFIG_NAMESPACES=y
# CONFIG_PID_NS is not set # CONFIG_PID_NS is not set
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_VM_EVENT_COUNTERS is not set
......
...@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y ...@@ -11,7 +11,6 @@ CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set # CONFIG_UTS_NS is not set
# CONFIG_PID_NS is not set # CONFIG_PID_NS is not set
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_ALL=y
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
......
...@@ -10,7 +10,6 @@ CONFIG_NAMESPACES=y ...@@ -10,7 +10,6 @@ CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set # CONFIG_UTS_NS is not set
# CONFIG_PID_NS is not set # CONFIG_PID_NS is not set
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_ALL=y
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
......
...@@ -10,7 +10,6 @@ CONFIG_NAMESPACES=y ...@@ -10,7 +10,6 @@ CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set # CONFIG_UTS_NS is not set
# CONFIG_PID_NS is not set # CONFIG_PID_NS is not set
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_ALL=y
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
......
...@@ -8,7 +8,6 @@ CONFIG_IKCONFIG_PROC=y ...@@ -8,7 +8,6 @@ CONFIG_IKCONFIG_PROC=y
# CONFIG_UTS_NS is not set # CONFIG_UTS_NS is not set
# CONFIG_PID_NS is not set # CONFIG_PID_NS is not set
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_COMPAT_BRK is not set # CONFIG_COMPAT_BRK is not set
CONFIG_KPROBES=y CONFIG_KPROBES=y
......
...@@ -14,7 +14,6 @@ CONFIG_INITRAMFS_SOURCE="../tb10x-rootfs.cpio" ...@@ -14,7 +14,6 @@ CONFIG_INITRAMFS_SOURCE="../tb10x-rootfs.cpio"
CONFIG_INITRAMFS_ROOT_UID=2100 CONFIG_INITRAMFS_ROOT_UID=2100
CONFIG_INITRAMFS_ROOT_GID=501 CONFIG_INITRAMFS_ROOT_GID=501
# CONFIG_RD_GZIP is not set # CONFIG_RD_GZIP is not set
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_KALLSYMS_ALL=y CONFIG_KALLSYMS_ALL=y
# CONFIG_AIO is not set # CONFIG_AIO is not set
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
......
...@@ -4,7 +4,6 @@ CONFIG_HIGH_RES_TIMERS=y ...@@ -4,7 +4,6 @@ CONFIG_HIGH_RES_TIMERS=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y CONFIG_IKCONFIG_PROC=y
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_VM_EVENT_COUNTERS is not set
......
...@@ -4,7 +4,6 @@ CONFIG_HIGH_RES_TIMERS=y ...@@ -4,7 +4,6 @@ CONFIG_HIGH_RES_TIMERS=y
CONFIG_IKCONFIG=y CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y CONFIG_IKCONFIG_PROC=y
CONFIG_BLK_DEV_INITRD=y CONFIG_BLK_DEV_INITRD=y
CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y
CONFIG_EMBEDDED=y CONFIG_EMBEDDED=y
CONFIG_PERF_EVENTS=y CONFIG_PERF_EVENTS=y
# CONFIG_VM_EVENT_COUNTERS is not set # CONFIG_VM_EVENT_COUNTERS is not set
......
...@@ -4,24 +4,22 @@ ...@@ -4,24 +4,22 @@
# #
obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o
obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o blacklist_hashes.o
obj-$(CONFIG_SYSTEM_REVOCATION_LIST) += revocation_certificates.o obj-$(CONFIG_SYSTEM_REVOCATION_LIST) += revocation_certificates.o
ifneq ($(CONFIG_SYSTEM_BLACKLIST_HASH_LIST),)
$(obj)/blacklist_hashes.o: $(obj)/blacklist_hash_list $(obj)/blacklist_hashes.o: $(obj)/blacklist_hash_list
CFLAGS_blacklist_hashes.o := -I $(obj) CFLAGS_blacklist_hashes.o := -I $(obj)
quiet_cmd_check_and_copy_blacklist_hash_list = GEN $@ quiet_cmd_check_and_copy_blacklist_hash_list = GEN $@
cmd_check_and_copy_blacklist_hash_list = \ cmd_check_and_copy_blacklist_hash_list = \
$(AWK) -f $(srctree)/scripts/check-blacklist-hashes.awk $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) >&2; \ $(if $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST), \
cat $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) > $@ $(AWK) -f $(srctree)/$(src)/check-blacklist-hashes.awk $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) >&2; \
{ cat $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST); echo $(comma) NULL; } > $@, \
echo NULL > $@)
$(obj)/blacklist_hash_list: $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) FORCE $(obj)/blacklist_hash_list: $(CONFIG_SYSTEM_BLACKLIST_HASH_LIST) FORCE
$(call if_changed,check_and_copy_blacklist_hash_list) $(call if_changed,check_and_copy_blacklist_hash_list)
obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_hashes.o
else
obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_nohashes.o
endif
targets += blacklist_hash_list targets += blacklist_hash_list
quiet_cmd_extract_certs = CERT $@ quiet_cmd_extract_certs = CERT $@
......
...@@ -3,5 +3,4 @@ ...@@ -3,5 +3,4 @@
const char __initconst *const blacklist_hashes[] = { const char __initconst *const blacklist_hashes[] = {
#include "blacklist_hash_list" #include "blacklist_hash_list"
, NULL
}; };
// SPDX-License-Identifier: GPL-2.0
#include "blacklist.h"
const char __initconst *const blacklist_hashes[] = {
NULL
};
...@@ -1411,13 +1411,6 @@ config CC_OPTIMIZE_FOR_PERFORMANCE ...@@ -1411,13 +1411,6 @@ config CC_OPTIMIZE_FOR_PERFORMANCE
with the "-O2" compiler flag for best performance and most with the "-O2" compiler flag for best performance and most
helpful compile-time warnings. helpful compile-time warnings.
config CC_OPTIMIZE_FOR_PERFORMANCE_O3
bool "Optimize more for performance (-O3)"
depends on ARC
help
Choosing this option will pass "-O3" to your compiler to optimize
the kernel yet more for performance.
config CC_OPTIMIZE_FOR_SIZE config CC_OPTIMIZE_FOR_SIZE
bool "Optimize for size (-Os)" bool "Optimize for size (-Os)"
help help
...@@ -1733,16 +1726,17 @@ config KALLSYMS_ALL ...@@ -1733,16 +1726,17 @@ config KALLSYMS_ALL
help help
Normally kallsyms only contains the symbols of functions for nicer Normally kallsyms only contains the symbols of functions for nicer
OOPS messages and backtraces (i.e., symbols from the text and inittext OOPS messages and backtraces (i.e., symbols from the text and inittext
sections). This is sufficient for most cases. And only in very rare sections). This is sufficient for most cases. And only if you want to
cases (e.g., when a debugger is used) all symbols are required (e.g., enable kernel live patching, or other less common use cases (e.g.,
names of variables from the data sections, etc). when a debugger is used) all symbols are required (i.e., names of
variables from the data sections, etc).
This option makes sure that all symbols are loaded into the kernel This option makes sure that all symbols are loaded into the kernel
image (i.e., symbols from all sections) in cost of increased kernel image (i.e., symbols from all sections) in cost of increased kernel
size (depending on the kernel configuration, it may be 300KiB or size (depending on the kernel configuration, it may be 300KiB or
something like this). something like this).
Say N unless you really need all symbols. Say N unless you really need all symbols, or kernel live patching.
config KALLSYMS_ABSOLUTE_PERCPU config KALLSYMS_ABSOLUTE_PERCPU
bool bool
......
...@@ -25,7 +25,7 @@ failure = $(if-success,$(1),n,y) ...@@ -25,7 +25,7 @@ failure = $(if-success,$(1),n,y)
# $(cc-option,<flag>) # $(cc-option,<flag>)
# Return y if the compiler supports <flag>, n otherwise # Return y if the compiler supports <flag>, n otherwise
cc-option = $(success,mkdir .tmp_$$$$; trap "rm -rf .tmp_$$$$" EXIT; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$$$/tmp.o) cc-option = $(success,trap "rm -rf .tmp_$$" EXIT; mkdir .tmp_$$; $(CC) -Werror $(CLANG_FLAGS) $(1) -c -x c /dev/null -o .tmp_$$/tmp.o)
# $(ld-option,<flag>) # $(ld-option,<flag>)
# Return y if the linker supports <flag>, n otherwise # Return y if the linker supports <flag>, n otherwise
......
...@@ -358,9 +358,8 @@ $(subdir-modorder): $(obj)/%/modules.order: $(obj)/% ; ...@@ -358,9 +358,8 @@ $(subdir-modorder): $(obj)/%/modules.order: $(obj)/% ;
quiet_cmd_ar_builtin = AR $@ quiet_cmd_ar_builtin = AR $@
cmd_ar_builtin = rm -f $@; \ cmd_ar_builtin = rm -f $@; \
echo $(patsubst $(obj)/%,%,$(real-prereqs)) | \ $(if $(real-prereqs), printf "$(obj)/%s " $(patsubst $(obj)/%,%,$(real-prereqs)) | xargs) \
sed -E 's:([^ ]+):$(obj)/\1:g' | \ $(AR) cDPrST $@
xargs $(AR) cDPrST $@
$(obj)/built-in.a: $(real-obj-y) FORCE $(obj)/built-in.a: $(real-obj-y) FORCE
$(call if_changed,ar_builtin) $(call if_changed,ar_builtin)
......
...@@ -21,8 +21,8 @@ TMPOUT = $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_$$$$ ...@@ -21,8 +21,8 @@ TMPOUT = $(if $(KBUILD_EXTMOD),$(firstword $(KBUILD_EXTMOD))/).tmp_$$$$
# automatically cleaned up. # automatically cleaned up.
try-run = $(shell set -e; \ try-run = $(shell set -e; \
TMP=$(TMPOUT)/tmp; \ TMP=$(TMPOUT)/tmp; \
mkdir -p $(TMPOUT); \
trap "rm -rf $(TMPOUT)" EXIT; \ trap "rm -rf $(TMPOUT)" EXIT; \
mkdir -p $(TMPOUT); \
if ($(1)) >/dev/null 2>&1; \ if ($(1)) >/dev/null 2>&1; \
then echo "$(2)"; \ then echo "$(2)"; \
else echo "$(3)"; \ else echo "$(3)"; \
......
...@@ -47,7 +47,6 @@ else ...@@ -47,7 +47,6 @@ else
ifdef CONFIG_CC_IS_CLANG ifdef CONFIG_CC_IS_CLANG
KBUILD_CFLAGS += -Wno-initializer-overrides KBUILD_CFLAGS += -Wno-initializer-overrides
KBUILD_CFLAGS += -Wno-format
KBUILD_CFLAGS += -Wno-sign-compare KBUILD_CFLAGS += -Wno-sign-compare
KBUILD_CFLAGS += -Wno-format-zero-length KBUILD_CFLAGS += -Wno-format-zero-length
KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast) KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast)
......
...@@ -18,6 +18,9 @@ INSTALL_MOD_DIR ?= extra ...@@ -18,6 +18,9 @@ INSTALL_MOD_DIR ?= extra
dst := $(MODLIB)/$(INSTALL_MOD_DIR) dst := $(MODLIB)/$(INSTALL_MOD_DIR)
endif endif
$(foreach x, % :, $(if $(findstring $x, $(dst)), \
$(error module installation path cannot contain '$x')))
suffix-y := suffix-y :=
suffix-$(CONFIG_MODULE_COMPRESS_GZIP) := .gz suffix-$(CONFIG_MODULE_COMPRESS_GZIP) := .gz
suffix-$(CONFIG_MODULE_COMPRESS_XZ) := .xz suffix-$(CONFIG_MODULE_COMPRESS_XZ) := .xz
......
...@@ -56,7 +56,7 @@ rpm-pkg: ...@@ -56,7 +56,7 @@ rpm-pkg:
$(MAKE) clean $(MAKE) clean
$(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec
$(call cmd,src_tar,$(KERNELPATH),kernel.spec) $(call cmd,src_tar,$(KERNELPATH),kernel.spec)
+rpmbuild $(RPMOPTS) --target $(UTS_MACHINE) -ta $(KERNELPATH).tar.gz \ +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -ta $(KERNELPATH).tar.gz \
--define='_smp_mflags %{nil}' --define='_smp_mflags %{nil}'
# binrpm-pkg # binrpm-pkg
...@@ -66,7 +66,7 @@ binrpm-pkg: ...@@ -66,7 +66,7 @@ binrpm-pkg:
$(MAKE) -f $(srctree)/Makefile $(MAKE) -f $(srctree)/Makefile
$(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec
+rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \
$(UTS_MACHINE) -bb $(objtree)/binkernel.spec $(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec
PHONY += deb-pkg PHONY += deb-pkg
deb-pkg: deb-pkg:
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
# AArch64, PARISC ports by Kyle McMartin # AArch64, PARISC ports by Kyle McMartin
# sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk> # sparc port by Martin Habets <errandir_news@mph.eclipse.co.uk>
# ppc64le port by Breno Leitao <leitao@debian.org> # ppc64le port by Breno Leitao <leitao@debian.org>
# riscv port by Wadim Mueller <wafgo01@gmail.com>
# #
# Usage: # Usage:
# objdump -d vmlinux | scripts/checkstack.pl [arch] # objdump -d vmlinux | scripts/checkstack.pl [arch]
...@@ -108,6 +109,9 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_stack); ...@@ -108,6 +109,9 @@ my (@stack, $re, $dre, $sub, $x, $xs, $funcre, $min_stack);
} elsif ($arch eq 'sparc' || $arch eq 'sparc64') { } elsif ($arch eq 'sparc' || $arch eq 'sparc64') {
# f0019d10: 9d e3 bf 90 save %sp, -112, %sp # f0019d10: 9d e3 bf 90 save %sp, -112, %sp
$re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o; $re = qr/.*save.*%sp, -(([0-9]{2}|[3-9])[0-9]{2}), %sp/o;
} elsif ($arch =~ /^riscv(64)?$/) {
#ffffffff8036e868: c2010113 addi sp,sp,-992
$re = qr/.*addi.*sp,sp,-(([0-9]{2}|[3-9])[0-9]{2})/o;
} else { } else {
print("wrong or unknown architecture \"$arch\"\n"); print("wrong or unknown architecture \"$arch\"\n");
exit exit
......
...@@ -96,12 +96,8 @@ fi ...@@ -96,12 +96,8 @@ fi
# To set GCC_PLUGINS # To set GCC_PLUGINS
if arg_contain -print-file-name=plugin "$@"; then if arg_contain -print-file-name=plugin "$@"; then
plugin_dir=$(mktemp -d) # Use $0 to find the in-tree dummy directory
echo "$(dirname "$(readlink -f "$0")")/dummy-plugin-dir"
mkdir -p $plugin_dir/include
touch $plugin_dir/include/plugin-version.h
echo $plugin_dir
exit 0 exit 0
fi fi
......
...@@ -70,7 +70,6 @@ configs=$(sed -e ' ...@@ -70,7 +70,6 @@ configs=$(sed -e '
# #
# The format is <file-name>:<CONFIG-option> in each line. # The format is <file-name>:<CONFIG-option> in each line.
config_leak_ignores=" config_leak_ignores="
arch/alpha/include/uapi/asm/setup.h:CONFIG_ALPHA_LEGACY_START_ADDRESS
arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_16K arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_16K
arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_4K arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_4K
arch/arc/include/uapi/asm/swab.h:CONFIG_ARC_HAS_SWAPE arch/arc/include/uapi/asm/swab.h:CONFIG_ARC_HAS_SWAPE
...@@ -84,7 +83,6 @@ arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT ...@@ -84,7 +83,6 @@ arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT
arch/x86/include/uapi/asm/auxvec.h:CONFIG_IA32_EMULATION arch/x86/include/uapi/asm/auxvec.h:CONFIG_IA32_EMULATION
arch/x86/include/uapi/asm/auxvec.h:CONFIG_X86_64 arch/x86/include/uapi/asm/auxvec.h:CONFIG_X86_64
arch/x86/include/uapi/asm/mman.h:CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS arch/x86/include/uapi/asm/mman.h:CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
include/uapi/asm-generic/fcntl.h:CONFIG_64BIT
include/uapi/linux/atmdev.h:CONFIG_COMPAT include/uapi/linux/atmdev.h:CONFIG_COMPAT
include/uapi/linux/eventpoll.h:CONFIG_PM_SLEEP include/uapi/linux/eventpoll.h:CONFIG_PM_SLEEP
include/uapi/linux/hw_breakpoint.h:CONFIG_HAVE_MIXED_BREAKPOINTS_REGS include/uapi/linux/hw_breakpoint.h:CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
......
...@@ -20,5 +20,6 @@ fi ...@@ -20,5 +20,6 @@ fi
echo >&2 "*" echo >&2 "*"
echo >&2 "* Could not find Qt5 via ${HOSTPKG_CONFIG}." echo >&2 "* Could not find Qt5 via ${HOSTPKG_CONFIG}."
echo >&2 "* Please install Qt5 and make sure it's in PKG_CONFIG_PATH" echo >&2 "* Please install Qt5 and make sure it's in PKG_CONFIG_PATH"
echo >&2 "* You need $PKG"
echo >&2 "*" echo >&2 "*"
exit 1 exit 1
...@@ -1571,9 +1571,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, ...@@ -1571,9 +1571,7 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
zeros = calloc(1, sym->st_size); zeros = calloc(1, sym->st_size);
symval = zeros; symval = zeros;
} else { } else {
symval = (void *)info->hdr symval = sym_get_data(info, sym);
+ info->sechdrs[get_secindex(info, sym)].sh_offset
+ sym->st_value;
} }
/* First handle the "special" cases */ /* First handle the "special" cases */
......
This diff is collapsed.
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#define Elf_Shdr Elf32_Shdr #define Elf_Shdr Elf32_Shdr
#define Elf_Sym Elf32_Sym #define Elf_Sym Elf32_Sym
#define Elf_Addr Elf32_Addr #define Elf_Addr Elf32_Addr
#define Elf_Sword Elf64_Sword
#define Elf_Section Elf32_Half #define Elf_Section Elf32_Half
#define ELF_ST_BIND ELF32_ST_BIND #define ELF_ST_BIND ELF32_ST_BIND
#define ELF_ST_TYPE ELF32_ST_TYPE #define ELF_ST_TYPE ELF32_ST_TYPE
...@@ -41,7 +40,6 @@ ...@@ -41,7 +40,6 @@
#define Elf_Shdr Elf64_Shdr #define Elf_Shdr Elf64_Shdr
#define Elf_Sym Elf64_Sym #define Elf_Sym Elf64_Sym
#define Elf_Addr Elf64_Addr #define Elf_Addr Elf64_Addr
#define Elf_Sword Elf64_Sxword
#define Elf_Section Elf64_Half #define Elf_Section Elf64_Half
#define ELF_ST_BIND ELF64_ST_BIND #define ELF_ST_BIND ELF64_ST_BIND
#define ELF_ST_TYPE ELF64_ST_TYPE #define ELF_ST_TYPE ELF64_ST_TYPE
...@@ -158,22 +156,28 @@ static inline int is_shndx_special(unsigned int i) ...@@ -158,22 +156,28 @@ static inline int is_shndx_special(unsigned int i)
return i != SHN_XINDEX && i >= SHN_LORESERVE && i <= SHN_HIRESERVE; return i != SHN_XINDEX && i >= SHN_LORESERVE && i <= SHN_HIRESERVE;
} }
/*
* Move reserved section indices SHN_LORESERVE..SHN_HIRESERVE out of
* the way to -256..-1, to avoid conflicting with real section
* indices.
*/
#define SPECIAL(i) ((i) - (SHN_HIRESERVE + 1))
/* Accessor for sym->st_shndx, hides ugliness of "64k sections" */ /* Accessor for sym->st_shndx, hides ugliness of "64k sections" */
static inline unsigned int get_secindex(const struct elf_info *info, static inline unsigned int get_secindex(const struct elf_info *info,
const Elf_Sym *sym) const Elf_Sym *sym)
{ {
if (is_shndx_special(sym->st_shndx)) unsigned int index = sym->st_shndx;
return SPECIAL(sym->st_shndx);
if (sym->st_shndx != SHN_XINDEX) /*
return sym->st_shndx; * Elf{32,64}_Sym::st_shndx is 2 byte. Big section numbers are available
return info->symtab_shndx_start[sym - info->symtab_start]; * in the .symtab_shndx section.
*/
if (index == SHN_XINDEX)
return info->symtab_shndx_start[sym - info->symtab_start];
/*
* Move reserved section indices SHN_LORESERVE..SHN_HIRESERVE out of
* the way to UINT_MAX-255..UINT_MAX, to avoid conflicting with real
* section indices.
*/
if (index >= SHN_LORESERVE && index <= SHN_HIRESERVE)
return index - SHN_HIRESERVE - 1;
return index;
} }
/* file2alias.c */ /* file2alias.c */
...@@ -187,6 +191,7 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen); ...@@ -187,6 +191,7 @@ void get_src_version(const char *modname, char sum[], unsigned sumlen);
/* from modpost.c */ /* from modpost.c */
char *read_text_file(const char *filename); char *read_text_file(const char *filename);
char *get_line(char **stringp); char *get_line(char **stringp);
void *sym_get_data(const struct elf_info *info, const Elf_Sym *sym);
enum loglevel { enum loglevel {
LOG_WARN, LOG_WARN,
......
...@@ -49,6 +49,9 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF ...@@ -49,6 +49,9 @@ sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
URL: https://www.kernel.org URL: https://www.kernel.org
$S Source: kernel-$__KERNELRELEASE.tar.gz $S Source: kernel-$__KERNELRELEASE.tar.gz
Provides: $PROVIDES Provides: $PROVIDES
# $UTS_MACHINE as a fallback of _arch in case
# /usr/lib/rpm/platform/*/macros was not included.
%define _arch %{?_arch:$UTS_MACHINE}
%define __spec_install_post /usr/lib/rpm/brp-compress || : %define __spec_install_post /usr/lib/rpm/brp-compress || :
%define debug_package %{nil} %define debug_package %{nil}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment