From 9bf5723dce955cb1210af9541787d03d9433cfd3 Mon Sep 17 00:00:00 2001 From: ro Date: Mon, 2 Jul 2007 14:56:58 +0000 Subject: PR boehm-gc/21940 PR boehm-gc/21942 * configure.ac (GC_SOLARIS_THREADS): Don't define on *-*-solaris*. Use alternate thread library in /usr/lib/lwp. * configure: Regenerate. * dyn_load.c: Use GC_SOLARIS_PTHREADS. * include/gc_config_macros.h (GC_SOLARIS_THREADS): Don't define. * include/private/gcconfig.h: Handle 64-bit Solaris 2/x86. (GC_SOLARIS_THREADS): Don't define. * include/private/solaris_threads.h: Remove. * pthread_support.c (GC_thr_init) [GC_SOLARIS_PTHREADS]: Determine GC_nprocs via sysconf(). * Makefile.am (libgcjgc_la_SOURCES): Remove solaris_pthreads.c and solaris_threads.c. (gctest_LDADD): Use THREADLIBS instead of THREADDLLIBS. * Makefile.in: Regenerate. * solaris_pthreads.c: Remove. * solaris_threads.c: Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126211 138bc75d-0d04-0410-961f-82ee72b054a4 --- boehm-gc/include/gc_config_macros.h | 4 --- boehm-gc/include/private/gcconfig.h | 40 ++++++++++++++++++++++++++---- boehm-gc/include/private/solaris_threads.h | 37 --------------------------- 3 files changed, 35 insertions(+), 46 deletions(-) delete mode 100644 boehm-gc/include/private/solaris_threads.h (limited to 'boehm-gc/include') diff --git a/boehm-gc/include/gc_config_macros.h b/boehm-gc/include/gc_config_macros.h index 5bb720ca344..0964784332b 100644 --- a/boehm-gc/include/gc_config_macros.h +++ b/boehm-gc/include/gc_config_macros.h @@ -72,10 +72,6 @@ # define GC_WIN32_THREADS #endif -#if defined(GC_SOLARIS_PTHREADS) && !defined(GC_SOLARIS_THREADS) -# define GC_SOLARIS_THREADS -#endif - # define __GC # ifndef _WIN32_WCE # include diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h index fb00fccae2d..288eefb5caf 100644 --- a/boehm-gc/include/private/gcconfig.h +++ b/boehm-gc/include/private/gcconfig.h @@ -153,6 +153,11 @@ # define SUNOS5 # define mach_type_known # endif +# if defined(sun) && defined(__amd64) +# define X86_64 +# define SUNOS5 +# define mach_type_known +# endif # if (defined(__OS2__) || defined(__EMX__)) && defined(__32BIT__) # define I386 # define OS2 @@ -2041,6 +2046,36 @@ extern char etext[]; # define SEARCH_FOR_DATA_START # endif +# ifdef SUNOS5 +# define ELF_CLASS ELFCLASS64 +# define OS_TYPE "SUNOS5" + extern int _etext[], _end[]; + extern ptr_t GC_SysVGetDataStart(); +# define DATASTART GC_SysVGetDataStart(0x1000, _etext) +# define DATAEND (_end) +/* # define STACKBOTTOM ((ptr_t)(_start)) worked through 2.7, */ +/* but reportedly breaks under 2.8. It appears that the stack */ +/* base is a property of the executable, so this should not break */ +/* old executables. */ +/* HEURISTIC2 probably works, but this appears to be preferable. */ +/* # include */ +/* # define STACKBOTTOM USRSTACK */ +# define HEURISTIC2 +# define PROC_VDB +# define DYNAMIC_LOADING +# if !defined(USE_MMAP) && defined(REDIRECT_MALLOC) +# define USE_MMAP + /* Otherwise we now use calloc. Mmap may result in the */ + /* heap interleaved with thread stacks, which can result in */ + /* excessive blacklisting. Sbrk is unusable since it */ + /* doesn't interact correctly with the system malloc. */ +# endif +# ifdef USE_MMAP +# define HEAP_START (ptr_t)0x40000000 +# else +# define HEAP_START DATAEND +# endif +# endif # endif #if defined(LINUX) && defined(USE_MMAP) @@ -2186,11 +2221,6 @@ ((word*)x)[1] = 0; # endif /* CLEAR_DOUBLE */ - /* Internally we use GC_SOLARIS_THREADS to test for either old or pthreads. */ -# if defined(GC_SOLARIS_PTHREADS) && !defined(GC_SOLARIS_THREADS) -# define GC_SOLARIS_THREADS -# endif - # if defined(GC_IRIX_THREADS) && !defined(IRIX5) --> inconsistent configuration # endif diff --git a/boehm-gc/include/private/solaris_threads.h b/boehm-gc/include/private/solaris_threads.h deleted file mode 100644 index b1f62620bd7..00000000000 --- a/boehm-gc/include/private/solaris_threads.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifdef GC_SOLARIS_THREADS - -/* The set of all known threads. We intercept thread creation and */ -/* joins. We never actually create detached threads. We allocate all */ -/* new thread stacks ourselves. These allow us to maintain this */ -/* data structure. */ -/* Protected by GC_thr_lock. */ -/* Some of this should be declared volatile, but that's incosnsistent */ -/* with some library routine declarations. In particular, the */ -/* definition of cond_t doesn't mention volatile! */ - typedef struct GC_Thread_Rep { - struct GC_Thread_Rep * next; - thread_t id; - word flags; -# define FINISHED 1 /* Thread has exited. */ -# define DETACHED 2 /* Thread is intended to be detached. */ -# define CLIENT_OWNS_STACK 4 - /* Stack was supplied by client. */ -# define SUSPNDED 8 /* Currently suspended. */ - /* SUSPENDED is used insystem header. */ - ptr_t stack; - size_t stack_size; - cond_t join_cv; - void * status; - } * GC_thread; - extern GC_thread GC_new_thread(thread_t id); - - extern GC_bool GC_thr_initialized; - extern volatile GC_thread GC_threads[]; - extern size_t GC_min_stack_sz; - extern size_t GC_page_sz; - extern void GC_thr_init(void); - extern ptr_t GC_stack_alloc(size_t * stack_size); - extern void GC_stack_free(ptr_t stack, size_t size); - -# endif /* GC_SOLARIS_THREADS */ - -- cgit v1.2.1