Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
a3aa0e4af8
!43 [sync] PR-42: cleanup spec
From: @openeuler-sync-bot 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2024-10-21 04:17:21 +00:00
Funda Wang
2e3787d599 cleanup spec
(cherry picked from commit a795b21e2a746735741cfb2a90beebc8bb10c974)
2024-10-21 11:53:37 +08:00
openeuler-ci-bot
a95f3b583d
!38 [sync] PR-34: backport patch from upstream
From: @openeuler-sync-bot 
Reviewed-by: @xujing99 
Signed-off-by: @xujing99
2024-08-05 02:33:53 +00:00
zhangruifang2020
93b1ca9c67 backport patch form upstream
(cherry picked from commit b6f633d5b7c57cbf6f78dbc1eb6ffb5998d4aeb6)
2024-08-01 10:13:16 +08:00
openeuler-ci-bot
6d99588db4
!32 [sync] PR-30: Rebuild for next release
From: @openeuler-sync-bot 
Reviewed-by: @licunlong 
Signed-off-by: @licunlong
2022-10-26 08:28:34 +00:00
renxichen
c0c122830a update for mass rebuild and upgrade verification
(cherry picked from commit 2d758cd2e2ae15d6fb45dc351b98e7de4dea8db3)
2022-10-26 10:45:08 +08:00
openeuler-ci-bot
0b264b73fd
!26 fix test-localconv
From: @renxichen 
Reviewed-by: @overweight 
Signed-off-by: @overweight
2022-03-08 03:02:27 +00:00
rwx403335
878e1a4f37 fix test-localconv 2022-03-08 10:40:08 +08:00
openeuler-ci-bot
dffe72c818 !23 upgrade version to 1.4.19
Merge pull request !23 from SandMan/master
2021-12-31 03:00:59 +00:00
weiwei_tiantian
36ec6a051b upgrade version to 1.4.19 2021-12-30 20:30:34 +08:00
8 changed files with 152 additions and 259 deletions

View File

