On 11/21/11 18:11, Justin Lindberg wrote:
On 11/21/11 17:37, Justin Lindberg wrote:
On 11/21/11 04:46, Antoine Jacoutot wrote:
On Mon, Nov 21, 2011 at 12:51:22PM +0100, Antoine Jacoutot wrote:
On Mon, Nov 21, 2011 at 03:31:12AM -0800, Justin Lindberg wrote:
OpenBSD 5.0 amd64 -- probably all arches
Still not fixed in current.
I tried to run R, and libgthread-2.0 segfaulted
because apparently it was not linked with pthread.
I confirmed this, because relinking the shared
library with pthread makes it work.
The switch -lpthread is necessary for the linker.
There was a big hullabaloo about this a couple of
years ago on the mailing list.
Could somebody please patch glib2's Makefile and
the pthreads(3) man page?
No this is not how it works.
You need to link the binary itself that uses pthreads with
-pthreads (see pthreads(3)).
sorry, s/-pthreads/-pthread of course
ld: unrecognized option '-pthread'
ld: use the --help option for usage information
Sorry. I shouldn't be so brief, but that is a typo in the man page.
The problem is that the shared object library
/usr/local/lib/libgthread-2.0.so.2800.0
or
/usr/local/lib/libgthread-2.0.so.2992.0
as it is by now in -CURRENT
tries to execute function calls that are implemented in
/usr/lib/libpthread.so.13.1
These calls will continue to segfault unless libgthread-2.0 is linked
with "-lpthread", or equivalently, "--library=pthread"
See ld(1).
If /usr/lib/libpthread.so.13.1 doesn't show up when you run ldd,
then libgthread-2.0 was not linked properly.
$ ldd /usr/local/lib/libgthread-2.0.so.2992.0
/usr/local/lib/libgthread-2.0.so.2992.0:
Start End Type Open Ref GrpRef Name
0000000203a10000 0000000203e15000 dlib 1 0 0
/usr/local/lib/libgthread-2.0.so.2992.0
000000020c1df000 000000020c6d2000 rlib 0 1 0
/usr/local/lib/libglib-2.0.so.2992.0
000000020e384000 000000020e7c1000 rlib 0 2 0
/usr/local/lib/libpcre.so.2.5
0000000205a3b000 0000000205e45000 rlib 0 2 0
/usr/local/lib/libintl.so.5.0
000000020f7c6000 000000020fcc1000 rlib 0 2 0
/usr/local/lib/libiconv.so.6.0
Sorry again: according to gcc(1):
-pthread
Add support for multithreading using the POSIX threads library.
This option sets flags for both the preprocessor and linker. It
does not affect the thread safety of object code produced by the
compiler or that of libraries supplied with it. These are HP-UX
specific flags.
However, somehow the binaries distributed with the 5.0 release and
recent snapshots still aren't getting linked with the right library.