diff --git a/gnulib-c-stack.patch b/gnulib-c-stack.patch deleted file mode 100644 index 694578f..0000000 --- a/gnulib-c-stack.patch +++ /dev/null @@ -1,122 +0,0 @@ -From f9e2b20a12a230efa30f1d479563ae07d276a94b Mon Sep 17 00:00:00 2001 -From: Paul Eggert -Date: Wed, 30 Sep 2020 13:50:36 -0700 -Subject: [PATCH] c-stack: stop using SIGSTKSZ -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -It’s been proposed to stop making SIGSTKSZ an integer constant: -https://sourceware.org/pipermail/libc-alpha/2020-September/118028.html -Also, using SIGSTKSZ in #if did not conform to current POSIX. -Also, avoiding SIGSTKSZ makes the code simpler and easier to grok. -* lib/c-stack.c (SIGSTKSZ): Remove. -(alternate_signal_stack): Now a 64 KiB array, for simplicity. -All uses changed. ---- - ChangeLog | 9 +++++++++ - lib/c-stack.c | 42 ++++++++++++++++++------------------------ - lib/c-stack.h | 2 +- - 3 files changed, 28 insertions(+), 25 deletions(-) - -Index: m4-1.4.18/lib/c-stack.c -=================================================================== ---- m4-1.4.18.orig/lib/c-stack.c -+++ m4-1.4.18/lib/c-stack.c -@@ -50,15 +50,6 @@ - #if ! HAVE_STACK_T && ! defined stack_t - typedef struct sigaltstack stack_t; - #endif --#ifndef SIGSTKSZ --# define SIGSTKSZ 16384 --#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384 --/* libsigsegv 2.6 through 2.8 have a bug where some architectures use -- more than the Linux default of an 8k alternate stack when deciding -- if a fault was caused by stack overflow. */ --# undef SIGSTKSZ --# define SIGSTKSZ 16384 --#endif - - #include - #include -@@ -89,6 +80,16 @@ typedef struct sigaltstack stack_t; - # endif - #endif - -+/* Storage for the alternate signal stack. -+ 64 KiB is not too large for Gnulib-using apps, and is large enough -+ for all known platforms. Smaller sizes may run into trouble. -+ For example, libsigsegv 2.6 through 2.8 have a bug where some -+ architectures use more than the Linux default of an 8 KiB alternate -+ stack when deciding if a fault was caused by stack overflow. */ -+static max_align_t alternate_signal_stack[(64 * 1024 -+ + sizeof (max_align_t) - 1) -+ / sizeof (max_align_t)]; -+ - /* The user-specified action to take when a SEGV-related program error - or stack overflow occurs. */ - static void (* volatile segv_action) (int); -@@ -128,19 +129,6 @@ die (int signo) - #if (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK \ - && HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV - --/* Storage for the alternate signal stack. */ --static union --{ -- char buffer[SIGSTKSZ]; -- -- /* These other members are for proper alignment. There's no -- standard way to guarantee stack alignment, but this seems enough -- in practice. */ -- long double ld; -- long l; -- void *p; --} alternate_signal_stack; -- - static void - null_action (int signo __attribute__ ((unused))) - { -@@ -205,8 +193,8 @@ c_stack_action (void (*action) (int)) - - /* Always install the overflow handler. */ - if (stackoverflow_install_handler (overflow_handler, -- alternate_signal_stack.buffer, -- sizeof alternate_signal_stack.buffer)) -+ alternate_signal_stack, -+ sizeof alternate_signal_stack)) - { - errno = ENOTSUP; - return -1; -@@ -279,14 +267,14 @@ c_stack_action (void (*action) (int)) - stack_t st; - struct sigaction act; - st.ss_flags = 0; -+ st.ss_sp = alternate_signal_stack; -+ st.ss_size = sizeof alternate_signal_stack; - # if SIGALTSTACK_SS_REVERSED - /* Irix mistakenly treats ss_sp as the upper bound, rather than - lower bound, of the alternate stack. */ -- st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ - sizeof (void *); -- st.ss_size = sizeof alternate_signal_stack.buffer - sizeof (void *); --# else -- st.ss_sp = alternate_signal_stack.buffer; -- st.ss_size = sizeof alternate_signal_stack.buffer; -+ st.ss_size -= sizeof (void *); -+ char *ss_sp = st.ss_sp; -+ st.ss_sp = ss_sp + st.ss_size; - # endif - r = sigaltstack (&st, NULL); - if (r != 0) -Index: m4-1.4.18/lib/c-stack.h -=================================================================== ---- m4-1.4.18.orig/lib/c-stack.h -+++ m4-1.4.18/lib/c-stack.h -@@ -34,7 +34,7 @@ - A null ACTION acts like an action that does nothing. - - ACTION must be async-signal-safe. ACTION together with its callees -- must not require more than SIGSTKSZ bytes of stack space. Also, -+ must not require more than 64 KiB of stack space. Also, - ACTION should not call longjmp, because this implementation does - not guarantee that it is safe to return to the original stack. - diff --git a/gnulib-libio.patch b/gnulib-libio.patch deleted file mode 100644 index 82acde7..0000000 --- a/gnulib-libio.patch +++ /dev/null @@ -1,145 +0,0 @@ -2018-03-05 Paul Eggert - - fflush: adjust to glibc 2.28 libio.h removal - Problem reported by Daniel P. Berrangé in: - https://lists.gnu.org/r/bug-gnulib/2018-03/msg00000.html - * lib/fbufmode.c (fbufmode): - * lib/fflush.c (clear_ungetc_buffer_preserving_position) - (disable_seek_optimization, rpl_fflush): - * lib/fpending.c (__fpending): - * lib/fpurge.c (fpurge): - * lib/freadable.c (freadable): - * lib/freadahead.c (freadahead): - * lib/freading.c (freading): - * lib/freadptr.c (freadptr): - * lib/freadseek.c (freadptrinc): - * lib/fseeko.c (fseeko): - * lib/fseterr.c (fseterr): - * lib/fwritable.c (fwritable): - * lib/fwriting.c (fwriting): - Check _IO_EOF_SEEN instead of _IO_ftrylockfile. - * lib/stdio-impl.h (_IO_IN_BACKUP) [_IO_EOF_SEEN]: - Define if not already defined. - -Index: m4-1.4.18/lib/fflush.c -=================================================================== ---- m4-1.4.18.orig/lib/fflush.c -+++ m4-1.4.18/lib/fflush.c -@@ -33,7 +33,7 @@ - #undef fflush - - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - - /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ - static void -@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp) - - #endif - --#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) -+#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) - - # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ -@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream) - if (stream == NULL || ! freading (stream)) - return fflush (stream); - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - - clear_ungetc_buffer_preserving_position (stream); - -Index: m4-1.4.18/lib/fpending.c -=================================================================== ---- m4-1.4.18.orig/lib/fpending.c -+++ m4-1.4.18/lib/fpending.c -@@ -32,7 +32,7 @@ __fpending (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - return fp->_IO_write_ptr - fp->_IO_write_base; - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ -Index: m4-1.4.18/lib/fpurge.c -=================================================================== ---- m4-1.4.18.orig/lib/fpurge.c -+++ m4-1.4.18/lib/fpurge.c -@@ -62,7 +62,7 @@ fpurge (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - fp->_IO_read_end = fp->_IO_read_ptr; - fp->_IO_write_ptr = fp->_IO_write_base; - /* Avoid memory leak when there is an active ungetc buffer. */ -Index: m4-1.4.18/lib/freadahead.c -=================================================================== ---- m4-1.4.18.orig/lib/freadahead.c -+++ m4-1.4.18/lib/freadahead.c -@@ -25,7 +25,7 @@ - size_t - freadahead (FILE *fp) - { --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - if (fp->_IO_write_ptr > fp->_IO_write_base) - return 0; - return (fp->_IO_read_end - fp->_IO_read_ptr) -Index: m4-1.4.18/lib/freading.c -=================================================================== ---- m4-1.4.18.orig/lib/freading.c -+++ m4-1.4.18/lib/freading.c -@@ -31,7 +31,7 @@ freading (FILE *fp) - /* Most systems provide FILE as a struct and the necessary bitmask in - , because they need it for implementing getc() and putc() as - fast macros. */ --# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - return ((fp->_flags & _IO_NO_WRITES) != 0 - || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 - && fp->_IO_read_base != NULL)); -Index: m4-1.4.18/lib/fseeko.c -=================================================================== ---- m4-1.4.18.orig/lib/fseeko.c -+++ m4-1.4.18/lib/fseeko.c -@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when - #endif - - /* These tests are based on fpurge.c. */ --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - if (fp->_IO_read_end == fp->_IO_read_ptr - && fp->_IO_write_ptr == fp->_IO_write_base - && fp->_IO_save_base == NULL) -@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when - return -1; - } - --#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ -+#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ - fp->_flags &= ~_IO_EOF_SEEN; - fp->_offset = pos; - #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ -Index: m4-1.4.18/lib/stdio-impl.h -=================================================================== ---- m4-1.4.18.orig/lib/stdio-impl.h -+++ m4-1.4.18/lib/stdio-impl.h -@@ -18,6 +18,12 @@ - the same implementation of stdio extension API, except that some fields - have different naming conventions, or their access requires some casts. */ - -+/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this -+ problem by defining it ourselves. FIXME: Do not rely on glibc -+ internals. */ -+#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN -+# define _IO_IN_BACKUP 0x100 -+#endif - - /* BSD stdio derived implementations. */ - diff --git a/m4-1.4.18.tar.xz b/m4-1.4.18.tar.xz deleted file mode 100644 index cc7dd9e..0000000 --- a/m4-1.4.18.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f2c1e86ca0a404ff281631bdc8377638992744b175afb806e25871a24a934e07 -size 1207688 diff --git a/m4-1.4.18.tar.xz.sig b/m4-1.4.18.tar.xz.sig deleted file mode 100644 index db7e9ab..0000000 --- a/m4-1.4.18.tar.xz.sig +++ /dev/null @@ -1,11 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Comment: Public key at http://people.redhat.com/eblake/eblake.gpg - -iQEcBAABCAAGBQJYaDOKAAoJEKeha0olJ0NqT5oH/jyPC2chKyoCSrBAAmMT/0ac -xbDOiymNbaj6twhoZNunE8m8OzySfBQxANFf0yepZ0dCPf8/SzCWt9eHs12xzTrs -htcrsXBJ0woVdSG1SVaCzeOna8dvQ5fRJUHdWqTCa8sJdEBNk/zh2i72wGzMtpLo -Ord+dXOplvRe+LTUyu7eMAQfccPb5PnL4sh6WgmvQpjUiP4y2BlpbcI7hU1OOPNz -Gq63o3sO8OkwB2LP//M3fyi6Y4CHa7V6mfYz0PDboks1UruNYclbwVuJ8tLMYae+ -YlRMuMCs1hssICNcMyhtks8jdbXlMm7E8Nhk2+Uc6eRnA97zZQ0ADthNjA47/TA= -=TQTI ------END PGP SIGNATURE----- diff --git a/m4-1.4.20.tar.xz b/m4-1.4.20.tar.xz new file mode 100644 index 0000000..ca8b1a0 --- /dev/null +++ b/m4-1.4.20.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e236ea3a1ccf5f6c270b1c4bb60726f371fa49459a8eaaebc90b216b328daf2b +size 2044756 diff --git a/m4-1.4.20.tar.xz.sig b/m4-1.4.20.tar.xz.sig new file mode 100644 index 0000000..4516cd4 --- /dev/null +++ b/m4-1.4.20.tar.xz.sig @@ -0,0 +1,11 @@ +-----BEGIN PGP SIGNATURE----- + +iQEzBAABCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAmgfklUACgkQp6FrSiUn +Q2pW2Af/aKgxUEJhpp53Wi5bYQ2wucfpXTHH3tCoSfmUNb2cu4QfGMuA9q08LlyF +XnXb8Yp9Zqq/ct65OlqRxchWLNNvhVViZQuZiiB1nl8aJrlumoiaSYv/vV5XCDfK +QRZ/jysaqN81Hn4QmyASsugk8tYy4SrWqIQYVgPWHnZ0MhfGFT5odzAWcT/i/Xlf +arf4YwUNQYVS9VZ7djHbbJuAYnve43iKT/6lU7IKxDSEjY/6nOL1/5PQR3TlGylO +l3m2SPbYch5u7HNZPCmX4vt8538CqE51j69oCMCvfm0B9s44N3BAzGlQRw8HUbwB +1Ise9ZHA9DKW52+pw03tq05wShW0IQ== +=Q7iM +-----END PGP SIGNATURE----- diff --git a/m4.changes b/m4.changes index 66d6400..b508b9d 100644 --- a/m4.changes +++ b/m4.changes @@ -1,3 +1,69 @@ +------------------------------------------------------------------- +Mon May 19 08:33:20 UTC 2025 - Andreas Schwab + +- Skip all stack overflow tests in qemu linux-user emulation + +------------------------------------------------------------------- +Wed May 14 10:43:08 UTC 2025 - Friedrich Haubensak + +- Drop -std=gnu17 from CFLAGS as 1.4.20 supports C23 + +------------------------------------------------------------------- +Sat May 10 20:00:23 UTC 2025 - Christoph G + +- Update to 1.4.20 + * Fix a bug in the `eval' builtin where it does not suppress warnings + about division by zero that occurs within a more complex expression on + the right hand side of || or && + * The `syscmd' and `esyscmd' builtins no longer mishandle a command line + starting with `-' or `+' + * Fix regression introduced in 1.4.19 where trace output (such as with + `debugmode(t)') could read invalid memory when tracing a series of + pushed macros that are popped during argument collection. + * Fix regression introduced in 1.4.19 where the `format' builtin + inadvertently took on locale-dependent parsing and output of floating + point numbers as a side-effect of introducing message translations. + * Fix regression introduced in 1.4.11 where the experimental `changeword' + builtin could cause a crash if given a regex that does not match all + one-byte prefixes of valid longer matches. As a reminder, `changeword' + is not recommended for production use, and will likely not be present + in the next major version release. +** Update to comply with newer C standards, and inherit portability + improvements from gnulib. +- Update to 1.4.19 +** A number of portability improvements inherited from gnulib, including + the ability to perform stack overflow detection on more platforms + without linking to GNU libsigsegv. +** The symbol hash table now defaults to 65537 buckets instead of 509, as + modern systems have enough memory to benefit from fewer hash collisions + by default. +** Introduce the use of gettext, with the immediate benefit of nicer + UTF-8 author names. +- Disable profilied built as it lead to segmentation faults in the + test suite (test-free). +- Drop gnulib-libio.patch as a similar change is part of upstream. +- Drop gnulib-c-stack.patch as patched code got removed upstream. + +------------------------------------------------------------------- +Wed Apr 9 18:38:42 UTC 2025 - Friedrich Haubensak + +- add -std=gnu17 to CFLAGS in %check also + +------------------------------------------------------------------- +Mon Mar 31 16:12:21 UTC 2025 - Friedrich Haubensak + +- add -std=gnu17 to CFLAGS to fix gcc15 compile time error + +------------------------------------------------------------------- +Wed Mar 19 15:28:26 UTC 2025 - Bernhard Wiedemann + +- Skip PGO with %want_reproducible_builds (boo#1040589) + +------------------------------------------------------------------- +Sat Nov 30 13:02:16 UTC 2024 - Adrian Schröter + +- fix build for loongarch64 + ------------------------------------------------------------------- Fri Feb 23 11:47:05 UTC 2024 - pgajdos@suse.com diff --git a/m4.spec b/m4.spec index add1c1a..f5a67ca 100644 --- a/m4.spec +++ b/m4.spec @@ -1,7 +1,7 @@ # # spec file for package m4 # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: m4 -Version: 1.4.18 +Version: 1.4.20 Release: 0 Summary: GNU m4 License: GPL-3.0-or-later @@ -26,11 +26,9 @@ URL: https://www.gnu.org/software/m4/ Source0: https://ftp.gnu.org/pub/gnu/m4/%{name}-%{version}.tar.xz Source1: https://ftp.gnu.org/pub/gnu/m4/%{name}-%{version}.tar.xz.sig Source2: https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=m4&download=1#/%{name}.keyring -Patch1: gnulib-libio.patch -Patch2: gnulib-c-stack.patch BuildRequires: xz Requires(post): %{install_info_prereq} -Requires(preun):%{install_info_prereq} +Requires(preun): %{install_info_prereq} Provides: base:%{_bindir}/m4 %description @@ -38,6 +36,9 @@ GNU m4 is an implementation of the traditional Unix macro processor. %prep %autosetup -p1 +%ifarch loongarch64 +cp -a /usr/lib/rpm/config.{sub,guess} build-aux/ +%endif %build %configure \ @@ -48,18 +49,25 @@ GNU m4 is an implementation of the traditional Unix macro processor. gl_cv_func_isnanl_works=yes \ gl_cv_func_printf_directive_n=yes \ gl_cv_func_printf_infinite_long_double=yes -%if %{do_profiling} +%if %{do_profiling} && !0%{?want_reproducible_builds} && 0 %make_build CFLAGS="%{optflags} %{cflags_profile_generate}" # run profiling check sequentially to have it reproducible %make_build -j1 check CFLAGS="%{optflags} %{cflags_profile_generate}" %make_build clean %make_build CFLAGS="%{optflags} %{cflags_profile_feedback}" %else - %make_build + %make_build CFLAGS="%{optflags}" %endif %check -%make_build check +%if 0%{?qemu_user_space_build} +# Stack overflow tests are not supported by qemu linux-user emulation +echo exit 77 > checks/stackovf.test +echo exit 77 > tests/test-c-stack.sh +echo 'int main () { return 77; }' > tests/test-sigsegv-catch-stackoverflow1.c +echo 'int main () { return 77; }' > tests/test-sigsegv-catch-stackoverflow2.c +%endif +%make_build check CFLAGS="%{optflags}" %install %make_install @@ -80,5 +88,6 @@ rm -rf %{buildroot}%{_infodir}/dir %{_infodir}/m4.info-2%{ext_info} %{_infodir}/m4.info%{?ext_info} %{_mandir}/man1/m4.1%{?ext_man} +%{_prefix}/share/locale/*/LC_MESSAGES/m4.mo %changelog