commit: e8228d984659c51468157097b7051cc79b9322eb Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> AuthorDate: Wed Oct 18 20:16:33 2023 +0000 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> CommitDate: Wed Oct 18 20:16:33 2023 +0000 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=e8228d98
TAR override and gcc 14 patch kheaders: make it possible to override TAR gcc-plugins: Rename last_stmt() for GCC 14+ Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> 2930_tar_override.patch | 63 +++++++++++++++++++++++++++++++ 2945_handle-gcc-14-last-stmt-rename.patch | 31 +++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/2930_tar_override.patch b/2930_tar_override.patch new file mode 100644 index 00000000..babfa83a --- /dev/null +++ b/2930_tar_override.patch @@ -0,0 +1,63 @@ +From: "Michał Górny" <[email protected]> +To: Dmitry Goldin <[email protected]> +Cc: "Masahiro Yamada" <[email protected]>, + [email protected], "Michał Górny" <[email protected]>, + "Sam James" <[email protected]>, + "Masahiro Yamada" <[email protected]> +Subject: [PATCH v2] kheaders: make it possible to override TAR +Date: Wed, 12 Apr 2023 10:27:43 +0200 [thread overview] +Message-ID: <[email protected]> (raw) +In-Reply-To: <CAK7LNATfrxu7BK0ZRq+qSjObiz6GpS3U5L=12vDys5_yy=m...@mail.gmail.com> + +Commit 86cdd2fdc4e39c388d39c7ba2396d1a9dfd66226 ("kheaders: make headers +archive reproducible") introduced a number of options specific to GNU +tar to the `tar` invocation in `gen_kheaders.sh` script. This causes +the script to fail to work on systems where `tar` is not GNU tar. This +can occur e.g. on recent Gentoo Linux installations that support using +bsdtar from libarchive instead. + +Add a `TAR` make variable to make it possible to override the tar +executable used, e.g. by specifying: + + make TAR=gtar + +Link: https://bugs.gentoo.org/884061 +Reported-by: Sam James <[email protected]> +Tested-by: Sam James <[email protected]> +Co-developed-by: Masahiro Yamada <[email protected]> +Signed-off-by: Michał Górny <[email protected]> +--- +--- a/Makefile 2023-10-18 16:13:06.496343048 -0400 ++++ b/Makefile 2023-10-18 16:14:00.136587613 -0400 +@@ -471,6 +471,7 @@ LZMA = lzma + LZ4 = lz4c + XZ = xz + ZSTD = zstd ++TAR = tar + + PAHOLE_FLAGS = $(shell PAHOLE=$(PAHOLE) $(srctree)/scripts/pahole-flags.sh) + +@@ -519,7 +520,7 @@ CLANG_FLAGS := + export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC + export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL + export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX +-export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD ++export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD TAR + export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE + + export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS +diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh +index 1ef9a8751..82d539648 100755 +--- a/kernel/gen_kheaders.sh ++++ b/kernel/gen_kheaders.sh +@@ -86,7 +86,7 @@ find $cpio_dir -type f -print0 | + # For compatibility with older versions of tar, files are fed to tar + # pre-sorted, as --sort=name might not be available. + find $cpio_dir -printf "./%P\n" | LC_ALL=C sort | \ +- tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \ ++ ${TAR:-tar} "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \ + --owner=0 --group=0 --numeric-owner --no-recursion \ + -I $XZ -cf $tarfile -C $cpio_dir/ -T - > /dev/null + +-- +2.40.0 diff --git a/2945_handle-gcc-14-last-stmt-rename.patch b/2945_handle-gcc-14-last-stmt-rename.patch new file mode 100644 index 00000000..b04ce8da --- /dev/null +++ b/2945_handle-gcc-14-last-stmt-rename.patch @@ -0,0 +1,31 @@ +From: Kees Cook <[email protected]> +To: [email protected] +Cc: Kees Cook <[email protected]>, [email protected] +Subject: [PATCH] gcc-plugins: Rename last_stmt() for GCC 14+ +Date: Thu, 10 Aug 2023 23:05:49 -0700 [thread overview] +Message-ID: <[email protected]> (raw) + +In GCC 14, last_stmt() was renamed to last_nondebug_stmt(). Add a helper +macro to handle the renaming. + +Cc: [email protected] +Signed-off-by: Kees Cook <[email protected]> +--- + scripts/gcc-plugins/gcc-common.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/scripts/gcc-plugins/gcc-common.h b/scripts/gcc-plugins/gcc-common.h +index 84c730da36dd..1ae39b9f4a95 100644 +--- a/scripts/gcc-plugins/gcc-common.h ++++ b/scripts/gcc-plugins/gcc-common.h +@@ -440,4 +440,8 @@ static inline void debug_gimple_stmt(const_gimple s) + #define SET_DECL_MODE(decl, mode) DECL_MODE(decl) = (mode) + #endif + ++#if BUILDING_GCC_VERSION >= 14000 ++#define last_stmt(x) last_nondebug_stmt(x) ++#endif ++ + #endif +-- +2.34.1
