Commit f0dd81db authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'kbuild-fixes-v6.3-3' of...

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

Pull Kbuild fixes from Masahiro Yamada:

 - Drop debug info from purgatory objects again

 - Document that kernel.org provides prebuilt LLVM toolchains

 - Give up handling untracked files for source package builds

 - Avoid creating corrupted cpio when KBUILD_BUILD_TIMESTAMP is given
   with a pre-epoch data.

 - Change panic_show_mem() to a macro to handle variable-length argument

 - Compress tarballs on-the-fly again

* tag 'kbuild-fixes-v6.3-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  kbuild: do not create intermediate *.tar for tar packages
  kbuild: do not create intermediate *.tar for source tarballs
  kbuild: merge cmd_archive_linux and cmd_archive_perf
  init/initramfs: Fix argument forwarding to panic() in panic_show_mem()
  initramfs: Check negative timestamp to prevent broken cpio archive
  kbuild: give up untracked files for source package builds
  Documentation/llvm: Add a note about prebuilt kernel.org toolchains
  purgatory: fix disabling debug info
parents 6586c4d4 3c65a270
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -171,6 +171,10 @@ Getting Help
Getting LLVM
-------------

We provide prebuilt stable versions of LLVM on `kernel.org <https://kernel.org/pub/tools/llvm/>`_.
Below are links that may be useful for building LLVM from source or procuring
it through a distribution's package manager.

- https://releases.llvm.org/download.html
- https://github.com/llvm/llvm-project
- https://llvm.org/docs/GettingStarted.html
+1 −6
Original line number Diff line number Diff line
@@ -84,12 +84,7 @@ CFLAGS_string.o += $(PURGATORY_CFLAGS)
CFLAGS_REMOVE_ctype.o		+= $(PURGATORY_CFLAGS_REMOVE)
CFLAGS_ctype.o			+= $(PURGATORY_CFLAGS)

AFLAGS_REMOVE_entry.o		+= -Wa,-gdwarf-2
AFLAGS_REMOVE_memcpy.o		+= -Wa,-gdwarf-2
AFLAGS_REMOVE_memset.o		+= -Wa,-gdwarf-2
AFLAGS_REMOVE_strcmp.o		+= -Wa,-gdwarf-2
AFLAGS_REMOVE_strlen.o		+= -Wa,-gdwarf-2
AFLAGS_REMOVE_strncmp.o		+= -Wa,-gdwarf-2
asflags-remove-y		+= $(foreach x, -g -gdwarf-4 -gdwarf-5, $(x) -Wa,$(x))

