+2005-04-11 Zoltan Varga <vargaz@freemail.hu>
+
+ * include/private/gcconfig.h configure.in os_dep.c dyn_load.c:
+ Applied some freebsd patch from Bill Middleton <flashdict@gmail.com>.
+
2005-04-06 Zoltan Varga <vargaz@freemail.hu>
* solaris_pthreads.c (GC_pthread_detach): Add locking.
THREADLIBS="$PTHREAD_LIBS"
fi
;;
+ *-*-freebsd6*)
+ AC_DEFINE(GC_FREEBSD_THREADS)
+ if test "x$PTHREAD_CFLAGS" != "x"; then
+ INCLUDES="$INCLUDES $PTHREAD_CFLAGS"
+ fi
+ if test "x$PTHREAD_LIBS" = "x"; then
+ THREADLIBS=-lpthread
+ else
+ THREADLIBS="$PTHREAD_LIBS"
+ fi
+ ;;
*-*-solaris*)
AC_DEFINE(GC_SOLARIS_THREADS)
AC_DEFINE(GC_SOLARIS_PTHREADS)
/* Newer versions of GNU/Linux define this macro. We
* define it similarly for any ELF systems that don't. */
# ifndef ElfW
-# ifdef NETBSD
-# if ELFSIZE == 32
+# ifdef FREEBSD
+# if __ELF_WORD_SIZE == 32
# define ElfW(type) Elf32_##type
# else
# define ElfW(type) Elf64_##type
# endif
# else
-# if !defined(ELF_CLASS) || ELF_CLASS == ELFCLASS32
-# define ElfW(type) Elf32_##type
+# ifdef NETBSD
+# if ELFSIZE == 32
+# define ElfW(type) Elf32_##type
+# else
+# define ElfW(type) Elf64_##type
+# endif
# else
-# define ElfW(type) Elf64_##type
+# if !defined(ELF_CLASS) || ELF_CLASS == ELFCLASS32
+# define ElfW(type) Elf32_##type
+# else
+# define ElfW(type) Elf64_##type
+# endif
# endif
# endif
-# endif
+# endif
#if defined(SUNOS5DL) && !defined(USE_PROC_FOR_LIBRARIES)
# ifndef GC_FREEBSD_THREADS
# define MPROTECT_VDB
# endif
-# define SIG_SUSPEND SIGUSR1
-# define SIG_THR_RESTART SIGUSR2
+# define SIG_SUSPEND SIGTSTP
+# define SIG_THR_RESTART SIGCONT
# define FREEBSD_STACKBOTTOM
# ifdef __ELF__
# define DYNAMIC_LOADING
# ifdef FREEBSD
# define OS_TYPE "FREEBSD"
/* MPROTECT_VDB is not yet supported at all on FreeBSD/alpha. */
-# define SIG_SUSPEND SIGUSR1
-# define SIG_THR_RESTART SIGUSR2
+# define SIG_SUSPEND SIGTSTP
+# define SIG_THR_RESTART SIGCONT
# define FREEBSD_STACKBOTTOM
# ifdef __ELF__
# define DYNAMIC_LOADING
# endif
# if defined(SUNOS5SIGS) || defined(IRIX5) || defined(OSF1) \
- || defined(HURD) || defined(NETBSD)
+ || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
static struct sigaction old_segv_act;
# if defined(_sigargs) /* !Irix6.x */ || defined(HPUX) \
- || defined(HURD) || defined(NETBSD)
+ || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
static struct sigaction old_bus_act;
# endif
# else
# endif
{
# if defined(SUNOS5SIGS) || defined(IRIX5) \
- || defined(OSF1) || defined(HURD) || defined(NETBSD)
+ || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
struct sigaction act;
act.sa_handler = h;
# else
(void) sigaction(SIGSEGV, &act, &old_segv_act);
# if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \
- || defined(HPUX) || defined(HURD) || defined(NETBSD)
+ || defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
/* Under Irix 5.x or HP/UX, we may get SIGBUS. */
/* Pthreads doesn't exist under Irix 5.x, so we */
/* don't have to worry in the threads case. */
void GC_reset_fault_handler()
{
# if defined(SUNOS5SIGS) || defined(IRIX5) \
- || defined(OSF1) || defined(HURD) || defined(NETBSD)
+ || defined(OSF1) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
(void) sigaction(SIGSEGV, &old_segv_act, 0);
# if defined(IRIX5) && defined(_sigargs) /* Irix 5.x, not 6.x */ \
- || defined(HPUX) || defined(HURD) || defined(NETBSD)
+ || defined(HPUX) || defined(HURD) || defined(NETBSD) || defined(FREEBSD)
(void) sigaction(SIGBUS, &old_bus_act, 0);
# endif
# else