configure option to link ikarus with libpthread

Bug #306915 reported by Andreas Rottmann
2
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Fix Committed
Medium
Abdulaziz Ghuloum

Bug Description

Altough Ikarus doesn't use POSIX threads (yet), it might make sense to provide a configure option to link it against libpthread; I ran across this issue while hacking on sbank, which makes use of dlopen from (ikarus foreign) to load third-party shared libraries into the Ikarus process.

These shared libraries may in turn be linked against libpthread, which is a problem on several platforms, as (I can't really verify this, because I have no access to a e.g. a *BSD) threaded code can only be loaded into programs that are linked against libpthread, either directly, or via some other library. I was pointed to this issue in http://bugzilla.gnome.org/show_bug.cgi?id=563464, which includes some links that have more information on that behaviour (altough I couldn't find "proper" documentation for this issue).

This is apparenly not a problem on Linux, though even on Linux it leads to spurious GDB errors when doing a dlopen on a libpthread-linked library from Ikarus:

(gdb) r
Starting program: /home/rotty/.system/bin/ikarus
Ikarus Scheme version 0.0.3+ (revision 1695, build 2008-11-29, 64-bit)
Copyright (c) 2006-2008 Abdulaziz Ghuloum

> (import (ikarus foreign))
> (dlopen "libgthread-2.0.so.0")
[Thread debugging using libthread_db enabled]
Error while reading shared library symbols:
Cannot find new threads: generic error
Cannot find new threads: generic error
(gdb) c
>

Related branches

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Do you only need to link it with pthread/gthread or would I need to do something more?

Wouldn't doing ./configure LDFLAGS="-lgthread" be sufficient?

Revision history for this message
Andreas Rottmann (rotty) wrote :

I think so, as -D_REENTRANT is probably not relevant, but I'm not exactly sure about this.

BTW, It would be "LDFLAGS=-lpthread", I just used libgthread in my example since it was the first library that uses libpthread I could think of.

Changed in ikarus:
assignee: nobody → Abdulaziz Ghuloum (aghuloum)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

I made configure autodetect if libpthread is available in the system if so, it links ikarus against it. This should be what you want, right? (rev 1584)

Aziz,,,

Changed in ikarus:
status: Confirmed → Fix Committed
Revision history for this message
Andreas Rottmann (rotty) wrote : Re: [Bug 306915] Re: configure option to link ikarus with libpthread

Abdulaziz Ghuloum <email address hidden> writes:

> I made configure autodetect if libpthread is available in the system if
> so, it links ikarus against it. This should be what you want, right?
> (rev 1584)
>
Yes, that should resolve this issue.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.