hackish-threaded.patch
| gc-7.2/CMakeLists.txt 2012-10-13 16:23:05.089626000 -0500 | ||
|---|---|---|
| 140 | 140 |
ADD_DEFINITIONS("-D_REENTRANT")
|
| 141 | 141 |
ADD_DEFINITIONS("-D_PTHREADS")
|
| 142 | 142 |
ENDIF() |
| 143 |
IF ( "HOST" MATCHES .*-.*-dragonfly.*) |
|
| 144 |
ADD_DEFINITIONS("-DGC_DRAGONFLY_THREADS")
|
|
| 145 |
ADD_DEFINITIONS("-D_REENTRANT")
|
|
| 146 |
ADD_DEFINITIONS("-D_PTHREADS")
|
|
| 147 |
ENDIF() |
|
| 143 | 148 |
IF ( "HOST" MATCHES .*-.*-solaris.*) |
| 144 | 149 |
ADD_DEFINITIONS("-DGC_SOLARIS_THREADS")
|
| 145 | 150 |
ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC")
|
| gc-7.2/configure 2012-10-13 16:20:05.062617000 -0500 | ||
|---|---|---|
| 5003 | 5003 | |
| 5004 | 5004 |
THREADDLLIBS="-lpthread -lrt" |
| 5005 | 5005 |
;; |
| 5006 |
*-*-dragonfly*) |
|
| 5007 |
$as_echo "#define GC_DRAGONFLY_THREADS 1" >>confdefs.h |
|
| 5008 | ||
| 5009 |
$as_echo "#define _REENTRANT 1" >>confdefs.h |
|
| 5010 | ||
| 5011 |
$as_echo "#define _PTHREADS 1" >>confdefs.h |
|
| 5012 | ||
| 5013 |
THREADDLLIBS="-lpthread -lrt" |
|
| 5014 |
;; |
|
| 5006 | 5015 |
*-*-solaris*) |
| 5007 | 5016 |
$as_echo "#define GC_SOLARIS_THREADS 1" >>confdefs.h |
| 5008 | 5017 | |
| gc-7.2/dyn_load.c 2012-10-13 16:16:10.960939000 -0500 | ||
|---|---|---|
| 83 | 83 |
# define ELFSIZE ARCH_ELFSIZE |
| 84 | 84 |
#endif |
| 85 | 85 | |
| 86 |
#if defined(__DragonFly__) |
|
| 87 |
# include <dlfcn.h> |
|
| 88 |
#endif |
|
| 89 | ||
| 86 | 90 |
#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) \ |
| 87 | 91 |
|| (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \ |
| 88 | 92 |
|| defined(NETBSD) || defined(OPENBSD))) |
| ... | ... | |
| 405 | 409 |
# define DL_ITERATE_PHDR_STRONG |
| 406 | 410 |
#endif |
| 407 | 411 | |
| 412 |
#if defined(__DragonFly__) |
|
| 413 |
/* On the DragonFlyBSD system, any target system at major version FIXME */ |
|
| 414 |
/* have dl_iterate_phdr; therefore, we need not make it weak as above. */ |
|
| 415 |
# define HAVE_DL_ITERATE_PHDR |
|
| 416 |
# define DL_ITERATE_PHDR_STRONG |
|
| 417 |
#endif |
|
| 418 | ||
| 408 | 419 |
#if defined(HAVE_DL_ITERATE_PHDR) |
| 409 | 420 | |
| 410 | 421 |
# ifdef PT_GNU_RELRO |
| ... | ... | |
| 646 | 657 |
return(0); |
| 647 | 658 |
} |
| 648 | 659 |
if( cachedResult == 0 ) {
|
| 649 |
# if defined(NETBSD) && defined(RTLD_DI_LINKMAP) |
|
| 660 |
# if (defined(NETBSD) && defined(RTLD_DI_LINKMAP)) \ |
|
| 661 |
|| defined(__DragonFly__) |
|
| 650 | 662 |
struct link_map *lm = NULL; |
| 651 | 663 |
if (!dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &lm)) |
| 652 | 664 |
cachedResult = lm; |
| gc-7.2/extra/threadlibs.c 2012-10-13 16:23:32.885602000 -0500 | ||
|---|---|---|
| 49 | 49 |
printf("-pthread\n");
|
| 50 | 50 |
# endif |
| 51 | 51 |
# endif |
| 52 |
# if defined(GC_NETBSD_THREADS) |
|
| 52 |
# if defined(GC_NETBSD_THREADS) || defined(GC_DRAGONFLY_THREADS)
|
|
| 53 | 53 |
printf("-lpthread -lrt\n");
|
| 54 | 54 |
# endif |
| 55 | 55 | |
| gc-7.2/include/gc_config_macros.h 2012-10-13 16:30:50.679991000 -0500 | ||
|---|---|---|
| 67 | 67 |
|| defined(GC_GNU_THREADS) || defined(GC_HPUX_THREADS) \ |
| 68 | 68 |
|| defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) \ |
| 69 | 69 |
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \ |
| 70 |
|| defined(GC_OSF1_THREADS) || defined(GC_SOLARIS_THREADS) \ |
|
| 71 |
|| defined(GC_WIN32_THREADS) || defined(GC_RTEMS_PTHREADS) |
|
| 70 |
|| defined(GC_DRAGONFLY_THREADS) || defined(GC_OSF1_THREADS) \ |
|
| 71 |
|| defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) \ |
|
| 72 |
|| defined(GC_RTEMS_PTHREADS) |
|
| 72 | 73 |
# ifndef GC_THREADS |
| 73 | 74 |
# define GC_THREADS |
| 74 | 75 |
# endif |
| ... | ... | |
| 99 | 100 |
&& !defined(GC_OSF1_THREADS) && !defined(GC_IRIX_THREADS) |
| 100 | 101 |
/* FIXME: Should we really need for FreeBSD and NetBSD to check */ |
| 101 | 102 |
/* that no other GC_xxx_THREADS macro is set? */ |
| 102 |
# if defined(__FreeBSD__) || defined(__DragonFly__)
|
|
| 103 |
# if defined(__FreeBSD__) |
|
| 103 | 104 |
# define GC_FREEBSD_THREADS |
| 105 |
# elif defined(__DragonFly__) |
|
| 106 |
# define GC_DRAGONFLY_THREADS |
|
| 104 | 107 |
# elif defined(__NetBSD__) |
| 105 | 108 |
# define GC_NETBSD_THREADS |
| 106 | 109 |
# endif |
| ... | ... | |
| 131 | 134 |
# define GC_PTHREADS |
| 132 | 135 |
#endif |
| 133 | 136 | |
| 134 |
#if !defined(_PTHREADS) && defined(GC_NETBSD_THREADS) |
|
| 137 |
#if !defined(_PTHREADS) \ |
|
| 138 |
&& (defined(GC_NETBSD_THREADS) || defined(GC_DRAGONFLY_THREADS)) |
|
| 135 | 139 |
# define _PTHREADS |
| 136 | 140 |
#endif |
| 137 | 141 | |
| gc-7.2/include/private/config.h.in 2012-10-13 16:29:14.313420000 -0500 | ||
|---|---|---|
| 63 | 63 |
/* Define to support NetBSD pthreads. */ |
| 64 | 64 |
#undef GC_NETBSD_THREADS |
| 65 | 65 | |
| 66 |
/* Define to support DragonFly pthreads. */ |
|
| 67 |
#undef GC_DRAGONFLY_THREADS |
|
| 68 | ||
| 66 | 69 |
/* Define to support OpenBSD pthreads. */ |
| 67 | 70 |
#undef GC_OPENBSD_THREADS |
| 68 | 71 | |
| gc-7.2/include/private/gcconfig.h 2012-10-13 16:30:15.411245000 -0500 | ||
|---|---|---|
| 2549 | 2549 |
#if defined(GC_NETBSD_THREADS) && !defined(NETBSD) |
| 2550 | 2550 |
# error --> inconsistent configuration |
| 2551 | 2551 |
#endif |
| 2552 |
#if defined(GC_DRAGONFLY_THREADS) && !defined(__DragonFly__) |
|
| 2553 |
# error --> inconsistent configuration |
|
| 2554 |
#endif |
|
| 2552 | 2555 |
#if defined(GC_FREEBSD_THREADS) && !defined(FREEBSD) |
| 2553 | 2556 |
# error --> inconsistent configuration |
| 2554 | 2557 |
#endif |
| gc-7.2/include/private/thread_local_alloc.h 2012-10-13 16:29:39.672517000 -0500 | ||
|---|---|---|
| 47 | 47 |
# define USE_COMPILER_TLS |
| 48 | 48 |
# elif defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) \ |
| 49 | 49 |
|| defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \ |
| 50 |
|| defined(GC_NETBSD_THREADS) || defined(GC_RTEMS_PTHREADS) |
|
| 50 |
|| defined(GC_NETBSD_THREADS) || defined(GC_DRAGONFLY_THREADS) \ |
|
| 51 |
|| defined(GC_RTEMS_PTHREADS) |
|
| 51 | 52 |
# define USE_PTHREAD_SPECIFIC |
| 52 | 53 |
# elif defined(GC_HPUX_THREADS) |
| 53 | 54 |
# ifdef __GNUC__ |
| gc-7.2/pthread_stop_world.c 2012-10-13 16:23:51.004956000 -0500 | ||
|---|---|---|
| 130 | 130 | |
| 131 | 131 |
#ifndef SIG_THR_RESTART |
| 132 | 132 |
# if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) \ |
| 133 |
|| defined(GC_NETBSD_THREADS) |
|
| 133 |
|| defined(GC_NETBSD_THREADS) || defined(GC_DRAGONFLY_THREADS)
|
|
| 134 | 134 |
# ifdef _SIGRTMIN |
| 135 | 135 |
# define SIG_THR_RESTART _SIGRTMIN + 5 |
| 136 | 136 |
# else |
| gc-7.2/pthread_support.c 2012-10-13 16:22:07.768255000 -0500 | ||
|---|---|---|
| 73 | 73 |
# include <sys/sysctl.h> |
| 74 | 74 |
#endif /* GC_DARWIN_THREADS */ |
| 75 | 75 | |
| 76 |
#if defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) |
|
| 76 |
#if defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \ |
|
| 77 |
|| defined(GC_DRAGONFLY_THREADS) |
|
| 77 | 78 |
# include <sys/param.h> |
| 78 | 79 |
# include <sys/sysctl.h> |
| 79 | 80 |
#endif /* GC_NETBSD_THREADS */ |
| ... | ... | |
| 917 | 918 |
#endif /* GC_DGUX386_THREADS */ |
| 918 | 919 | |
| 919 | 920 |
#if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) \ |
| 920 |
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) |
|
| 921 |
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \ |
|
| 922 |
|| defined(GC_DRAGONFLY_THREADS) |
|
| 921 | 923 |
static int get_ncpu(void) |
| 922 | 924 |
{
|
| 923 | 925 |
int mib[] = {CTL_HW,HW_NCPU};
|
| ... | ... | |
| 1006 | 1008 |
GC_nprocs = sysconf(_SC_NPROC_ONLN); |
| 1007 | 1009 |
if (GC_nprocs <= 0) GC_nprocs = 1; |
| 1008 | 1010 |
# elif defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) \ |
| 1009 |
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) |
|
| 1011 |
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \ |
|
| 1012 |
|| defined(GC_DRAGONFLY_THREADS) |
|
| 1010 | 1013 |
GC_nprocs = get_ncpu(); |
| 1011 | 1014 |
# elif defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS) |
| 1012 | 1015 |
GC_nprocs = GC_get_nprocs(); |