Date: Mon, 3 Jan 2005 12:42:21 +0100 From: Ulrich Spoerlein <q@uni.de> To: ports@freebsd.org Subject: PThread Issue: -pthread vs. -lpthread for a new port Message-ID: <20050103114221.GA897@galgenberg.net>
next in thread | raw e-mail | index | archive | help
--fdj2RfSjLxBAspz7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, I ported [1] wxruby [2] but am running into an issue wrt pthreads. The wxruby library gets linked like this: cc -shared `wx-config --libs` -Wl,--version-script,./version-script -Wl,-soname,wxruby.so -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -L'/usr/local/lib' -Wl,-R'/usr/local/lib' -o wxruby.so <lots of objects> -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -L. -lruby18 -lcrypt -lm -lc with $ wx-config --libs -L/usr/X11R6/lib -L/usr/local/lib -liconv -L/usr/X11R6/lib -pthread -lwx_gt= k2-2.4 ldd(1) says this: /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd5/wxruby.so: libiconv.so.3 =3D> /usr/local/lib/libiconv.so.3 (0x48251000) libwx_gtk2-2.4.so =3D> /usr/X11R6/lib/libwx_gtk2-2.4.so (0x4833c000) libruby18.so.18 =3D> /usr/local/lib/libruby18.so.18 (0x487db000) libcrypt.so.2 =3D> /lib/libcrypt.so.2 (0x48897000) libm.so.3 =3D> /lib/libm.so.3 (0x488af000) libc.so.5 =3D> /lib/libc.so.5 (0x48082000) libgtk-x11-2.0.so.400 =3D> /usr/X11R6/lib/libgtk-x11-2.0.so.400 (0x= 488c9000) libgdk-x11-2.0.so.400 =3D> /usr/X11R6/lib/libgdk-x11-2.0.so.400 (0x= 48b5c000) libXrandr.so.2 =3D> /usr/X11R6/lib/libXrandr.so.2 (0x48bc6000) libXi.so.6 =3D> /usr/X11R6/lib/libXi.so.6 (0x48bca000) libXinerama.so.1 =3D> /usr/X11R6/lib/libXinerama.so.1 (0x48bd2000) libXcursor.so.1 =3D> /usr/X11R6/lib/libXcursor.so.1 (0x48bd5000) libatk-1.0.so.800 =3D> /usr/local/lib/libatk-1.0.so.800 (0x48bde000) libgdk_pixbuf-2.0.so.400 =3D> /usr/X11R6/lib/libgdk_pixbuf-2.0.so.4= 00 (0x48bf7000) libpangoxft-1.0.so.600 =3D> /usr/X11R6/lib/libpangoxft-1.0.so.600 (= 0x48c0b000) libXft.so.2 =3D> /usr/X11R6/lib/libXft.so.2 (0x48c10000) libfreetype.so.9 =3D> /usr/local/lib/libfreetype.so.9 (0x48c1f000) libz.so.2 =3D> /lib/libz.so.2 (0x48c7c000) libXrender.so.1 =3D> /usr/X11R6/lib/libXrender.so.1 (0x48c8c000) libXext.so.6 =3D> /usr/X11R6/lib/libXext.so.6 (0x48c94000) libfontconfig.so.1 =3D> /usr/X11R6/lib/libfontconfig.so.1 (0x48ca10= 00) libpangox-1.0.so.600 =3D> /usr/X11R6/lib/libpangox-1.0.so.600 (0x48= cc3000) libX11.so.6 =3D> /usr/X11R6/lib/libX11.so.6 (0x48cce000) libpango-1.0.so.600 =3D> /usr/X11R6/lib/libpango-1.0.so.600 (0x48d8= d000) libgobject-2.0.so.400 =3D> /usr/local/lib/libgobject-2.0.so.400 (0x= 48dc1000) libgmodule-2.0.so.400 =3D> /usr/local/lib/libgmodule-2.0.so.400 (0x= 48dfb000) libgthread-2.0.so.400 =3D> /usr/local/lib/libgthread-2.0.so.400 (0x= 48dff000) libglib-2.0.so.400 =3D> /usr/local/lib/libglib-2.0.so.400 (0x48e030= 00) libpng.so.5 =3D> /usr/local/lib/libpng.so.5 (0x48e7d000) libjpeg.so.9 =3D> /usr/local/lib/libjpeg.so.9 (0x48ea0000) libtiff.so.4 =3D> /usr/local/lib/libtiff.so.4 (0x48eba000) libpangoft2-1.0.so.600 =3D> /usr/X11R6/lib/libpangoft2-1.0.so.600 (= 0x48f05000) libstdc++.so.4 =3D> /usr/lib/libstdc++.so.4 (0x48f29000) libintl.so.6 =3D> /usr/local/lib/libintl.so.6 (0x48ffb000) libexpat.so.5 =3D> /usr/local/lib/libexpat.so.5 (0x49004000) And running a ruby program requiring wxruby I get this error: /libexec/ld-elf.so.1: /usr/local/lib/libgthread-2.0.so.400: Undefined symbo= l "pthread_getschedparam" When I link the library with -lpthread instead of -pthread ldd(1) has this to say /usr/local/lib/ruby/site_ruby/1.8/i386-freebsd5/wxruby.so: libiconv.so.3 =3D> /usr/local/lib/libiconv.so.3 (0x48251000) libpthread.so.1 =3D> /usr/lib/libpthread.so.1 (0x4833c000) libwx_gtk2-2.4.so =3D> /usr/X11R6/lib/libwx_gtk2-2.4.so (0x48360000) libruby18.so.18 =3D> /usr/local/lib/libruby18.so.18 (0x487ff000) libcrypt.so.2 =3D> /lib/libcrypt.so.2 (0x488bb000) libm.so.3 =3D> /lib/libm.so.3 (0x488d3000) libc.so.5 =3D> /lib/libc.so.5 (0x48082000) libgtk-x11-2.0.so.400 =3D> /usr/X11R6/lib/libgtk-x11-2.0.so.400 (0x= 488ed000) libgdk-x11-2.0.so.400 =3D> /usr/X11R6/lib/libgdk-x11-2.0.so.400 (0x= 48b80000) libXrandr.so.2 =3D> /usr/X11R6/lib/libXrandr.so.2 (0x48bea000) libXi.so.6 =3D> /usr/X11R6/lib/libXi.so.6 (0x48bee000) libXinerama.so.1 =3D> /usr/X11R6/lib/libXinerama.so.1 (0x48bf6000) libXcursor.so.1 =3D> /usr/X11R6/lib/libXcursor.so.1 (0x48bf9000) libatk-1.0.so.800 =3D> /usr/local/lib/libatk-1.0.so.800 (0x48c02000) libgdk_pixbuf-2.0.so.400 =3D> /usr/X11R6/lib/libgdk_pixbuf-2.0.so.4= 00 (0x48c1b000) libpangoxft-1.0.so.600 =3D> /usr/X11R6/lib/libpangoxft-1.0.so.600 (= 0x48c2f000) libXft.so.2 =3D> /usr/X11R6/lib/libXft.so.2 (0x48c34000) libfreetype.so.9 =3D> /usr/local/lib/libfreetype.so.9 (0x48c43000) libz.so.2 =3D> /lib/libz.so.2 (0x48ca0000) libXrender.so.1 =3D> /usr/X11R6/lib/libXrender.so.1 (0x48cb0000) libXext.so.6 =3D> /usr/X11R6/lib/libXext.so.6 (0x48cb8000) libfontconfig.so.1 =3D> /usr/X11R6/lib/libfontconfig.so.1 (0x48cc50= 00) libpangox-1.0.so.600 =3D> /usr/X11R6/lib/libpangox-1.0.so.600 (0x48= ce7000) libX11.so.6 =3D> /usr/X11R6/lib/libX11.so.6 (0x48cf2000) libpango-1.0.so.600 =3D> /usr/X11R6/lib/libpango-1.0.so.600 (0x48db= 1000) libgobject-2.0.so.400 =3D> /usr/local/lib/libgobject-2.0.so.400 (0x= 48de5000) libgmodule-2.0.so.400 =3D> /usr/local/lib/libgmodule-2.0.so.400 (0x= 48e1f000) libgthread-2.0.so.400 =3D> /usr/local/lib/libgthread-2.0.so.400 (0x= 48e23000) libglib-2.0.so.400 =3D> /usr/local/lib/libglib-2.0.so.400 (0x48e270= 00) libpng.so.5 =3D> /usr/local/lib/libpng.so.5 (0x48ea1000) libjpeg.so.9 =3D> /usr/local/lib/libjpeg.so.9 (0x48ec4000) libtiff.so.4 =3D> /usr/local/lib/libtiff.so.4 (0x48ede000) libpangoft2-1.0.so.600 =3D> /usr/X11R6/lib/libpangoft2-1.0.so.600 (= 0x48f29000) libstdc++.so.4 =3D> /usr/lib/libstdc++.so.4 (0x48f4d000) libintl.so.6 =3D> /usr/local/lib/libintl.so.6 (0x4901f000) libexpat.so.5 =3D> /usr/local/lib/libexpat.so.5 (0x49028000) and the module works fine. What to do? Why doesn't -pthread take care of the situation? [1] http://www.galgenberg.net/~q/ruby-wx.shar [2] http://wxruby.rubyforge.org/wiki/wiki.pl Ulrich Spoerlein --=20 PGP Key ID: F0DB9F44 Encrypted mail welcome! Fingerprint: F1CE D062 0CA9 ADE3 349B 2FE8 980A C6B5 F0DB 9F44 Ok, which part of "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn." didn't you understand? --fdj2RfSjLxBAspz7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFB2S+dmArGtfDbn0QRAk6zAJ9ovDgi/MtzB+vyta0gt1CnQAP9xQCgiKwz Y1mJgfBPW9KjCvMm0JL1LO8= =e2pU -----END PGP SIGNATURE----- --fdj2RfSjLxBAspz7--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050103114221.GA897>