Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jul 2007 14:23:21 +0800
From:      "Rong-en Fan" <grafan@gmail.com>
To:        "Yuri Pankov" <yuri@darklight.org.ru>
Cc:        ports@freebsd.org, kan@freebsd.org, miwi@freebsd.org
Subject:   Re: linking against pthread for a shared library
Message-ID:  <6eb82e0707122323h1c1fda47y5c4a280d8b5ceb5b@mail.gmail.com>
In-Reply-To: <20070712204858.GA1200@darklight.org.ru>
References:  <6eb82e0707120934pade7a6cw70dc324a47bc09be@mail.gmail.com> <20070712204858.GA1200@darklight.org.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On 7/13/07, Yuri Pankov <yuri@darklight.org.ru> wrote:
> On Fri, Jul 13, 2007 at 12:34:12AM +0800, Rong-en Fan wrote:
> > miwi@ and I are working on solving
> > an issue with devel/upnp and misc/ushare
> > problem. Essentially, the problem is that
> > devel/upnp builds a shared library called
> > libthreadutil.so which uses threading library.
> > misc/ushare is a consumer of that library.
> >
> > On 7.x system, if you ldd on libthreadutil.so
> > (this is i386)
> >
> > ./work/libupnp-1.6.0/threadutil/.libs/libthreadutil.so:
> >        liblwres.so.30 => /usr/lib/liblwres.so.30 (0x2817d000)
> >        libc.so.7 => /lib/libc.so.7 (0x2807e000)
> >        libthr.so.3 => /lib/libthr.so.3 (0x2818d000)
> >
> > But on 6.x and 5.x, you only get (this is amd64)
> >
> > ./work/libupnp-1.6.0/threadutil/.libs/libthreadutil.so:
> >        liblwres.so.10 => /usr/lib/liblwres.so.10 (0x800941000)
> >
> > So, one needs to pass -pthread when using
> > libthreadutil.so. In my understanding, the behavior
> > on 7.x is more correct (or reasonable).
> >
> > Any ideas how to solve this problem?
> >
> > Regards,
> > Rong-En Fan
>
> Sorry if i'm mistaken, but this might be related:
> http://lists.freebsd.org/pipermail/freebsd-current/2007-June/073600.html

Hi Yuri,

Ya, it is exact the problem. So, I think one must either 1) pass
-pthread for every programs that link against libthreadutil.so
2) pass -lpthread when build the libthreadutil.so.

Or, can this problem be "fixed" in 5.x and 6.x world? Since
we have real threading support now.

Regards,
Rong-En Fan
>
>
> Yuri
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6eb82e0707122323h1c1fda47y5c4a280d8b5ceb5b>