commit:     2946d45ccac2c25c38654d1f380feab6f5672191
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 18 20:04:34 2023 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Wed Oct 18 20:04:34 2023 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=2946d45c

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>

 0000_README                               |  8 ++++
 2930_tar_override.patch                   | 69 +++++++++++++++++++++++++++++++
 2940_handle-gcc-14-last-stmt-rename.patch | 31 ++++++++++++++
 3 files changed, 108 insertions(+)

diff --git a/0000_README b/0000_README
index 09720a58..1d0e038f 100644
--- a/0000_README
+++ b/0000_README
@@ -303,6 +303,14 @@ Patch:  2920_sign-file-patch-for-libressl.patch
 From:   https://bugs.gentoo.org/717166
 Desc:   sign-file: full functionality with modern LibreSSL
 
+Patch:  2930_tar_override.patch
+From:   
https://lore.kernel.org/lkml/[email protected]/#t
+Desc:   kheaders: make it possible to override TAR
+
+Patch:  2940_handle-gcc-14-last-stmt-rename.patch
+From:   
https://lore.kernel.org/all/[email protected]/#Z31scripts:gcc-plugins:gcc-common.h
+Desc:   gcc-plugins: Rename last_stmt() for GCC 14+
+
 Patch:  3000_Support-printing-firmware-info.patch
 From:   https://bugs.gentoo.org/732852
 Desc:   Print firmware info (Reqs CONFIG_GENTOO_PRINT_FIRMWARE_INFO). Thanks 
to Georgy Yakovlev

diff --git a/2930_tar_override.patch b/2930_tar_override.patch
new file mode 100644
index 00000000..aa62aae1
--- /dev/null
+++ b/2930_tar_override.patch
@@ -0,0 +1,69 @@
+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]>
+---
+ Makefile               | 3 ++-
+ kernel/gen_kheaders.sh | 2 +-
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5aeea3d98..50045059c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -520,6 +520,7 @@ LZMA               = lzma
+ LZ4           = lz4c
+ XZ            = xz
+ ZSTD          = zstd
++TAR           = tar
+ 
+ PAHOLE_FLAGS  = $(shell PAHOLE=$(PAHOLE) $(srctree)/scripts/pahole-flags.sh)
+ 
+@@ -599,7 +600,7 @@ export RUSTC RUSTDOC RUSTFMT RUSTC_OR_CLIPPY_QUIET 
RUSTC_OR_CLIPPY BINDGEN CARGO
+ export HOSTRUSTC KBUILD_HOSTRUSTFLAGS
+ export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC 
AWK INSTALLKERNEL
+ export PERL 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_USERCFLAGS KBUILD_USERLDFLAGS
+ 
+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/2940_handle-gcc-14-last-stmt-rename.patch 
b/2940_handle-gcc-14-last-stmt-rename.patch
new file mode 100644
index 00000000..b04ce8da
--- /dev/null
+++ b/2940_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

Reply via email to