Project

General

Profile

Bug #1525 ยป hackish-threaded.patch

c.turner1, 10/13/2012 02:47 PM

View differences:

gc-7.2/CMakeLists.txt 2012-10-13 16:23:05.089626000 -0500
ADD_DEFINITIONS("-D_REENTRANT")
ADD_DEFINITIONS("-D_PTHREADS")
ENDIF()
IF ( "HOST" MATCHES .*-.*-dragonfly.*)
ADD_DEFINITIONS("-DGC_DRAGONFLY_THREADS")
ADD_DEFINITIONS("-D_REENTRANT")
ADD_DEFINITIONS("-D_PTHREADS")
ENDIF()
IF ( "HOST" MATCHES .*-.*-solaris.*)
ADD_DEFINITIONS("-DGC_SOLARIS_THREADS")
ADD_DEFINITIONS("-DTHREAD_LOCAL_ALLOC")
gc-7.2/configure 2012-10-13 16:20:05.062617000 -0500
THREADDLLIBS="-lpthread -lrt"
;;
*-*-dragonfly*)
$as_echo "#define GC_DRAGONFLY_THREADS 1" >>confdefs.h
$as_echo "#define _REENTRANT 1" >>confdefs.h
$as_echo "#define _PTHREADS 1" >>confdefs.h
THREADDLLIBS="-lpthread -lrt"
;;
*-*-solaris*)
$as_echo "#define GC_SOLARIS_THREADS 1" >>confdefs.h
gc-7.2/dyn_load.c 2012-10-13 16:16:10.960939000 -0500
# define ELFSIZE ARCH_ELFSIZE
#endif
#if defined(__DragonFly__)
# include <dlfcn.h>
#endif
#if defined(SCO_ELF) || defined(DGUX) || defined(HURD) \
|| (defined(__ELF__) && (defined(LINUX) || defined(FREEBSD) \
|| defined(NETBSD) || defined(OPENBSD)))
......
# define DL_ITERATE_PHDR_STRONG
#endif
#if defined(__DragonFly__)
/* On the DragonFlyBSD system, any target system at major version FIXME */
/* have dl_iterate_phdr; therefore, we need not make it weak as above. */
# define HAVE_DL_ITERATE_PHDR
# define DL_ITERATE_PHDR_STRONG
#endif
#if defined(HAVE_DL_ITERATE_PHDR)
# ifdef PT_GNU_RELRO
......
return(0);
}
if( cachedResult == 0 ) {
# if defined(NETBSD) && defined(RTLD_DI_LINKMAP)
# if (defined(NETBSD) && defined(RTLD_DI_LINKMAP)) \
|| defined(__DragonFly__)
struct link_map *lm = NULL;
if (!dlinfo(RTLD_SELF, RTLD_DI_LINKMAP, &lm))
cachedResult = lm;
gc-7.2/extra/threadlibs.c 2012-10-13 16:23:32.885602000 -0500
printf("-pthread\n");
# endif
# endif
# if defined(GC_NETBSD_THREADS)
# if defined(GC_NETBSD_THREADS) || defined(GC_DRAGONFLY_THREADS)
printf("-lpthread -lrt\n");
# endif
gc-7.2/include/gc_config_macros.h 2012-10-13 16:30:50.679991000 -0500
|| defined(GC_GNU_THREADS) || defined(GC_HPUX_THREADS) \
|| defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) \
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \
|| defined(GC_OSF1_THREADS) || defined(GC_SOLARIS_THREADS) \
|| defined(GC_WIN32_THREADS) || defined(GC_RTEMS_PTHREADS)
|| defined(GC_DRAGONFLY_THREADS) || defined(GC_OSF1_THREADS) \
|| defined(GC_SOLARIS_THREADS) || defined(GC_WIN32_THREADS) \
|| defined(GC_RTEMS_PTHREADS)
# ifndef GC_THREADS
# define GC_THREADS
# endif
......
&& !defined(GC_OSF1_THREADS) && !defined(GC_IRIX_THREADS)
/* FIXME: Should we really need for FreeBSD and NetBSD to check */
/* that no other GC_xxx_THREADS macro is set? */
# if defined(__FreeBSD__) || defined(__DragonFly__)
# if defined(__FreeBSD__)
# define GC_FREEBSD_THREADS
# elif defined(__DragonFly__)
# define GC_DRAGONFLY_THREADS
# elif defined(__NetBSD__)
# define GC_NETBSD_THREADS
# endif
......
# define GC_PTHREADS
#endif
#if !defined(_PTHREADS) && defined(GC_NETBSD_THREADS)
#if !defined(_PTHREADS) \
&& (defined(GC_NETBSD_THREADS) || defined(GC_DRAGONFLY_THREADS))
# define _PTHREADS
#endif
gc-7.2/include/private/config.h.in 2012-10-13 16:29:14.313420000 -0500
/* Define to support NetBSD pthreads. */
#undef GC_NETBSD_THREADS
/* Define to support DragonFly pthreads. */
#undef GC_DRAGONFLY_THREADS
/* Define to support OpenBSD pthreads. */
#undef GC_OPENBSD_THREADS
gc-7.2/include/private/gcconfig.h 2012-10-13 16:30:15.411245000 -0500
#if defined(GC_NETBSD_THREADS) && !defined(NETBSD)
# error --> inconsistent configuration
#endif
#if defined(GC_DRAGONFLY_THREADS) && !defined(__DragonFly__)
# error --> inconsistent configuration
#endif
#if defined(GC_FREEBSD_THREADS) && !defined(FREEBSD)
# error --> inconsistent configuration
#endif
gc-7.2/include/private/thread_local_alloc.h 2012-10-13 16:29:39.672517000 -0500
# define USE_COMPILER_TLS
# elif defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) \
|| defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
|| defined(GC_NETBSD_THREADS) || defined(GC_RTEMS_PTHREADS)
|| defined(GC_NETBSD_THREADS) || defined(GC_DRAGONFLY_THREADS) \
|| defined(GC_RTEMS_PTHREADS)
# define USE_PTHREAD_SPECIFIC
# elif defined(GC_HPUX_THREADS)
# ifdef __GNUC__
gc-7.2/pthread_stop_world.c 2012-10-13 16:23:51.004956000 -0500
#ifndef SIG_THR_RESTART
# if defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) \
|| defined(GC_NETBSD_THREADS)
|| defined(GC_NETBSD_THREADS) || defined(GC_DRAGONFLY_THREADS)
# ifdef _SIGRTMIN
# define SIG_THR_RESTART _SIGRTMIN + 5
# else
gc-7.2/pthread_support.c 2012-10-13 16:22:07.768255000 -0500
# include <sys/sysctl.h>
#endif /* GC_DARWIN_THREADS */
#if defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS)
#if defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \
|| defined(GC_DRAGONFLY_THREADS)
# include <sys/param.h>
# include <sys/sysctl.h>
#endif /* GC_NETBSD_THREADS */
......
#endif /* GC_DGUX386_THREADS */
#if defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) \
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS)
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \
|| defined(GC_DRAGONFLY_THREADS)
static int get_ncpu(void)
{
int mib[] = {CTL_HW,HW_NCPU};
......
GC_nprocs = sysconf(_SC_NPROC_ONLN);
if (GC_nprocs <= 0) GC_nprocs = 1;
# elif defined(GC_DARWIN_THREADS) || defined(GC_FREEBSD_THREADS) \
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS)
|| defined(GC_NETBSD_THREADS) || defined(GC_OPENBSD_THREADS) \
|| defined(GC_DRAGONFLY_THREADS)
GC_nprocs = get_ncpu();
# elif defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
GC_nprocs = GC_get_nprocs();
    (1-1/1)