From owner-freebsd-threads@FreeBSD.ORG Sun Mar 2 17:43:43 2008 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6461106566C for ; Sun, 2 Mar 2008 17:43:43 +0000 (UTC) (envelope-from mezz7@cox.net) Received: from eastrmmtao101.cox.net (eastrmmtao101.cox.net [68.230.240.7]) by mx1.freebsd.org (Postfix) with ESMTP id 87C908FC26 for ; Sun, 2 Mar 2008 17:43:26 +0000 (UTC) (envelope-from mezz7@cox.net) Received: from eastrmimpo03.cox.net ([68.1.16.126]) by eastrmmtao107.cox.net (InterMail vM.7.08.02.01 201-2186-121-102-20070209) with ESMTP id <20080302173212.CBOG11832.eastrmmtao107.cox.net@eastrmimpo03.cox.net>; Sun, 2 Mar 2008 12:32:12 -0500 Received: from mezz.mezzweb.com ([24.255.149.218]) by eastrmimpo03.cox.net with bizsmtp id wHSd1Y0014iy4EG0000000; Sun, 02 Mar 2008 12:26:37 -0500 Date: Sun, 02 Mar 2008 11:33:35 -0600 To: "John E Hein" From: "Jeremy Messenger" Content-Type: text/plain; format=flowed; delsp=yes; charset=us-ascii MIME-Version: 1.0 References: <18378.55323.480165.918523@gromit.timing.com> Content-Transfer-Encoding: Quoted-Printable Message-ID: In-Reply-To: <18378.55323.480165.918523@gromit.timing.com> User-Agent: Opera Mail/9.26 (Linux) Cc: threads@freebsd.org Subject: Re: running threaded tasks in dynamically linked objects from a non-threaded app X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2008 17:43:43 -0000 On Sun, 02 Mar 2008 10:38:51 -0600, John E Hein wrote= : > I am having some issues with an application that uses... > [1] perl to run test scripts > [2] with eventually call modules in C modules > [3] which link with a lib that contains pthread* references. > > When the tests run, one gets undefined references to pthread calls > from the run-time linker. > > [1] the perl port was not built WITH_THREADS=3Dyes (non-threaded > is the default) > [3] this lib was built with -pthread, but this does not contain > an explicit dependency on any threading library. That's > how our -pthread works (so one can decide at the time an > application is linked which threading lib to use) > > workarounds: > - LD_PRELOAD=3D/usr/lib/libthr.so (or libpthread.so if desired) > - require perl to be built WITH_THREADS=3Dyes for > users of this application > - build the lib in [3] with -lthr or -lpthread. This > can break if perl in built WITH_THREADS=3Dyes and > the threading libs in [1] and [3] don't match. > > These all have weaknesses in one facet or another. > Are there any different solutions? Are you using FreeBSD 6.x or below? I think it has been fixed in FreeBSD= = 7.x and above with GCC 4.x. I only have tested it with Ruby. Cheers, Mezz -- = mezz7@cox.net - mezz@FreeBSD.org FreeBSD GNOME Team http://www.FreeBSD.org/gnome/ - gnome@FreeBSD.org