]> granicus.if.org Git - gc/commitdiff
boehm-gc/ * configure.ac: Add stanza for *-*-gnu* threads configuration. * configure...
authortschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Nov 2012 22:56:02 +0000 (22:56 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 15 Sep 2013 09:13:02 +0000 (13:13 +0400)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193142 138bc75d-0d04-0410-961f-82ee72b054a4

ChangeLog
configure
configure.ac
dyn_load.c
include/gc_config.h.in
include/gc_config_macros.h
include/private/gcconfig.h
os_dep.c
pthread_support.c
specific.c
threadlibs.c

index 57359f0beaff02ea1ac90156f302c3313e68c24e..7759258ab33238c65fabaf006671d30a108ed44f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2012-11-04  Samuel Thibault  <samuel.thibault@gnu.org>
+
+       * configure.ac: Add stanza for *-*-gnu* threads configuration.
+       * configure: Regenerate.
+       * include/gc_config.h.in: Likewise.
+       * dyn_load.c (_GNU_SOURCE): Define for __GNU__.
+       * include/gc_config_macros.h (_REENTRANT, GC_PTHREADS): Define for
+       GC_GNU_THREADS.
+       * include/private/gcconfig.h (DATASTART): Don't define for I386 &&
+       HURD.
+       (SIG_SUSPEND, SIG_THR_RESTART, SEARCH_FOR_DATA_START): Define for
+       I386 && HURD.
+       (UNIX_LIKE, REGISTER_LIBRARIES_EARLY): Define for HURD.
+       * os_dep.c (GC_init_linux_data_start): Handle for HURD.
+       * pthread_support.c (GC_thr_init): Add case for GC_GNU_THREADS.
+       * specific.c: Use for GC_GNU_THREADS.
+       * threadlibs.c: Add case for GC_GNU_THREADS.
+
 2012-09-14  David Edelsohn  <dje.gcc@gmail.com>
 
        * configure: Regenerated.
index 1d751fd684f0ba03bc73ca60499d3c92b03165b9..6020e9884eb98c662dc349cb57066039d6e72352 100755 (executable)
--- a/configure
+++ b/configure
@@ -14796,6 +14796,15 @@ $as_echo "$as_me: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&2;}
 $as_echo "#define USE_COMPILER_TLS 1" >>confdefs.h
 
        ;;
+     *-*-gnu*)
+
+$as_echo "#define GC_GNU_THREADS 1" >>confdefs.h
+
+       $as_echo "#define _REENTRANT 1" >>confdefs.h
+
+       $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h
+
+       ;;
      *-*-freebsd*)
        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&5
 $as_echo "$as_me: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&2;}
index 2eddc9fe7abd6b82b45c066e1a01045ba2cd3a38..1ccfe37e9d8622388d725a87bade72900b3b3b42 100644 (file)
@@ -175,6 +175,11 @@ case "$THREADS" in
        AC_DEFINE(THREAD_LOCAL_ALLOC)
        AC_DEFINE(USE_COMPILER_TLS, 1,[use tls for boehm])
        ;;
+     *-*-gnu*)
+       AC_DEFINE(GC_GNU_THREADS,1,[support GNU threads])
+       AC_DEFINE(_REENTRANT)
+       AC_DEFINE(THREAD_LOCAL_ALLOC)
+       ;;
      *-*-freebsd*)
        AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
        AC_DEFINE(GC_FREEBSD_THREADS,1,[support FreeBSD threads])
index f1e3e8ec74fdb41b8174dd2d66c2638ba1725f6e..eac2e71673fbd07d033de23e8cd0dea96cc57bf2 100644 (file)
@@ -26,7 +26,8 @@
  * None of this is safe with dlclose and incremental collection.
  * But then not much of anything is safe in the presence of dlclose.
  */
-#if (defined(__linux__) || defined(__GLIBC__)) && !defined(_GNU_SOURCE)
+#if (defined(__linux__) || defined(__GLIBC__) || defined(__GNU__)) \
+    && !defined(_GNU_SOURCE)
     /* Can't test LINUX, since this must be define before other includes */
 #   define _GNU_SOURCE
 #endif
index 6bdd807bcfaedababec86e3ba1a5d372967b5d93..d1ae47d88f44197e688c57d097422c707b739c0d 100644 (file)
@@ -33,6 +33,9 @@
 /* include support for gcj */
 #undef GC_GCJ_SUPPORT
 
+/* support GNU threads */
+#undef GC_GNU_THREADS
+
 /* enables support for HP/UX 11 pthreads */
 #undef GC_HPUX_THREADS
 
index 12e91e27f5e74d3970756484ceaea7ee15638fde..fd3006c178904d007d89c135476a18541dd298ec 100644 (file)
@@ -6,7 +6,8 @@
                             || defined(GC_SOLARIS_PTHREADS) \
                             || defined(GC_HPUX_THREADS) \
                             || defined(GC_AIX_THREADS) \
