summaryrefslogtreecommitdiff
path: root/include/private/gcconfig.h
diff options
context:
space:
mode:
authorJo Shields <jo.shields@xamarin.com>2014-07-31 10:26:34 +0100
committerIvan Maidanski <ivmai@mail.ru>2015-05-17 13:28:44 +0300
commit04c54798a3b85617dc47874b78963b834cecf783 (patch)
tree50b08e6d95edc9d56584eb37555f0746978fd72e /include/private/gcconfig.h
parent81279ac8456f07f1c82de31054096ab0863a1d32 (diff)
downloadbdwgc-04c54798a3b85617dc47874b78963b834cecf783.tar.gz
Support for GNU/kFreeBSD.
GNU/kFreeBSD is an experimental OS provided by the Debian project, consisting of a FreeBSD kernel and GNU userland/libc. For a small number of cases, this offers advantages over a more common GNU/Linux combination, such as fast in-kernel support for ZFS storage. This patch changes various ifdefs, either using __FreeBSD_kernel__ where a trait from the kernel is what matters, or __GLIBC__ where a trait from the C library matters. This patch set has been carried downstream, in one form or another, since 1.2.3.1-1. https://bugzilla.novell.com/show_bug.cgi?id=321634
Diffstat (limited to 'include/private/gcconfig.h')
-rw-r--r--include/private/gcconfig.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
index 418e046a..3cbab919 100644
--- a/include/private/gcconfig.h
+++ b/include/private/gcconfig.h
@@ -55,7 +55,7 @@
# endif
/* And one for FreeBSD: */
-# if defined(__FreeBSD__) && !defined(FREEBSD)
+# if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) && !defined(FREEBSD)
# define FREEBSD
# endif
@@ -1371,8 +1371,15 @@
# ifndef GC_FREEBSD_THREADS
# define MPROTECT_VDB
# endif
-# define SIG_SUSPEND SIGTSTP
-# define SIG_THR_RESTART SIGCONT
+# ifdef __GLIBC__
+# define SIG_SUSPEND (32+6)
+# define SIG_THR_RESTART (32+5)
+ extern int _end[];
+# define DATAEND (_end)
+# else
+# define SIG_SUSPEND SIGTSTP
+# define SIG_THR_RESTART SIGCONT
+# endif
# define FREEBSD_STACKBOTTOM
# ifdef __ELF__
# define DYNAMIC_LOADING
@@ -2132,8 +2139,15 @@
# ifndef GC_FREEBSD_THREADS
# define MPROTECT_VDB
# endif
-# define SIG_SUSPEND SIGTSTP
-# define SIG_THR_RESTART SIGCONT
+# ifdef __GLIBC__
+# define SIG_SUSPEND (32+6)
+# define SIG_THR_RESTART (32+5)
+ extern int _end[];
+# define DATAEND (_end)
+# else
+# define SIG_SUSPEND SIGUSR1
+# define SIG_THR_RESTART SIGUSR2
+# endif
# define NEED_FIND_LIMIT
# define FREEBSD_STACKBOTTOM
# ifdef __ELF__
@@ -2230,7 +2244,7 @@
# define SUNOS5SIGS
# endif
-# if defined(FREEBSD) && (__FreeBSD__ >= 4)
+# if defined(FREEBSD) && ((__FreeBSD__ >= 4) || (__FreeBSD_kernel__ >= 4))
# define SUNOS5SIGS
# endif
@@ -2293,7 +2307,7 @@
# define CACHE_LINE_SIZE 32 /* Wild guess */
# endif
-# ifdef LINUX
+# if defined(LINUX) || defined(__GLIBC__)
# define REGISTER_LIBRARIES_EARLY
/* We sometimes use dl_iterate_phdr, which may acquire an internal */
/* lock. This isn't safe after the world has stopped. So we must */
@@ -2374,7 +2388,7 @@
#if defined(SPARC)
# define CAN_SAVE_CALL_ARGS
#endif
-#if (defined(I386) || defined(X86_64)) && defined(LINUX)
+#if (defined(I386) || defined(X86_64)) && (defined(LINUX) || defined(__GLIBC__))
/* SAVE_CALL_CHAIN is supported if the code is compiled to save */
/* frame pointers by default, i.e. no -fomit-frame-pointer flag. */
# define CAN_SAVE_CALL_ARGS