OSDN Git Service

2006-06-07 Petr Salinger <Petr.Salinger@seznam.cz>
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Sep 2006 18:45:08 +0000 (18:45 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Sep 2006 18:45:08 +0000 (18:45 +0000)
* configure.ac: add support for GNU/kFreeBSD, accepted by upstream
for gc 6.8.
* dyn_load.c: Likewise.
* include/gc.h: Likewise.
* private/gcconfig.h: Likewise.
* configure: Regenerate.
* include/gc_config.h.in: Regenerate.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117033 138bc75d-0d04-0410-961f-82ee72b054a4

boehm-gc/ChangeLog
boehm-gc/configure
boehm-gc/configure.ac
boehm-gc/dyn_load.c
boehm-gc/include/gc.h
boehm-gc/include/gc_config.h.in
boehm-gc/include/private/gcconfig.h

index bf4f0cd..08b08e8 100644 (file)
@@ -1,3 +1,13 @@
+2006-06-07  Petr Salinger  <Petr.Salinger@seznam.cz>
+
+       * configure.ac: add support for GNU/kFreeBSD, accepted by upstream
+       for gc 6.8.
+       * dyn_load.c: Likewise.
+       * include/gc.h: Likewise.
+       * private/gcconfig.h: Likewise.
+       * configure: Regenerate.
+       * include/gc_config.h.in: Regenerate.
+
 2006-09-14  Tom Tromey  <tromey@redhat.com>
 
        PR boehm-gc/29068.
index 3f2f5d8..00b1430 100755 (executable)
@@ -5444,6 +5444,32 @@ _ACEOF
        { echo "$as_me:$LINENO: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&5
 echo "$as_me: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&2;}
        ;;
+      *-*-kfreebsd*-gnu)
+       cat >>confdefs.h <<\_ACEOF
+#define GC_FREEBSD_THREADS 1
+_ACEOF
+
+       INCLUDES="$INCLUDES -pthread"
+       THREADDLLIBS=-pthread
+       cat >>confdefs.h <<\_ACEOF
+#define _REENTRANT 1
+_ACEOF
+
+         if test "${enable_parallel_mark}" = yes; then
+         cat >>confdefs.h <<\_ACEOF
+#define PARALLEL_MARK 1
+_ACEOF
+
+       fi
+       cat >>confdefs.h <<\_ACEOF
+#define THREAD_LOCAL_ALLOC 1
+_ACEOF
+
+       cat >>confdefs.h <<\_ACEOF
+#define USE_COMPILER_TLS 1
+_ACEOF
+
+               ;;
      *-*-freebsd*)
        { echo "$as_me:$LINENO: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&5
 echo "$as_me: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&2;}
index 807b7a1..45937dc 100644 (file)
@@ -155,6 +155,17 @@ case "$THREADS" in
      *-*-hpux10*)
        AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
        ;;
+      *-*-kfreebsd*-gnu)
+       AC_DEFINE(GC_FREEBSD_THREADS)
+       INCLUDES="$INCLUDES -pthread"
+       THREADDLLIBS=-pthread
+       AC_DEFINE(_REENTRANT)
+         if test "${enable_parallel_mark}" = yes; then
+         AC_DEFINE(PARALLEL_MARK)
+       fi
+       AC_DEFINE(THREAD_LOCAL_ALLOC)
+       AC_DEFINE(USE_COMPILER_TLS, 1,[use tls for boehm])
+               ;;
      *-*-freebsd*)
        AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")
        AC_DEFINE(GC_FREEBSD_THREADS,1,[support FreeBSD threads])
index 3485474..d82bad8 100644 (file)
@@ -26,7 +26,7 @@
  * 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(_GNU_SOURCE)
+#if (defined(__linux__) || defined(__GLIBC__)) && !defined(_GNU_SOURCE)
     /* Can't test LINUX, since this must be define before other includes */
 #   define _GNU_SOURCE
 #endif
@@ -392,7 +392,7 @@ GC_bool GC_register_main_static_data()
 /* For glibc 2.2.4+.  Unfortunately, it doesn't work for older */
 /* versions.  Thanks to Jakub Jelinek for most of the code.    */
 
-# if defined(LINUX) /* Are others OK here, too? */ \
+# if (defined(LINUX) || defined (__GLIBC__)) /* Are others OK here, too? */ \
      && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
          || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) 
 
index 5ba1f4b..52ee805 100644 (file)
@@ -499,7 +499,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
 #   define GC_RETURN_ADDR (GC_word)__return_address
 #endif
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__GLIBC__)
 # include <features.h>
 # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
      && !defined(__ia64__)
index 5055b50..41028c1 100644 (file)
 /* define GC_local_malloc() & GC_local_malloc_atomic() */
 #undef THREAD_LOCAL_ALLOC
 
+/* use tls for boehm */
+#undef USE_COMPILER_TLS
+
 /* use MMAP instead of sbrk to get new memory */
 #undef USE_MMAP
 
index c028e5d..d7d96b1 100644 (file)
@@ -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
 
 #      ifndef GC_FREEBSD_THREADS
 #          define MPROTECT_VDB
 #      endif
-#      define SIG_SUSPEND SIGUSR1
-#      define SIG_THR_RESTART SIGUSR2
+#      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 FREEBSD_STACKBOTTOM
 #      ifdef __ELF__
 #          define DYNAMIC_LOADING
 #          define PREFETCH_FOR_WRITE(x) __builtin_prefetch((x), 1)
 #      endif
 #   endif
+#   ifdef FREEBSD
+#      define OS_TYPE "FREEBSD"
+#      ifndef GC_FREEBSD_THREADS
+#          define MPROTECT_VDB
+#      endif
+#      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 FREEBSD_STACKBOTTOM
+#      ifdef __ELF__
+#          define DYNAMIC_LOADING
+#      endif
+       extern char etext[];
+       extern char * GC_FreeBSDGetDataStart();
+#      define DATASTART GC_FreeBSDGetDataStart(0x1000, &etext)
+#   endif
 #   ifdef NETBSD
 #      define OS_TYPE "NETBSD"
 #      ifdef __ELF__
 #   define SUNOS5SIGS
 # endif
 
-# if defined(FREEBSD) && (__FreeBSD__ >= 4)
+# if defined(FREEBSD) && ((__FreeBSD__ >= 4) || (__FreeBSD_kernel__ >= 4))
 #   define SUNOS5SIGS
 # endif
 
 #   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 */
 #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