From: Zoltan Varga Date: Mon, 11 Apr 2005 14:12:45 +0000 (+0000) Subject: 2005-04-11 Zoltan Varga X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6d365f80cf7f5ca52aebeaa7506bb64d50f2807;p=gc 2005-04-11 Zoltan Varga * include/private/gcconfig.h configure.in os_dep.c dyn_load.c: Applied some freebsd patch from Bill Middleton . svn path=/trunk/mono/; revision=42786 --- diff --git a/ChangeLog b/ChangeLog index a5879fa7..5af85fc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-04-11 Zoltan Varga + + * include/private/gcconfig.h configure.in os_dep.c dyn_load.c: + Applied some freebsd patch from Bill Middleton . + 2005-04-06 Zoltan Varga * solaris_pthreads.c (GC_pthread_detach): Add locking. diff --git a/configure.in b/configure.in index bdaa5c5d..707954ef 100644 --- a/configure.in +++ b/configure.in @@ -124,6 +124,17 @@ case "$THREADS" in 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) diff --git a/dyn_load.c b/dyn_load.c index f1431223..7111a874 100644 --- a/dyn_load.c +++ b/dyn_load.c @@ -96,20 +96,28 @@ /* 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) diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index da7a4592..16dd7cfc 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -1186,8 +1186,8 @@ # 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 @@ -1501,8 +1501,8 @@ # 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 diff --git a/os_dep.c b/os_dep.c index 83f468e8..5c2bf165 100644 --- a/os_dep.c +++ b/os_dep.c @@ -702,10 +702,10 @@ ptr_t GC_get_stack_base() # 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 @@ -720,7 +720,7 @@ ptr_t GC_get_stack_base() # 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; @@ -740,7 +740,7 @@ ptr_t GC_get_stack_base() # 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. */ @@ -776,10 +776,10 @@ ptr_t GC_get_stack_base() 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