diff options
Diffstat (limited to 'meta/recipes-devtools/m4/m4')
7 files changed, 101 insertions, 297 deletions
diff --git a/meta/recipes-devtools/m4/m4/0001-Define-alignof_slot-using-_Alignof-when-using-C11-or.patch b/meta/recipes-devtools/m4/m4/0001-Define-alignof_slot-using-_Alignof-when-using-C11-or.patch new file mode 100644 index 0000000000..8757abd7a0 --- /dev/null +++ b/meta/recipes-devtools/m4/m4/0001-Define-alignof_slot-using-_Alignof-when-using-C11-or.patch @@ -0,0 +1,49 @@ +From b0fd3a58354b1f5ead891907979dfd3dd36840d5 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 14 Jan 2023 14:55:03 -0800 +Subject: [PATCH] Define alignof_slot using _Alignof when using C11 or newer + +WG14 N2350 made very clear that it is an UB having type definitions +within "offsetof" [1]. This patch enhances the implementation of macro +alignof_slot to use builtin "_Alignof" to avoid undefined behavior on +when using std=c11 or newer + +clang 16+ has started to flag this [2] + +Fixes build when using -std >= gnu11 and using clang16+ [3] + +[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm +[2] https://reviews.llvm.org/D133574 +[3] https://public-inbox.org/bug-gnulib/20230114232744.215167-1-raj.khem@gmail.com/T/#u + +Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=2d404c7dd974cc65f894526f4a1b76bc1dcd8d82] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/alignof.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/lib/alignof.h ++++ b/lib/alignof.h +@@ -18,19 +18,19 @@ + #define _ALIGNOF_H + + #include <stddef.h> ++#include "stdalign.h" + + /* alignof_slot (TYPE) + Determine the alignment of a structure slot (field) of a given type, + at compile time. Note that the result depends on the ABI. +- This is the same as alignof (TYPE) and _Alignof (TYPE), defined in +- <stdalign.h> if __alignof_is_defined is 1. ++ This is the same as alignof (TYPE). + Note: The result cannot be used as a value for an 'enum' constant, + due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc. */ + #if defined __cplusplus + template <class type> struct alignof_helper { char __slot1; type __slot2; }; + # define alignof_slot(type) offsetof (alignof_helper<type>, __slot2) + #else +-# define alignof_slot(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) ++# define alignof_slot(type) alignof (type) + #endif + + /* alignof_type (TYPE) diff --git a/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch deleted file mode 100644 index ba1a4bab4c..0000000000 --- a/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch +++ /dev/null @@ -1,33 +0,0 @@ -From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Mon, 13 Apr 2015 17:02:13 -0700 -Subject: [PATCH] Unset need_charset_alias when building for musl - -localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4 -which actually shoudl be fixed in gnulib and then all downstream -projects will get it eventually. For now we apply the fix to -coreutils - -Upstream-Status: Pending - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - lib/gnulib.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/gnulib.mk b/lib/gnulib.mk -index e1d74db..c0e92dd 100644 ---- a/lib/gnulib.mk -+++ b/lib/gnulib.mk -@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local - case '$(host_os)' in \ - darwin[56]*) \ - need_charset_alias=true ;; \ -- darwin* | cygwin* | mingw* | pw32* | cegcc*) \ -+ darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \ - need_charset_alias=false ;; \ - *) \ - need_charset_alias=true ;; \ --- -2.1.4 - diff --git a/meta/recipes-devtools/m4/m4/0001-c-stack-stop-using-SIGSTKSZ.patch b/meta/recipes-devtools/m4/m4/0001-c-stack-stop-using-SIGSTKSZ.patch deleted file mode 100644 index 883b8a2075..0000000000 --- a/meta/recipes-devtools/m4/m4/0001-c-stack-stop-using-SIGSTKSZ.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 69238f15129f35eb4756ad8e2004e0d7907cb175 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Fri, 30 Apr 2021 17:40:36 -0700 -Subject: [PATCH] c-stack: stop using SIGSTKSZ - -This patch is required with glibc 2.34+ -based on gnulib [1] - -[1] https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=f9e2b20a12a230efa30f1d479563ae07d276a94b - -Upstream-Status: Pending -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - lib/c-stack.c | 22 +++++++++++++--------- - 1 file changed, 13 insertions(+), 9 deletions(-) - -diff --git a/lib/c-stack.c b/lib/c-stack.c -index 5353c08..863f764 100644 ---- a/lib/c-stack.c -+++ b/lib/c-stack.c -@@ -51,13 +51,14 @@ - typedef struct sigaltstack stack_t; - #endif - #ifndef SIGSTKSZ --# define SIGSTKSZ 16384 --#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384 -+#define get_sigstksz() (16384) -+#elif HAVE_LIBSIGSEGV - /* 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 -+#define get_sigstksz() ((SIGSTKSZ) < 16384 ? 16384 : (SIGSTKSZ)) -+#else -+#define get_sigstksz() ((SIGSTKSZ)) - #endif - - #include <stdlib.h> -@@ -131,7 +132,8 @@ die (int signo) - /* Storage for the alternate signal stack. */ - static union - { -- char buffer[SIGSTKSZ]; -+ /* allocate buffer with size from get_sigstksz() */ -+ char *buffer; - - /* These other members are for proper alignment. There's no - standard way to guarantee stack alignment, but this seems enough -@@ -203,10 +205,11 @@ c_stack_action (void (*action) (int)) - program_error_message = _("program error"); - stack_overflow_message = _("stack overflow"); - -+ alternate_signal_stack.buffer = malloc(get_sigstksz()); - /* Always install the overflow handler. */ - if (stackoverflow_install_handler (overflow_handler, - alternate_signal_stack.buffer, -- sizeof alternate_signal_stack.buffer)) -+ get_sigstksz())) - { - errno = ENOTSUP; - return -1; -@@ -279,14 +282,15 @@ c_stack_action (void (*action) (int)) - stack_t st; - struct sigaction act; - st.ss_flags = 0; -+ alternate_signal_stack.buffer = malloc(get_sigstksz()); - # 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 *); -+ st.ss_sp = alternate_signal_stack.buffer + get_sigstksz() - sizeof (void *); -+ st.ss_size = get_sigstksz() - sizeof (void *); - # else - st.ss_sp = alternate_signal_stack.buffer; -- st.ss_size = sizeof alternate_signal_stack.buffer; -+ st.ss_size = get_sigstksz(); - # endif - r = sigaltstack (&st, NULL); - if (r != 0) --- -2.31.1 - diff --git a/meta/recipes-devtools/m4/m4/0001-sigsegv-Fix-build-on-ppc-musl.patch b/meta/recipes-devtools/m4/m4/0001-sigsegv-Fix-build-on-ppc-musl.patch new file mode 100644 index 0000000000..04320de63a --- /dev/null +++ b/meta/recipes-devtools/m4/m4/0001-sigsegv-Fix-build-on-ppc-musl.patch @@ -0,0 +1,37 @@ +From 36d5e26f606e070553eb0fff1f738e61970be5d7 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 9 Mar 2022 20:22:20 -0800 +Subject: [PATCH] sigsegv: Fix build on ppc/musl + +mcontext is not a standard layout so glibc and musl differ sadly. + +Fixes +../../m4-1.4.19/lib/sigsegv.c: In function 'sigsegv_handler': ../../m4-1.4.19/lib/sigsegv.c:223:75: error: 'mcontext_t' has no member named 'uc_regs'; did you mean 'gregs'? 223 | # define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.uc_regs->gregs[1] | ^~~~~~~ + +Upstream-Status: Submitted [https://lists.gnu.org/archive/html/m4-patches/2022-03/msg00000.html] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + lib/sigsegv.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/lib/sigsegv.c b/lib/sigsegv.c +index 696a152..fa0c465 100644 +--- a/lib/sigsegv.c ++++ b/lib/sigsegv.c +@@ -217,10 +217,10 @@ int libsigsegv_version = LIBSIGSEGV_VERSION; + # define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.gp_regs[1] + # else /* 32-bit */ + /* both should be equivalent */ +-# if 0 +-# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.regs->gpr[1] ++# if ! defined __GLIBC__ ++# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_regs->gregs[1] + # else +-# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.uc_regs->gregs[1] ++# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext.uc_regs->gregs[1] + # endif + # endif + +-- +2.35.1 + diff --git a/meta/recipes-devtools/m4/m4/0001-test-getopt-posix-fix.patch b/meta/recipes-devtools/m4/m4/0001-test-getopt-posix-fix.patch deleted file mode 100644 index 11508ee0e2..0000000000 --- a/meta/recipes-devtools/m4/m4/0001-test-getopt-posix-fix.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 75bea7c72a919859674f493548653de88f96c798 Mon Sep 17 00:00:00 2001 -From: Changqing Li <changqing.li@windriver.com> -Date: Mon, 22 Apr 2019 10:36:13 +0800 -Subject: [PATCH] test-getopt-posix fix - -fix below problem: -test-getopt.h:754: assertion 'strcmp (argv[1], "donald") == 0' failed - -get this patch from -https://github.com/habitat-sh/core-plans/blob/master/m4/fix-test-getopt-posix-with-glibc-2.26.patch - -Upstream-Status: Pending - -have report this bug to m4-discuss@gnu.org - -Signed-off-by: Changqing Li <changqing.li@windriver.com> ---- - tests/test-getopt-posix.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/tests/test-getopt-posix.c b/tests/test-getopt-posix.c -index 5532271..2a3d511 100644 ---- a/tests/test-getopt-posix.c -+++ b/tests/test-getopt-posix.c -@@ -22,6 +22,13 @@ - ftell link warning if we are not using the gnulib ftell module. */ - #define _GL_NO_LARGE_FILES - -+/* -+ * Glibc 2.26 does hard include bits/getopt_posix.h which causes the system -+ * to use glibc's getopt but the tests expect gnulib behavior. Until a better -+ * fix is available this avoids that mis-resolution. -+ */ -+#include <getopt.h> -+ - /* POSIX and glibc provide the getopt() function in <unistd.h>, see - http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html - https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html --- -2.7.4 - diff --git a/meta/recipes-devtools/m4/m4/ac_config_links.patch b/meta/recipes-devtools/m4/m4/ac_config_links.patch index 71edf59512..39fcd91896 100644 --- a/meta/recipes-devtools/m4/m4/ac_config_links.patch +++ b/meta/recipes-devtools/m4/m4/ac_config_links.patch @@ -12,20 +12,26 @@ source, and what we want is to is to not touch it. Tested on x86_64_linux (Ubuntu 8.04 and 9.10). -2009-11-10 Esben Haabendal <eha@doredevelopment.dk> +2009-11-10 Esben Haabendal <eha@doredevelopment.dk> +--- + configure | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) -Index: m4-1.4.18/configure -=================================================================== ---- m4-1.4.18.orig/configure -+++ m4-1.4.18/configure -@@ -24415,8 +24415,8 @@ $as_echo "#define GNULIB_TEST_GETTIMEOFD +diff --git a/configure b/configure +index 883336a..6343a34 100755 +--- a/configure ++++ b/configure +@@ -37061,8 +37061,8 @@ printf "%s\n" "#define GNULIB_TEST_GETRANDOM 1" >>confdefs.h # only, it does not matter if we skip the link with older autoconf. # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH # builds, so use a shell variable to bypass this. - GNUmakefile=GNUmakefile - ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" -+ # GNUmakefile=GNUmakefile -+ # ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" ++# GNUmakefile=GNUmakefile ++# ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" - : + LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL" +-- +2.25.1 + diff --git a/meta/recipes-devtools/m4/m4/m4-1.4.18-glibc-change-work-around.patch b/meta/recipes-devtools/m4/m4/m4-1.4.18-glibc-change-work-around.patch deleted file mode 100644 index c10bcbf693..0000000000 --- a/meta/recipes-devtools/m4/m4/m4-1.4.18-glibc-change-work-around.patch +++ /dev/null @@ -1,130 +0,0 @@ -update for glibc libio.h removal in 2.28+ - -see -https://src.fedoraproject.org/rpms/m4/c/814d592134fad36df757f9a61422d164ea2c6c9b?branch=master - -Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=4af4a4a718] -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -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 - <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 */ -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 - <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. */ -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 - <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)); -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. */ - |