From owner-freebsd-hackers Tue Apr 20 4:53: 5 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from ns.tar.com (ns.tar.com [204.95.187.2]) by hub.freebsd.org (Postfix) with ESMTP id 4AE4414FE0 for ; Tue, 20 Apr 1999 04:53:01 -0700 (PDT) (envelope-from dick@ns.tar.com) Received: (from dick@localhost) by ns.tar.com (8.9.3/8.9.3) id GAA66816; Tue, 20 Apr 1999 06:50:29 -0500 (CDT) (envelope-from dick) Date: Tue, 20 Apr 1999 06:50:29 -0500 From: "Richard Seaman, Jr." To: "David E. Cross" Cc: Dan Moschuk , hackers@FreeBSD.ORG Subject: Re: -lpthread Message-ID: <19990420065029.G533@tar.com> References: <199904201103.HAA14512@cs.rpi.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i In-Reply-To: <199904201103.HAA14512@cs.rpi.edu>; from David E. Cross on Tue, Apr 20, 1999 at 07:03:54AM -0400 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Apr 20, 1999 at 07:03:54AM -0400, David E. Cross wrote: > > | Can we have it so that '-lpthread' accomplishes the same as '-lc_r' in > > | terms of allowing threaded programs to link/run correctly? As was pointed > > | out to me recently '-lc_r' for pthread support is a bit non-standard. > > > > What's wrong with the -pthread option to gcc? (egcs as well?) > > >From FreeBSD: > A FreeBSD specific option ... gcc -pthread .... > ^^^^^^^^^^^^^^^^ > >From Solaris 2.6: > POSIX > cc [ flag ... ] file ... -lpthread [ library ... ] > ^^^^^^^^^ > >From Irix 6.5.2f: > cc -D_POSIX_C_SOURCE=199506L app.c -llib0 -llib1 ... -lpthread > ^^^^^^^^^ > It was just brought to my attention that our use of -lc_r was non-standard. > Solaris, Irix, Linux, and I believe even AIX all use -lpthread. Its my understanding that the goal, though now delayed for a long time, is that the FreeBSD user threads would eventually be re-implemented as kernel threads and be placed in libpthread. I understood that the libpthread name was reserved for this migration. Also, in most implementations, -lpthread is in addition to -lc, whereas in the FreeBSD user thread library, -lc_r replaces -lc as well as -lpthread. What you suggest would make a lot more sense if libc_r was pulled apart into separate libc and libpthread libraries. It wouldn't be hard to do with the current setup. -- Richard Seaman, Jr. email: dick@tar.com 5182 N. Maple Lane phone: 414-367-5450 Chenequa WI 53058 fax: 414-367-5852 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message