Skip to content

Commit d55571c

Browse files
committed
Merge tag 'kbuild-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild updates from Masahiro Yamada: - Refactor scripts/kallsyms to make it faster and easier to maintain - Clean up menuconfig - Provide Clang with hard-coded target triple instead of CROSS_COMPILE - Use -z pack-relative-relocs flags instead of --use-android-relr-tags for arm64 CONFIG_RELR - Add srcdeb-pkg target to build only a Debian source package - Add KDEB_SOURCE_COMPRESS option to specify the compression for a Debian source package - Misc cleanups and fixes * tag 'kbuild-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: deb-pkg: specify targets in debian/rules as .PHONY sparc: unify sparc32/sparc64 archhelp kbuild: rpm-pkg: remove kernel-drm PROVIDES kbuild: deb-pkg: add KDEB_SOURCE_COMPRESS to specify source compression kbuild: add srcdeb-pkg target Makefile: use -z pack-relative-relocs kbuild: clang: do not use CROSS_COMPILE for target triple kconfig: menuconfig: reorder functions to remove forward declarations kconfig: menuconfig: remove unused M_EVENT macro kconfig: menuconfig: remove OLD_NCURSES macro kbuild: builddeb: Eliminate debian/arch use scripts/kallsyms: update the usage in the comment block scripts/kallsyms: decrease expand_symbol() / cleanup_symbol_name() calls scripts/kallsyms: change the output order scripts/kallsyms: move compiler-generated symbol patterns to mksysmap scripts/kallsyms: exclude symbols generated by itself dynamically scripts/mksysmap: use sed with in-line comments scripts/mksysmap: remove comments described in nm(1) scripts/kallsyms: remove redundant code for omitting U and N kallsyms: expand symbol name into comment for debugging
2 parents 3108976 + 9892bd7 commit d55571c

File tree

15 files changed

+510
-582
lines changed

15 files changed

+510
-582
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,8 @@ LDFLAGS_vmlinux += -X
11131113
endif
11141114

11151115
ifeq ($(CONFIG_RELR),y)
1116-
LDFLAGS_vmlinux += --pack-dyn-relocs=relr --use-android-relr-tags
1116+
# ld.lld before 15 did not support -z pack-relative-relocs.
1117+
LDFLAGS_vmlinux += $(call ld-option,--pack-dyn-relocs=relr,-z pack-relative-relocs)
11171118
endif
11181119

11191120
# We never want expected sections to be placed heuristically by the

arch/sparc/Makefile

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,11 @@ vdso_install:
8383
KBUILD_IMAGE := $(boot)/zImage
8484

8585
# Don't use tabs in echo arguments.
86-
ifeq ($(ARCH),sparc)
8786
define archhelp
88-
echo '* image - kernel image ($(boot)/image)'
89-
echo '* zImage - stripped kernel image ($(boot)/zImage)'
87+
echo '* vmlinux - standard SPARC kernel'
88+
echo ' image - kernel image ($(boot)/image)'
89+
echo '* zImage - stripped/compressed kernel image ($(boot)/zImage)'
9090
echo ' uImage - U-Boot SPARC32 Image (only for LEON)'
91+
echo ' vmlinux.aout - a.out kernel for SPARC64'
9192
echo ' tftpboot.img - image prepared for tftp'
9293
endef
93-
else
94-
define archhelp
95-
echo '* vmlinux - standard sparc64 kernel'
96-
echo '* zImage - stripped and compressed sparc64 kernel ($(boot)/zImage)'
97-
echo ' vmlinux.aout - a.out kernel for sparc64'
98-
echo ' tftpboot.img - image prepared for tftp'
99-
endef
100-
endif

scripts/Makefile.clang

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@ CLANG_TARGET_FLAGS_x86 := x86_64-linux-gnu
1313
CLANG_TARGET_FLAGS_um := $(CLANG_TARGET_FLAGS_$(SUBARCH))
1414
CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(SRCARCH))
1515

16-
ifeq ($(CROSS_COMPILE),)
1716
ifeq ($(CLANG_TARGET_FLAGS),)
18-
$(error Specify CROSS_COMPILE or add '--target=' option to scripts/Makefile.clang)
17+
$(error add '--target=' option to scripts/Makefile.clang)
1918
else
2019
CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS)
21-
endif # CLANG_TARGET_FLAGS
22-
else
23-
CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
24-
endif # CROSS_COMPILE
20+
endif
2521

2622
ifeq ($(LLVM_IAS),0)
2723
CLANG_FLAGS += -fno-integrated-as

scripts/Makefile.package

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ include $(srctree)/scripts/Kbuild.include
55
include $(srctree)/scripts/Makefile.lib
66

77
KERNELPATH := kernel-$(subst -,_,$(KERNELRELEASE))
8-
KBUILD_PKG_ROOTCMD ?="fakeroot -u"
98
# Include only those top-level files that are needed by make, plus the GPL copy
109
TAR_CONTENT := Documentation LICENSES arch block certs crypto drivers fs \
1110
include init io_uring ipc kernel lib mm net rust \
@@ -42,19 +41,25 @@ check-git:
4241
false; \
4342
fi
4443