$(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
		$(call if_changed,ld)
+1 −2
Original line number Diff line number Diff line
@@ -69,8 +69,7 @@ CFLAGS_sha256.o += $(PURGATORY_CFLAGS)
CFLAGS_REMOVE_string.o		+= $(PURGATORY_CFLAGS_REMOVE)
CFLAGS_string.o			+= $(PURGATORY_CFLAGS)

AFLAGS_REMOVE_setup-x86_$(BITS).o	+= -Wa,-gdwarf-2
AFLAGS_REMOVE_entry64.o			+= -Wa,-gdwarf-2
asflags-remove-y		+= $(foreach x, -g -gdwarf-4 -gdwarf-5, $(x) -Wa,$(x))

$(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
		$(call if_changed,ld)
+2 −9
Original line number Diff line number Diff line
@@ -60,15 +60,8 @@ static void __init error(char *x)
		message = x;
}

static void panic_show_mem(const char *fmt, ...)
{
	va_list args;

	show_mem(0, NULL);
	va_start(args, fmt);
	panic(fmt, args);
	va_end(args);
}
#define panic_show_mem(fmt, ...) \
	({ show_mem(0, NULL); panic(fmt, ##__VA_ARGS__); })

/* link hash */

+33 −31
Original line number Diff line number Diff line
@@ -27,21 +27,6 @@ fi ; \
tar -I $(KGZIP) -c $(RCS_TAR_IGNORE) -f $(2).tar.gz \
	--transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3)

# tarball compression
# ---------------------------------------------------------------------------

%.tar.gz: %.tar
	$(call cmd,gzip)

%.tar.bz2: %.tar
	$(call cmd,bzip2)

%.tar.xz: %.tar
	$(call cmd,xzmisc)

%.tar.zst: %.tar
	$(call cmd,zstd)

# Git
# ---------------------------------------------------------------------------

@@ -57,16 +42,24 @@ check-git:
		false; \
	fi

git-config-tar.gz  = -c tar.tar.gz.command="$(KGZIP)"
git-config-tar.bz2 = -c tar.tar.bz2.command="$(KBZIP2)"
git-config-tar.xz  = -c tar.tar.xz.command="$(XZ)"
git-config-tar.zst = -c tar.tar.zst.command="$(ZSTD)"

quiet_cmd_archive = ARCHIVE $@
      cmd_archive = git -C $(srctree) $(git-config-tar$(suffix $@)) archive \
                    --output=$$(realpath $@) --prefix=$(basename $@)/ $(archive-args)

# Linux source tarball
# ---------------------------------------------------------------------------

quiet_cmd_archive_linux = ARCHIVE $@
      cmd_archive_linux = \
	git -C $(srctree) archive --output=$$(realpath $@) --prefix=$(basename $@)/ $$(cat $<)
linux-tarballs := $(addprefix linux, .tar.gz)

targets += linux.tar
linux.tar: .tmp_HEAD FORCE
	$(call if_changed,archive_linux)
targets += $(linux-tarballs)
$(linux-tarballs): archive-args = $$(cat $<)
$(linux-tarballs): .tmp_HEAD FORCE
	$(call if_changed,archive)

# rpm-pkg
# ---------------------------------------------------------------------------
@@ -94,7 +87,7 @@ binrpm-pkg:
		$(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec

quiet_cmd_debianize = GEN     $@
      cmd_debianize = $(srctree)/scripts/package/mkdebian
      cmd_debianize = $(srctree)/scripts/package/mkdebian $(mkdebian-opts)

debian: FORCE
	$(call cmd,debianize)
@@ -103,6 +96,7 @@ PHONY += debian-orig
debian-orig: private source = $(shell dpkg-parsechangelog -S Source)
debian-orig: private version = $(shell dpkg-parsechangelog -S Version | sed 's/-[^-]*$$//')
debian-orig: private orig-name = $(source)_$(version).orig.tar.gz
debian-orig: mkdebian-opts = --need-source
debian-orig: linux.tar.gz debian
	$(Q)if [ "$(df  --output=target .. 2>/dev/null)" = "$(df --output=target $< 2>/dev/null)" ]; then \
		ln -f $< ../$(orig-name); \
@@ -145,10 +139,17 @@ tar-install: FORCE
	$(Q)$(MAKE) -f $(srctree)/Makefile
	+$(Q)$(srctree)/scripts/package/buildtar $@

compress-tar.gz  = -I "$(KGZIP)"
compress-tar.bz2 = -I "$(KBZIP2)"
compress-tar.xz  = -I "$(XZ)"
compress-tar.zst = -I "$(ZSTD)"

quiet_cmd_tar = TAR     $@
      cmd_tar = cd $<; tar cf ../$@ --owner=root --group=root --sort=name *
      cmd_tar = cd $<; tar cf ../$@ $(compress-tar$(suffix $@)) --owner=root --group=root --sort=name *

linux-$(KERNELRELEASE)-$(ARCH).tar: tar-install
dir-tarballs := $(addprefix linux-$(KERNELRELEASE)-$(ARCH), .tar .tar.gz .tar.bz2 .tar.xz .tar.zst)

$(dir-tarballs): tar-install
	$(call cmd,tar)

PHONY += dir-pkg
@@ -180,16 +181,17 @@ quiet_cmd_perf_version_file = GEN $@
.tmp_perf/PERF-VERSION-FILE: .tmp_HEAD $(srctree)/tools/perf/util/PERF-VERSION-GEN | .tmp_perf
	$(call cmd,perf_version_file)

quiet_cmd_archive_perf = ARCHIVE $@
      cmd_archive_perf = \
	git -C $(srctree) archive --output=$$(realpath $@) --prefix=$(basename $@)/ \
	--add-file=$$(realpath $(word 2, $^)) \
perf-archive-args = --add-file=$$(realpath $(word 2, $^)) \
	--add-file=$$(realpath $(word 3, $^)) \
	$$(cat $(word 2, $^))^{tree} $$(cat $<)

targets += perf-$(KERNELVERSION).tar
perf-$(KERNELVERSION).tar: tools/perf/MANIFEST .tmp_perf/HEAD .tmp_perf/PERF-VERSION-FILE FORCE
	$(call if_changed,archive_perf)

perf-tarballs := $(addprefix perf-$(KERNELVERSION), .tar .tar.gz .tar.bz2 .tar.xz .tar.zst)

targets += $(perf-tarballs)
$(perf-tarballs): archive-args = $(perf-archive-args)
$(perf-tarballs): tools/perf/MANIFEST .tmp_perf/HEAD .tmp_perf/PERF-VERSION-FILE FORCE
	$(call if_changed,archive)

PHONY += perf-tar-src-pkg
perf-tar-src-pkg: perf-$(KERNELVERSION).tar
Loading