Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 03 Aug 2006 16:41:51 +0300
From:      Andriy Gapon <avg@icyb.net.ua>
To:        Yuri Pankov <y.pankov@irbis.net.ru>
Cc:        freebsd-ports@freebsd.org, freebsd-gnome@freebsd.org
Subject:   Re: libgthread not linked with threads lib ???
Message-ID:  <44D1FD1F.3010305@icyb.net.ua>
In-Reply-To: <44D1EEB4.9060707@icyb.net.ua>
References:  <44D1D9D9.2070608@icyb.net.ua> <1154607315.86343.9.camel@sierra.irbis.net.ru> <44D1EEB4.9060707@icyb.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
on 03/08/2006 15:40 Andriy Gapon said the following:
> thanks for your answer.
> I dug a little bit deeper and here's the deal: "the application" is
> "Save As ..." dialog of GVim (in graphical mode). Namely, the problem
> happens when GVim loads libgnome-vfs.so.
> libgnome-vfs.so has a dependency on libgthread-2.0 but no pthread
> (lib{pthread|thr|c_r}) dependency, so it must be the culprit here.

Hmm...

cc -shared  .libs/GNOME_VFS_Daemon-common.o [.libs/*.o ...]
.libs/gnome-vfs-pty.o  -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath
-Wl,/usr/X11R6/lib -Wl,--rpath -Wl,/usr/local/lib -Wl,--rpath
-Wl,/usr/X11R6/lib -L/usr/local/lib -pthread -L/usr/X11R6/lib
/usr/local/lib/libgobject-2.0.so /usr/X11R6/lib/libgconf-2.so
/usr/local/lib/libbonobo-2.so /usr/local/lib/libbonobo-activation.so
/usr/local/lib/libORBit-2.so /usr/local/lib/libgmodule-2.0.so
/usr/local/lib/libgthread-2.0.so /usr/local/lib/libglib-2.0.so
/usr/local/lib/libxml2.so -lz /usr/local/lib/libiconv.so -lm -lssl
-lcrypto -lutil /usr/local/lib/libintl.so  -march=athlon-xp -pthread
-pthread -pthread -pthread -pthread -Wl,-soname -Wl,libgnomevfs-2.so.0
-Wl,-retain-symbols-file -Wl,.libs/libgnomevfs-2.exp -o
.libs/libgnomevfs-2.so.0

-pthread option is present here, but:


$ ldd .libs/libgnomevfs-2.so.0
.libs/libgnomevfs-2.so.0:
        libgobject-2.0.so.0 => /usr/local/lib/libgobject-2.0.so.0
(0x481cd000)
        libgconf-2.so.4 => /usr/X11R6/lib/libgconf-2.so.4 (0x48206000)
        libbonobo-2.so.0 => /usr/local/lib/libbonobo-2.so.0 (0x48237000)
        libbonobo-activation.so.4 =>
/usr/local/lib/libbonobo-activation.so.4 (0x4828f000)
        libORBit-2.so.0 => /usr/local/lib/libORBit-2.so.0 (0x482a3000)
        libgmodule-2.0.so.0 => /usr/local/lib/libgmodule-2.0.so.0
(0x482f5000)
        libgthread-2.0.so.0 => /usr/local/lib/libgthread-2.0.so.0
(0x482f9000)
        libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x482fe000)
        libxml2.so.5 => /usr/local/lib/libxml2.so.5 (0x48383000)
        libz.so.3 => /lib/libz.so.3 (0x484a5000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x484b5000)
        libm.so.4 => /lib/libm.so.4 (0x485a3000)
        libssl.so.4 => /usr/lib/libssl.so.4 (0x485ba000)
        libcrypto.so.4 => /lib/libcrypto.so.4 (0x485ec000)
        libutil.so.5 => /lib/libutil.so.5 (0x486f6000)
        libintl.so.6 => /usr/local/lib/libintl.so.6 (0x48703000)
        libORBitCosNaming-2.so.0 =>
/usr/local/lib/libORBitCosNaming-2.so.0 (0x4870c000)

no pthread library here.
I am confused now.

Do I not understand how -pthread and -shared should work together ?
Does -pthread work only on final executables ?

Also, if GVim loads libgnomevfs-2.so.0 via dlopen() and is not linked
with it in a regular way, should GVim still be linked with all the
dependencies of libgnomevfs-2 (including some threading lib) ?

$ pkg-config --libs gnome-vfs-2.0
-pthread -L/usr/local/lib -L/usr/X11R6/lib -lgnomevfs-2 -lbonobo-2
-lgconf-2 -lgobject-2.0 -lbonobo-activation -lORBit-2 -lm -lgmodule-2.0
-lgthread-2.0 -lglib-2.0 -liconv

What's the point of dlopen() then if you are supposed to know certain
sub-dependencies in advance ?

-- 
Andriy Gapon



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