summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2007-05-23 03:54:20 +0000
committerKen Raeburn <raeburn@mit.edu>2007-05-23 03:54:20 +0000
commit151a777ff7f122fc97daf1ab748249d8de934452 (patch)
tree8f7c23ff470c832b8729f3d2db2ed2502dcc51ba /src/include
parent13c36bdf38a15239618036435646c89c02ff503c (diff)
downloadkrb5-151a777ff7f122fc97daf1ab748249d8de934452.tar.gz
krb5-151a777ff7f122fc97daf1ab748249d8de934452.tar.xz
krb5-151a777ff7f122fc97daf1ab748249d8de934452.zip
On Solaris 10, define NO_WEAK_PTHREADS for the build. When that symbol is
defined, skip the weak and conditional references in k5-thread.h and always use the real pthread functions. ticket: 5560 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19556 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
-rw-r--r--src/include/k5-thread.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/include/k5-thread.h b/src/include/k5-thread.h
index 21c0688c6f..fe1bbe1733 100644
--- a/src/include/k5-thread.h
+++ b/src/include/k5-thread.h
@@ -406,7 +406,7 @@ typedef k5_os_nothread_mutex k5_os_mutex;
Linux: Stub mutex routines exist, but pthread_once does not.
- Solaris: In libc there's a pthread_once that doesn't seem to do
+ Solaris <10: In libc there's a pthread_once that doesn't seem to do
anything. Bleah. But pthread_mutexattr_setrobust_np is defined
only in libpthread. However, some version of GNU libc (Red Hat's
Fedora Core 5, reportedly) seems to have that function, but no
@@ -414,6 +414,12 @@ typedef k5_os_nothread_mutex k5_os_mutex;
address. We now have tests to see if pthread_once actually works,
so stick with that for now.
+ Solaris 10: The real thread support now lives in libc, and
+ libpthread is just a filter object. So we might as well use the
+ real functions unconditionally. Since we haven't got a test for
+ this property yet, we use NO_WEAK_PTHREADS defined in aclocal.m4
+ depending on the OS type.
+
IRIX 6.5 stub pthread support in libc is really annoying. The
pthread_mutex_lock function returns ENOSYS for a program not linked
against -lpthread. No link-time failure, no weak symbols, etc.
@@ -428,7 +434,7 @@ typedef k5_os_nothread_mutex k5_os_mutex;
If we find a platform with non-functional stubs and no weak
references, we may have to resort to some hack like dlsym on the
symbol tables of the current process. */
-#ifdef HAVE_PRAGMA_WEAK_REF
+#if defined(HAVE_PRAGMA_WEAK_REF) && !defined(NO_WEAK_PTHREADS)
# pragma weak pthread_once
# pragma weak pthread_mutex_lock
# pragma weak pthread_mutex_unlock
@@ -460,11 +466,9 @@ extern int krb5int_pthread_loaded(void);
# endif
#endif
-#ifdef HAVE_PRAGMA_WEAK_REF
+#if defined(HAVE_PRAGMA_WEAK_REF) && !defined(NO_WEAK_PTHREADS)
# define USE_PTHREAD_LOCK_ONLY_IF_LOADED
-#endif
-#ifdef HAVE_PRAGMA_WEAK_REF
/* Can't rely on useful stubs -- see above regarding Solaris. */
typedef struct {
pthread_once_t o;