-                            || defined(GC_LINUX_THREADS))
+                            || defined(GC_LINUX_THREADS) \
+                            || defined(GC_GNU_THREADS))
 # define _REENTRANT
        /* Better late than never.  This fails if system headers that   */
        /* depend on this were previously included.                     */
@@ -18,6 +19,7 @@
 
 # if defined(GC_SOLARIS_PTHREADS) || defined(GC_FREEBSD_THREADS) || \
        defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \
+       defined(GC_GNU_THREADS) || \
        defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
        defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
        defined(GC_AIX_THREADS) || \
index 0263c13fd885aad19bc7d62d69acefe743d14ca8..594ce431e029f4256a8c2f3cdd370c90759bf4b8 100644 (file)
 #     define OS_TYPE "HURD"
 #     define STACK_GROWS_DOWN
 #     define HEURISTIC2
-      extern int  __data_start[];
-#     define DATASTART ( (ptr_t) (__data_start))
+#     define SIG_SUSPEND SIGUSR1
+#     define SIG_THR_RESTART SIGUSR2
+#     define SEARCH_FOR_DATA_START
       extern int   _end[];
 #     define DATAEND ( (ptr_t) (_end))
 /* #     define MPROTECT_VDB  Not quite working yet? */
 # if defined(SVR4) || defined(LINUX) || defined(IRIX5) || defined(HPUX) \
            || defined(OPENBSD) || defined(NETBSD) || defined(FREEBSD) \
            || defined(DGUX) || defined(BSD) || defined(SUNOS4) \
-           || defined(_AIX) || defined(DARWIN) || defined(OSF1)
+           || defined(_AIX) || defined(DARWIN) || defined(OSF1) \
+           || defined(HURD)
 #   define UNIX_LIKE   /* Basic Unix-like system calls work.   */
 # endif
 
 #   define CACHE_LINE_SIZE 32  /* Wild guess   */
 # endif
 
-# if defined(LINUX) || defined(__GLIBC__)
+# if defined(LINUX) || defined(HURD) || 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 */
 # if defined(GC_AIX_THREADS) && !defined(_AIX)
        --> inconsistent configuration
 # endif
+# if defined(GC_GNU_THREADS) && !defined(HURD)
+       --> inconsistent configuration
+# endif
 # if defined(GC_WIN32_THREADS) && !defined(MSWIN32) && !defined(CYGWIN32)
        --> inconsistent configuration
 # endif
index ca8be1a8236cbd149a75aed7fb21c7de8b994d62..a2dd3046dad171883cf693a1ed374ea5cfbfe2fd 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -312,7 +312,7 @@ char *GC_parse_map_entry(char *buf_ptr, word *start, word *end,
   /* for recent Linux versions.  This seems to be the easiest way to   */
   /* cover all versions.                                               */
 
-# ifdef LINUX
+# if defined(LINUX) || defined(HURD)
     /* Some Linux distributions arrange to define __data_start.  Some  */
     /* define data_start as a weak symbol.  The latter is technically  */
     /* broken, since the user program may define data_start, in which  */
@@ -331,7 +331,7 @@ char *GC_parse_map_entry(char *buf_ptr, word *start, word *end,
   {
     extern ptr_t GC_find_limit();
 
-#   ifdef LINUX
+#   if defined(LINUX) || defined(HURD)
       /* Try the easy approaches first:        */
       if ((ptr_t)__data_start != 0) {
          GC_data_start = (ptr_t)(__data_start);
index b3abc69e68b58ffcd425ed7b262bdd2443921510..6d8f020e076c13af730e219dd18f93bbf67d8628 100644 (file)
@@ -884,7 +884,7 @@ void GC_thr_init()
          GC_nprocs = pthread_num_processors_np();
 #       endif
 #      if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) \
-          || defined(GC_SOLARIS_PTHREADS)
+          || defined(GC_SOLARIS_PTHREADS) || defined(GC_GNU_THREADS)
          GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN);
          if (GC_nprocs <= 0) GC_nprocs = 1;
 #      endif
index 7d5d8894d81039f43bc4cfffdefe09df275d91ce..e78cf7ac912ac3b707898d11d315d175f4fcade3 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "private/gc_priv.h" /* For GC_compare_and_exchange, GC_memory_barrier */
 
-#if defined(GC_LINUX_THREADS)
+#if defined(GC_LINUX_THREADS) || defined(GC_GNU_THREADS)
 
 #include "private/specific.h"
 
index 9078c8d8cd99f4e7bcf71a3d4990375a9ab9e9fd..69fcc5e90ab588eed22913b99f6b5891337d20a9 100644 (file)
@@ -12,7 +12,8 @@ int main()
 #   endif
 #   if defined(GC_LINUX_THREADS) || defined(GC_IRIX_THREADS) \
        || defined(GC_SOLARIS_PTHREADS) \
-       || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)
+       || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
+       || defined(GC_GNU_THREADS)
         printf("-lpthread\n");
 #   endif
 #   if defined(GC_FREEBSD_THREADS)