45-
git-config-tar.gz = -c tar.tar.gz.command="$(KGZIP)"
46-
git-config-tar.bz2 = -c tar.tar.bz2.command="$(KBZIP2)"
47-
git-config-tar.xz = -c tar.tar.xz.command="$(XZ)"
48-
git-config-tar.zst = -c tar.tar.zst.command="$(ZSTD)"
44+
git-config-tar.gz = -c tar.tar.gz.command="$(KGZIP)"
45+
git-config-tar.bz2 = -c tar.tar.bz2.command="$(KBZIP2)"
46+
git-config-tar.lzma = -c tar.tar.lzma.command="$(LZMA)"
47+
git-config-tar.xz = -c tar.tar.xz.command="$(XZ)"
48+
git-config-tar.zst = -c tar.tar.zst.command="$(ZSTD)"
4949

5050
quiet_cmd_archive = ARCHIVE $@
5151
cmd_archive = git -C $(srctree) $(git-config-tar$(suffix $@)) archive \
5252
--output=$$(realpath $@) $(archive-args)
5353

54+
suffix-gzip := .gz
55+
suffix-bzip2 := .bz2
56+
suffix-lzma := .lzma
57+
suffix-xz := .xz
58+
5459
# Linux source tarball
5560
# ---------------------------------------------------------------------------
5661

57-
linux-tarballs := $(addprefix linux, .tar.gz)
62+
linux-tarballs := $(addprefix linux, .tar.gz .tar.bz2 .tar.lzma .tar.xz)
5863

5964
targets += $(linux-tarballs)
6065
$(linux-tarballs): archive-args = --prefix=linux/ $$(cat $<)
@@ -86,6 +91,22 @@ binrpm-pkg:
8691
+rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \
8792
$(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec
8893

94+
# deb-pkg srcdeb-pkg bindeb-pkg
95+
# ---------------------------------------------------------------------------
96+
97+
KDEB_SOURCE_COMPRESS ?= gzip
98+
99+
supported-deb-source-compress := gzip bzip2 lzma xz
100+
101+
PHONY += linux.tar.unsupported-deb-src-compress
102+
linux.tar.unsupported-deb-src-compress:
103+
@echo "error: KDEB_SOURCE_COMPRESS=$(KDEB_SOURCE_COMPRESS) is not supported. The supported values are: $(supported-deb-source-compress)" >&2
104+
@false
105+
106+
debian-orig-suffix := \
107+
$(strip $(if $(filter $(supported-deb-source-compress), $(KDEB_SOURCE_COMPRESS)), \
108+
$(suffix-$(KDEB_SOURCE_COMPRESS)),.unsupported-deb-src-compress))
109+
89110
quiet_cmd_debianize = GEN $@
90111
cmd_debianize = $(srctree)/scripts/package/mkdebian $(mkdebian-opts)
91112

@@ -95,23 +116,34 @@ debian: FORCE
95116
PHONY += debian-orig
96117
debian-orig: private source = $(shell dpkg-parsechangelog -S Source)
97118
debian-orig: private version = $(shell dpkg-parsechangelog -S Version | sed 's/-[^-]*$$//')
98-
debian-orig: private orig-name = $(source)_$(version).orig.tar.gz
119+
debian-orig: private orig-name = $(source)_$(version).orig.tar$(debian-orig-suffix)
99120
debian-orig: mkdebian-opts = --need-source
100-
debian-orig: linux.tar.gz debian
121+
debian-orig: linux.tar$(debian-orig-suffix) debian
101122
$(Q)if [ "$(df --output=target .. 2>/dev/null)" = "$(df --output=target $< 2>/dev/null)" ]; then \
102123
ln -f $< ../$(orig-name); \
103124
else \
104125
cp $< ../$(orig-name); \
105126
fi
106127

107-
PHONY += deb-pkg
108-
deb-pkg: debian-orig
109-
+dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) \
110-
--build=source,binary -nc -us -uc
128+
KBUILD_PKG_ROOTCMD ?= 'fakeroot -u'
129+
130+
PHONY += deb-pkg srcdeb-pkg bindeb-pkg
131+
132+
deb-pkg: private build-type := source,binary
133+
srcdeb-pkg: private build-type := source
134+
bindeb-pkg: private build-type := binary
111135

112-
PHONY += bindeb-pkg
136+
deb-pkg srcdeb-pkg: debian-orig
113137
bindeb-pkg: debian
114-
+dpkg-buildpackage -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch) $(DPKG_FLAGS) -b -nc -uc
138+
deb-pkg srcdeb-pkg bindeb-pkg:
139+
+$(strip dpkg-buildpackage \
140+
--build=$(build-type) --no-pre-clean --unsigned-changes \
141+
$(if $(findstring source, $(build-type)), \
142+
--unsigned-source --compression=$(KDEB_SOURCE_COMPRESS)) \
143+
$(if $(findstring binary, $(build-type)), \
144+
-r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \
145+
--no-check-builddeps) \
146+
$(DPKG_FLAGS))
115147

116148
PHONY += intdeb-pkg
117149
intdeb-pkg:
@@ -208,6 +240,7 @@ help:
208240
@echo ' srcrpm-pkg - Build only the source kernel RPM package'
209241
@echo ' binrpm-pkg - Build only the binary kernel RPM package'
210242
@echo ' deb-pkg - Build both source and binary deb kernel packages'
243+
@echo ' srcdeb-pkg - Build only the source kernel deb package'
211244
@echo ' bindeb-pkg - Build only the binary kernel deb package'
212245
@echo ' snap-pkg - Build only the binary kernel snap package'
213246
@echo ' (will connect to external hosts)'

0 commit comments

Comments
 (0)