summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/m4/files')
-rw-r--r--sys-devel/m4/files/m4-1.4.19-fortify-source.patch50
-rw-r--r--sys-devel/m4/files/m4-1.4.19-make-4.4-tests.patch38
-rw-r--r--sys-devel/m4/files/m4-1.4.19-race-condition-tests.patch34
3 files changed, 122 insertions, 0 deletions
diff --git a/sys-devel/m4/files/m4-1.4.19-fortify-source.patch b/sys-devel/m4/files/m4-1.4.19-fortify-source.patch
new file mode 100644
index 000000000000..d07fe620c3df
--- /dev/null
+++ b/sys-devel/m4/files/m4-1.4.19-fortify-source.patch
@@ -0,0 +1,50 @@
+https://lists.gnu.org/archive/html/m4-patches/2023-01/msg00001.html
+https://bugs.gentoo.org/890273
+
+From 960b9b4d0774f78d286932251d6f53f638aefb19 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 9 Jan 2023 08:00:34 +0000
+Subject: [PATCH] build: Don't add _FORTIFY_SOURCE if already set by
+ user/toolchain
+
+Newer toolchains (GCC 12+ or Clang 9+, glibc-2.34) allow _FORTIFY_SOURCE=3.
+
+The current macro used in configure.ac will forcefully downgrade to F_S=2
+and emit a warning if the user set something else:
+```
+x86_64-pc-linux-gnu-gcc -DEXEEXT=\"\" -I. -I../lib -DIN_M4_GNULIB_TESTS=1 -I. -I. -I.. -I./.. -I../lib -I./../lib -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -Wreturn-type -ggdb3 -Werror=implicit-function-declaration -Werror=implicit-int -c -o glthread/thread.o glthread/thread.c
+In file included from glthread/thread.c:20:
+../lib/config.h:202: warning: "_FORTIFY_SOURCE" redefined
+ 202 | # define _FORTIFY_SOURCE 2
+ |
+<built-in>: note: this is the location of the previous definition
+```
+
+See: 390d259efe8e1c7e4b6babb4738fef7427416857
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/configure.ac
++++ b/configure.ac
+@@ -133,7 +133,9 @@ if test "$gl_gcc_warnings" = yes; then
+ [/* Enable compile-time and run-time bounds-checking, and some warnings,
+ without upsetting newer glibc. */
+ #if defined __OPTIMIZE__ && __OPTIMIZE__
+- # define _FORTIFY_SOURCE 2
++ # ifndef _FORTIFY_SOURCE
++ # define _FORTIFY_SOURCE 2
++ # endif
+ #endif
+ ])
+ fi
+--- a/lib/config.hin
++++ b/lib/config.hin
+@@ -198,7 +198,9 @@
+ /* Enable compile-time and run-time bounds-checking, and some warnings,
+ without upsetting newer glibc. */
+ #if defined __OPTIMIZE__ && __OPTIMIZE__
+- # define _FORTIFY_SOURCE 2
++ # ifndef _FORTIFY_SOURCE
++ # define _FORTIFY_SOURCE 2
++ # endif
+ #endif
+
+
diff --git a/sys-devel/m4/files/m4-1.4.19-make-4.4-tests.patch b/sys-devel/m4/files/m4-1.4.19-make-4.4-tests.patch
new file mode 100644
index 000000000000..f7bc3f0e9b35
--- /dev/null
+++ b/sys-devel/m4/files/m4-1.4.19-make-4.4-tests.patch
@@ -0,0 +1,38 @@
+https://bugs.gentoo.org/879061
+
+https://savannah.gnu.org/bugs/index.php?63307 (make bug)
+https://savannah.gnu.org/support/?110767 (M4 bug)
+
+https://lists.gnu.org/archive/html/bug-m4/2022-11/msg00003.html
+https://savannah.gnu.org/support/download.php?file_id=53951
+
+From ed64def45d68b2af53f1d3d783cc98e9dbe2ff74 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex@linutronix.de>
+Date: Sat, 12 Nov 2022 15:18:41 +0100
+Subject: [PATCH] test-execute-main.c: set default handler for SIGPIPE in tests
+ 3 and 4
+
+make 4.4 sets this to SIG_IGN and the tests fail
+
+Signed-off-by: Alexander Kanavin <alex@linutronix.de>
+--- a/tests/test-execute-main.c
++++ b/tests/test-execute-main.c
+@@ -132,6 +132,7 @@ main (int argc, char *argv[])
+ #if !(defined _WIN32 && !defined __CYGWIN__)
+ {
+ /* Check SIGPIPE handling with ignore_sigpipe = false. */
++ signal(SIGPIPE, SIG_DFL);
+ const char *prog_argv[3] = { prog_path, "3", NULL };
+ int termsig = 0x7DEADBEE;
+ int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+@@ -145,6 +146,7 @@ main (int argc, char *argv[])
+ #if !(defined _WIN32 && !defined __CYGWIN__)
+ {
+ /* Check SIGPIPE handling with ignore_sigpipe = true. */
++ signal(SIGPIPE, SIG_DFL);
+ const char *prog_argv[3] = { prog_path, "4", NULL };
+ int termsig = 0x7DEADBEE;
+ int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+--
+2.30.2
+
diff --git a/sys-devel/m4/files/m4-1.4.19-race-condition-tests.patch b/sys-devel/m4/files/m4-1.4.19-race-condition-tests.patch
new file mode 100644
index 000000000000..c212777dcd3e
--- /dev/null
+++ b/sys-devel/m4/files/m4-1.4.19-race-condition-tests.patch
@@ -0,0 +1,34 @@
+https://lists.gnu.org/archive/html/bug-m4/2022-12/msg00000.html
+https://lists.gnu.org/archive/html/bug-m4/2022-12/txtmGJxjX3osy.txt
+
+Fix a sporadic failure of the test-posix_spawn-script test.
+
+From a3efddb96f5f121b8a5bb1310dc82407546fd255 Mon Sep 17 00:00:00 2001
+From: Paul Eggert <eggert@cs.ucla.edu>
+Date: Thu, 22 Dec 2022 21:19:34 -0800
+Subject: [PATCH] posix_spawnp-tests: fix filename typo
+
+Problem reported for GNU m4 by Mitchell Dorrell in:
+https://lists.gnu.org/r/bug-m4/2022-12/msg00000.html
+* tests/test-posix_spawnp-script.c (DATA_FILENAME):
+Fix typo in file name that caused race with
+test-posix_spawn-script.c.
+---
+ tests/test-posix_spawnp-script.c | 2 +-
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test-posix_spawnp-script.c b/tests/test-posix_spawnp-script.c
+index 1e5fc5c110..d2035ed63e 100644
+--- a/tests/test-posix_spawnp-script.c
++++ b/tests/test-posix_spawnp-script.c
+@@ -28,7 +28,7 @@
+
+ #include "macros.h"
+
+-#define DATA_FILENAME "test-posix_spawn-script.tmp"
++#define DATA_FILENAME "test-posix_spawnp-script.tmp"
+
+ int
+ main ()
+--
+2.25.1