@ -0,0 +1,83 @@
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index fccda9a..1675e54 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -2983,7 +2983,6 @@ AC_DEFUN([M4_FILE_LIST], [
tests/test-execute-child.c
tests/test-execute-main.c
tests/test-execute-script.c
- tests/test-execute.sh
tests/test-explicit_bzero.c
tests/test-fchdir.c
tests/test-fclose.c
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 64ce81c..ae1bfe3 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -126,7 +126,6 @@ TESTS = test-accept$(EXEEXT) test-access$(EXEEXT) \
test-ctype$(EXEEXT) $(am__EXEEXT_3) test-dirent$(EXEEXT) \
test-dirname$(EXEEXT) test-dup$(EXEEXT) test-dup2$(EXEEXT) \
test-dynarray$(EXEEXT) test-environ$(EXEEXT) $(am__EXEEXT_4) \
- test-errno$(EXEEXT) test-execute.sh \
test-execute-script$(EXEEXT) test-explicit_bzero$(EXEEXT) \
test-fchdir$(EXEEXT) test-fclose$(EXEEXT) $(am__EXEEXT_5) \
test-fcntl-h$(EXEEXT) test-fcntl$(EXEEXT) test-fdopen$(EXEEXT) \
@@ -4388,7 +4387,6 @@ EXTRA_DIST = accept.c w32sock.h test-accept.c signature.h macros.h \
test-dup.c signature.h macros.h test-dup2.c signature.h \
macros.h test-dynarray.c macros.h test-environ.c \
test-errno-c++.cc test-errno-c++2.cc test-errno.c \
- test-execute.sh test-execute-main.c test-execute-child.c \
test-execute-script.c executable-script executable-script.sh \
executable-shell-script macros.h explicit_bzero.c \
test-explicit_bzero.c signature.h macros.h test-fchdir.c \
@@ -6970,13 +6968,6 @@ test-errno.log: test-errno$(EXEEXT)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
-test-execute.sh.log: test-execute.sh
- @p='test-execute.sh'; \
- b='test-execute.sh'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
test-execute-script.log: test-execute-script$(EXEEXT)
@p='test-execute-script$(EXEEXT)'; \
b='test-execute-script'; \
diff --git a/tests/gnulib.mk b/tests/gnulib.mk
index 2c99ba9..0f8044e 100644
--- a/tests/gnulib.mk
+++ b/tests/gnulib.mk
@@ -519,7 +519,6 @@ EXTRA_DIST += test-errno.c
## begin gnulib module execute-tests
-TESTS += test-execute.sh
check_PROGRAMS += test-execute-main test-execute-child
test_execute_main_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
# The test-execute-child program must be a real executable, not a libtool
@@ -531,7 +530,6 @@ TESTS += test-execute-script
check_PROGRAMS += test-execute-script
test_execute_script_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
test_execute_script_CPPFLAGS = $(AM_CPPFLAGS) -DSRCDIR=\"$(srcdir)/\"
-EXTRA_DIST += test-execute.sh test-execute-main.c test-execute-child.c test-execute-script.c executable-script executable-script.sh executable-shell-script macros.h
## end gnulib module execute-tests
diff --git a/tests/test-execute.sh b/tests/test-execute.sh
deleted file mode 100755
index 15c8b47..0000000
--- a/tests/test-execute.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-st=0
-for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ; do
- ${CHECKER} ./test-execute-main${EXEEXT} ./test-execute-child${EXEEXT} $i \
- || { echo test-execute.sh: test case $i failed >&2; st=1; }
-done
-exit $st
--
1.8.3.1

View File

@ -1,124 +0,0 @@
From f9e2b20a12a230efa30f1d479563ae07d276a94b Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
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
Its 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.
---
lib/c-stack.c | 46 +++++++++++++++++-----------------------------
lib/c-stack.h | 2 +-
2 files changed, 18 insertions(+), 30 deletions(-)
diff --git a/lib/c-stack.c b/lib/c-stack.c
index 5353c08..7871e9c 100644
--- a/lib/c-stack.c
+++ b/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 <stdlib.h>
#include <string.h>
@@ -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)
diff --git a/lib/c-stack.h b/lib/c-stack.h
index efd3b8f..df8a790 100644
--- a/lib/c-stack.h
+++ b/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.
--
1.8.3.1

View File

@ -0,0 +1,35 @@
From a886ea40a29a08954ff80772e267828a1d440cc9 Mon Sep 17 00:00:00 2001
From: Eric Blake <eblake@redhat.com>
Date: Fri, 13 Jan 2023 16:27:54 -0600
Subject: [PATCH] output: Avoid tickling UBSAN with memcpy(dest, NULL, 0)
Even though all libc handle it sanely (because size 0 says there is
nothing to copy), NULL is not a valid source pointer per a strict
reading of C, so UBSAN flags it:
+output.c:511:9: runtime error: null pointer passed as argument 2, which is declared to never be null
* src/output.c (make_room_for): Skip no-op memcpy.
Fixes: https://savannah.gnu.org/support/index.php?110809
Reported-by: Sam James
---
src/output.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/output.c b/src/output.c
index 956089b1..6dc8280a 100644
--- a/src/output.c
+++ b/src/output.c
@@ -508,7 +508,8 @@ make_room_for (int length)
{
char *buffer = output_diversion->u.buffer;
output_diversion->u.buffer = xcharalloc ((size_t) wanted_size);
- memcpy (output_diversion->u.buffer, buffer, output_diversion->used);
+ if (output_diversion->used)
+ memcpy (output_diversion->u.buffer, buffer, output_diversion->used);
free (buffer);
}
--
2.33.0

View File

@ -1,115 +0,0 @@
diff -up m4-1.4.18/lib/fflush.c.orig m4-1.4.18/lib/fflush.c
--- m4-1.4.18/lib/fflush.c.orig 2018-05-02 12:35:59.536851666 +0200
+++ m4-1.4.18/lib/fflush.c 2018-05-02 12:37:02.768958606 +0200
@@ -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);
diff -up m4-1.4.18/lib/fpending.c.orig m4-1.4.18/lib/fpending.c
--- m4-1.4.18/lib/fpending.c.orig 2018-05-02 12:35:32.305806774 +0200
+++ m4-1.4.18/lib/fpending.c 2018-05-02 12:35:44.944827347 +0200
@@ -32,7 +32,7 @@ __fpending (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, 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 */
diff -up m4-1.4.18/lib/fpurge.c.orig m4-1.4.18/lib/fpurge.c
--- m4-1.4.18/lib/fpurge.c.orig 2018-05-02 12:38:13.586078669 +0200
+++ m4-1.4.18/lib/fpurge.c 2018-05-02 12:38:38.785121867 +0200
@@ -62,7 +62,7 @@ fpurge (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, 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. */
diff -up m4-1.4.18/lib/freadahead.c.orig m4-1.4.18/lib/freadahead.c
--- m4-1.4.18/lib/freadahead.c.orig 2016-12-31 14:54:41.000000000 +0100
+++ m4-1.4.18/lib/freadahead.c 2018-05-02 11:43:19.570336724 +0200
@@ -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)
diff -up m4-1.4.18/lib/freading.c.orig m4-1.4.18/lib/freading.c
--- m4-1.4.18/lib/freading.c.orig 2018-05-02 12:37:33.970011368 +0200
+++ m4-1.4.18/lib/freading.c 2018-05-02 12:37:59.393054359 +0200
@@ -31,7 +31,7 @@ freading (FILE *fp)
/* Most systems provide FILE as a struct and the necessary bitmask in
<stdio.h>, 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));
diff -up m4-1.4.18/lib/fseeko.c.orig m4-1.4.18/lib/fseeko.c
--- m4-1.4.18/lib/fseeko.c.orig 2018-05-02 11:44:17.947460233 +0200
+++ m4-1.4.18/lib/fseeko.c 2018-05-02 12:39:49.537216897 +0200
@@ -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__
diff -up m4-1.4.18/lib/stdio-impl.h.orig m4-1.4.18/lib/stdio-impl.h
--- m4-1.4.18/lib/stdio-impl.h.orig 2016-12-31 14:54:42.000000000 +0100
+++ m4-1.4.18/lib/stdio-impl.h 2018-05-02 11:43:19.570336724 +0200
@@ -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. */

Binary file not shown.

BIN
m4-1.4.19.tar.xz Normal file

Binary file not shown.

52
m4.spec
View File

@ -1,14 +1,14 @@
Name: m4
Version: 1.4.18
Release: 17
Version: 1.4.19
Release: 5
Summary: A GNU implementation of macro processor
License: GPLv3+
License: GPL-3.0-or-later
URL: https://www.gnu.org/software/m4/
Source0: https://ftp.gnu.org/gnu/m4/%{name}-%{version}.tar.xz
Patch0: m4-1.4.18-glibc-change-work-around.patch
Patch6000: backport-gnulib-c-stack.patch
Patch1: 0001-Delete-test-execute_sh.patch
Patch6000: backport-output-Avoid-tickling-UBSAN-with-memcpy-dest-NULL-0.patch
BuildRequires: gcc autoconf automake
BuildRequires: gcc autoconf automake gettext-devel
Provides: bundled(gnulib)
%description
@ -18,17 +18,15 @@ example, handling more than 9 positional parameters to macros). GNU M4
also has built-in functions for including files, running shell commands,
doing arithmetic, etc.
%package help
Summary: Help Document
BuildArch: noarch
Requires: %{name} = %{version}-%{release}
%description help
This package provides help document for m4.
%package_help
%prep
%autosetup -p1
%build
%ifarch aarch64
CFLAGS="$RPM_OPT_FLAGS -fsigned-char"
%endif
autoreconf -ivf
%configure
%make_build
@ -37,24 +35,40 @@ autoreconf -ivf
%make_install
rm -rf %{buildroot}%{_infodir}/dir
%check
%ifarch aarch64
CFLAGS="$RPM_OPT_FLAGS -fsigned-char"
%endif
make check
%find_lang %{name}
%files
%check
%make_build check
%files -f %{name}.lang
%doc README ChangeLog
%license COPYING AUTHORS
%{_bindir}/m4
%files help
%defattr(-,root,root)
%doc NEWS INSTALL THANKS TODO
%{_mandir}/man1/m4*
%{_infodir}/m4*
%changelog
* Mon Oct 21 2024 Funda Wang <fundawang@yeah.net> - 1.4.19-5
- cleanup spec
* Wed Jul 31 2024 zhangruifang <zhangruifang@h-partners.com> - 1.4.19-4
- backport patch from upstream
* Tue Oct 25 2022 renhongxun <renhongxun@h-partners.com> - 1.4.19-3
- Rebuild for next release
* Tue Mar 08 2022 renhongxun <renhongxun@h-partners.com> - 1.4.19-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix test-localconv
* Tue Dec 30 2021 liudabo <liudabo1@huawei.com> - 1.4.19-1
- DESC:update version to 1.4.19
* Tue Dec 21 2021 shixuantong <shixuantong@huawei.com> - 1.4.18-17
- Type:bugfix
- ID:NA

View File

@ -1,4 +1,4 @@
version_control: git
src_repo: https://git.savannah.gnu.org/git/m4.git
tag_prefix: ^v
seperator: "."
separator: "."