diff options
author | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2009-11-28 06:25:52 +0800 |
---|---|---|
committer | marcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059> | 2009-11-28 06:25:52 +0800 |
commit | a0dfb461133f22cd363af37e9e97670fc7bcac6e (patch) | |
tree | 9c4d571b05a1b28b6155c5ac331bc0550830fe9c /devel | |
parent | 429ce2383cb3c276efabc30fa877675111683ab5 (diff) | |
download | marcuscom-ports-a0dfb461133f22cd363af37e9e97670fc7bcac6e.tar marcuscom-ports-a0dfb461133f22cd363af37e9e97670fc7bcac6e.tar.gz marcuscom-ports-a0dfb461133f22cd363af37e9e97670fc7bcac6e.tar.bz2 marcuscom-ports-a0dfb461133f22cd363af37e9e97670fc7bcac6e.tar.lz marcuscom-ports-a0dfb461133f22cd363af37e9e97670fc7bcac6e.tar.xz marcuscom-ports-a0dfb461133f22cd363af37e9e97670fc7bcac6e.tar.zst marcuscom-ports-a0dfb461133f22cd363af37e9e97670fc7bcac6e.zip |
Take another approach to fixing the crash with pthread_condattr*. Just
remove the definition from libpthread-stubs. This is safer than linking
with -pthread.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@13258 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'devel')
-rw-r--r-- | devel/libpthread-stubs/Makefile | 7 | ||||
-rw-r--r-- | devel/libpthread-stubs/files/patch-stubs.c | 28 |
2 files changed, 29 insertions, 6 deletions
diff --git a/devel/libpthread-stubs/Makefile b/devel/libpthread-stubs/Makefile index 4eee8bcc6..95a0b70ae 100644 --- a/devel/libpthread-stubs/Makefile +++ b/devel/libpthread-stubs/Makefile @@ -7,7 +7,7 @@ PORTNAME= libpthread-stubs PORTVERSION= 0.3 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= devel MASTER_SITES= http://xcb.freedesktop.org/dist/ @@ -25,11 +25,6 @@ GNU_CONFIGURE= yes .if ${OSVERSION} < 700000 CONFIGURE_ENV+= LDFLAGS=-lpthread -.else -# XXX This is a hack to fix a problem where pthread_condattr_{init,destroy} -# are not found leading to crashes. -# When the stubs are added to libc, this hack can be removed. -CONFIGURE_ENV+= LDFLAGS=${PTHREAD_LIBS} .endif .include <bsd.port.post.mk> diff --git a/devel/libpthread-stubs/files/patch-stubs.c b/devel/libpthread-stubs/files/patch-stubs.c new file mode 100644 index 000000000..4290eb2e6 --- /dev/null +++ b/devel/libpthread-stubs/files/patch-stubs.c @@ -0,0 +1,28 @@ +XXX This is a big hack as we cannot define pthread_condattr_{init,destroy} +here, or we will conflict with the weak symbols in libthr. The way our linker +works, the weak symbols will be resolved here, and pthread_condattr functions +will not work even in threaded applications. + +I am working to get these symbols added to libc, but in the meantime, this +is needed to avoid crashes in threaded applications which make use of +pthread_condattr*. +--- stubs.c.orig 2009-11-27 17:15:30.000000000 -0500 ++++ stubs.c 2009-11-27 17:16:29.000000000 -0500 +@@ -91,7 +91,7 @@ int pthread_cond_destroy() __attribute__ + # endif + #endif + +-#ifndef HAVE_PTHREAD_CONDATTR_INIT ++#if 0 + #define NEED_ZERO_STUB + # ifdef SUPPORT_ATTRIBUTE_ALIAS + int pthread_condattr_init() __attribute__ ((weak, alias ("__pthread_zero_stub"))); +@@ -100,7 +100,7 @@ int pthread_condattr_init() __attribute_ + # endif + #endif + +-#ifndef HAVE_PTHREAD_CONDATTR_DESTROY ++#if 0 + #define NEED_ZERO_STUB + # ifdef SUPPORT_ATTRIBUTE_ALIAS + int pthread_condattr_destroy() __attribute__ ((weak, alias ("__pthread_zero_stub"))); |