From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 1 13:43:18 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AAB6416A4BF for ; Mon, 1 Sep 2003 13:43:18 -0700 (PDT) Received: from planet.alastria.net (planet.alastria.net [66.111.42.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id C019743FEA for ; Mon, 1 Sep 2003 13:43:17 -0700 (PDT) (envelope-from peter@alastria.net) Received: from CAESIUM.hilbre.org.uk (m11-mp2.n13.man.dial.ntli.net [217.137.184.11] (may be forged)) by planet.alastria.net (8.12.8p1/8.12.8) with SMTP id h81KhCcF038064 for ; Mon, 1 Sep 2003 21:43:12 +0100 (BST) (envelope-from peter@alastria.net) From: Peter Wood To: hackers@freebsd.org Date: Mon, 01 Sep 2003 21:43:13 +0100 Organization: Alastria Networks Message-ID: References: <20030831191927.GA6197@webserver> In-Reply-To: <20030831191927.GA6197@webserver> X-Mailer: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Re: Linking with -shared and -pthread... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2003 20:43:18 -0000 Evenin, Heh after talking to Josh I released it was a rather stupid mistake, of = course "pthread_conf_wait" doesn't exist :). So just as a heads up there wasn't actually anything wrong. Okey, I'm gonna go crawl under a rock, Peter. --=20 Peter Wood :: Tel +44 7974 799440 On Sun, 31 Aug 2003 12:19:27 -0700, you wrote: >On Sun, Aug 31, 2003 at 08:13:03PM +0100 or thereabouts, Peter Wood = wrote: >> Good Evening, >>=20 >> I've been looking at writing a program that uses both shared libraries >> (dlopen/dlclose) and POSIX threads. I however haven't had any success = in my >> simple tests. >>=20 >> After doing some research via google I found that due to -shared = pthreads >> wasn't linked into the shared library, fair enough, it's logical. >>=20 >> My question is, is it possible to write programs that use pthreads in = their >> shared libraries on FreeBSD. >>=20 >> For compiling the base program (that is the program that loads the = shared >> libraries) I've been using: >>=20 >> gcc -export-dynamic -pthread master.c -o master > >I use something like >gcc -Wl,-export-dynamic master.c -o master -lc_r > >>=20 >> And for each of the shared libaries I've been using: >>=20 >> gcc -shared -pthread slave.c -o slave.so > >I use >gcc -shared -fPIC -DPIC slave.c -o slave.so > >The pthread functions from `master' will automatically be exported to = `slave'. > >-- Josh >_______________________________________________ >freebsd-hackers@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >To unsubscribe, send any mail to = "freebsd-hackers-unsubscribe@freebsd.org" >