Hi!
I tried sending this a month ago, but it hasn't hit the mailing list
yet. I've removed the URL to the macports patch, perhaps that will
allow this to go through.
Original email:
Hi!
I'm looking at updating m4 in pkgsrc, and found another old patch.
pkgsrc comes from NetBSD, but it's been used on many platforms,
including old macOS releases. For that reason we've adapted (a
macports patch).
I'll attach the current version, can you please consider it for
inclusion?
Thanks,
Thomas
$NetBSD: patch-lib_sigsegv.c,v 1.3 2026/04/07 12:23:36 wiz Exp $
Use older regnames on MacOS X 10.4 "Tiger", taken from macports.
--- lib/sigsegv.c.orig 2026-02-03 19:04:18.000000000 +0000
+++ lib/sigsegv.c
@@ -35,6 +35,9 @@
# include <sys/param.h> /* defines macro OpenBSD */
#endif
+#ifdef __APPLE__
+# include <AvailabilityMacros.h>
+#endif
/* Version number. */
int libsigsegv_version = LIBSIGSEGV_VERSION;
@@ -660,7 +663,11 @@ int libsigsegv_version = LIBSIGSEGV_VERSION;
- 'ucontext_t' and 'struct __darwin_ucontext' in <sys/_types/_ucontext.h>,
- 'struct __darwin_mcontext64' in <i386/_mcontext.h>, and
- 'struct __darwin_x86_thread_state64' in <mach/i386/_structs.h>. */
+# if __MAC_OS_X_VERSION_MAX_ALLOWED < 1050
+# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext->ss.rsp
+# else
# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext->__ss.__rsp
+# endif
# elif defined __i386__
@@ -668,7 +675,11 @@ int libsigsegv_version = LIBSIGSEGV_VERSION;
- 'ucontext_t' and 'struct __darwin_ucontext' in <sys/_types/_ucontext.h>,
- 'struct __darwin_mcontext32' in <i386/_mcontext.h>, and
- 'struct __darwin_i386_thread_state' in <mach/i386/_structs.h>. */
+# if __MAC_OS_X_VERSION_MAX_ALLOWED < 1050
+# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext->ss.esp
+# else
# define SIGSEGV_FAULT_STACKPOINTER ((ucontext_t *) ucp)->uc_mcontext->__ss.__esp
+# endif
# elif defined __arm64__