summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-07-06 08:32:39 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-07-27 20:55:59 +0300
commit584e484ed377f1b4c43ceb08572168179cd46b02 (patch)
treeba6cbdedf991bcb4caddcd42e073bf0719670106
parenta50ed3988834d6b2b984eb43a297509b28fdf59f (diff)
downloadbdwgc-584e484ed377f1b4c43ceb08572168179cd46b02.tar.gz
Define SUNOS5SIGS macro for kFreeBSD
(a cherry-pick of commit 96c09ef22 from 'release-8_0') Issue #184 (bdwgc). * include/private/gcconfig.h [MPROTECT_VDB && (__GLIBC__<2 || __GLIBC__==2 && __GLIBC_MINOR__<2)]: Move error directive from os_dep.c. * include/private/gcconfig.h [FREEBSD && __GLIBC__] (SUNOS5SIGS): Define. * os_dep.c [MPROTECT_VDB && !DARWIN && FREEBSD] (GC_dirty_init): Do not check __GLIBC__.
-rw-r--r--include/private/gcconfig.h8
-rw-r--r--os_dep.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index 36d4b1f6..f7bfd288 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -2407,6 +2407,12 @@
# define SVR4
#endif
+#if defined(MPROTECT_VDB) && defined(__GLIBC__)
+# if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 2)
+# error glibc too old?
+# endif
+#endif
+
#if defined(SOLARIS) || defined(DRSNX)
/* OS has SOLARIS style semi-undocumented interface */
/* to dynamic loader. */
@@ -2420,7 +2426,7 @@
#endif
#if defined(FREEBSD) && (defined(__DragonFly__) || __FreeBSD__ >= 4 \
- || (__FreeBSD_kernel__ >= 4))
+ || __FreeBSD_kernel__ >= 4 || defined(__GLIBC__))
# define SUNOS5SIGS
#endif
diff --git a/os_dep.c b/os_dep.c
index 8a729563..f4632aee 100644
--- a/os_dep.c
+++ b/os_dep.c
@@ -3011,12 +3011,6 @@ STATIC void GC_default_push_other_roots(void)
typedef void (* PLAIN_HNDLR_PTR)(int);
# endif
-# if defined(__GLIBC__)
-# if __GLIBC__ < 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ < 2
-# error glibc too old?
-# endif
-# endif
-
#ifndef DARWIN
STATIC SIG_HNDLR_PTR GC_old_segv_handler = 0;
/* Also old MSWIN32 ACCESS_VIOLATION filter */
@@ -3343,7 +3337,7 @@ GC_INNER void GC_remove_protection(struct hblk *h, word nblocks,
GC_log_printf("Replaced other SIGSEGV handler\n");
}
# if defined(HPUX) || defined(LINUX) || defined(HURD) \
- || (defined(FREEBSD) && (defined(__GLIBC__) || defined(SUNOS5SIGS)))
+ || (defined(FREEBSD) && defined(SUNOS5SIGS))
sigaction(SIGBUS, &act, &oldact);
if (oldact.sa_flags & SA_SIGINFO) {
GC_old_bus_handler = oldact.sa_sigaction;