diff options
author | Geoff Norton <grompf@sublimeintervention.com> | 2008-08-12 23:33:24 +0400 |
---|---|---|
committer | Geoff Norton <grompf@sublimeintervention.com> | 2008-08-12 23:33:24 +0400 |
commit | 7b06e01c8ff28eefffb07a62fb09577c1e73bbe7 (patch) | |
tree | 8d97ea12ab0bf1df6f3a60534c31b1c4204a17ef | |
parent | efb68a566be971e8e8bf4ad5f4b82e2665a0838e (diff) |
2008-08-12 Geoff Norton <gnorton@novell.com>
* pthread_support.c: GCC shipped with SLES9 ppc gets confused with our current
GC_setspecific define. Unfold the define into a static inline on all platforms
except ppc where it is a static leaf function.
svn path=/branches/mono-2-0/mono/; revision=110287
-rw-r--r-- | libgc/ChangeLog | 6 | ||||
-rw-r--r-- | libgc/pthread_support.c | 18 |
2 files changed, 19 insertions, 5 deletions
diff --git a/libgc/ChangeLog b/libgc/ChangeLog index bcf88881e97..d455260ddf3 100644 --- a/libgc/ChangeLog +++ b/libgc/ChangeLog @@ -1,3 +1,9 @@ +2008-08-12 Geoff Norton <gnorton@novell.com> + + * pthread_support.c: GCC shipped with SLES9 ppc gets confused with our current + GC_setspecific define. Unfold the define into a static inline on all platforms + except ppc where it is a static leaf function. + 2008-08-03 Zoltan Varga <vargaz@gmail.com> * pthread_support.c (GC_thread_exit_proc): Null out the tls key to prevent the diff --git a/libgc/pthread_support.c b/libgc/pthread_support.c index 7b0c084e8bb..11d2cd6ad71 100644 --- a/libgc/pthread_support.c +++ b/libgc/pthread_support.c @@ -97,8 +97,11 @@ typedef pthread_key_t GC_key_t; # endif # if defined(USE_COMPILER_TLS) +/* Note sles9 gcc on powerpc gets confused by the define to set GC_thread_tls and pthread_setspecific + * so we actually use a static inline function decalred below that is equivalent to: + * define GC_setspecific(key, v) (GC_thread_tls = (v), pthread_setspecific ((key), (v))) + */ # define GC_getspecific(x) (GC_thread_tls) -# define GC_setspecific(key, v) (GC_thread_tls = (v), pthread_setspecific ((key), (v))) # define GC_key_create pthread_key_create typedef pthread_key_t GC_key_t; # endif @@ -191,14 +194,19 @@ static GC_key_t GC_thread_key; #ifdef USE_COMPILER_TLS +__thread MONO_TLS_FAST void* GC_thread_tls; + /* * gcc errors out with /tmp/ccdPMFuq.s:2994: Error: symbol `.LTLS4' is already defined - * if the static is removed on ppc. + * if the inline is added on powerpc */ -#if defined(__ppc__) || defined(__powerpc__) -static +#if !defined(__ppc__) && !defined(__powerpc__) +inline #endif -__thread MONO_TLS_FAST void* GC_thread_tls; +static int GC_setspecific (GC_key_t key, void *value) { + GC_thread_tls = value; + return pthread_setspecific (key, value); +} #endif static GC_bool keys_initialized; |