Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 1999 06:50:29 -0500
From:      "Richard Seaman, Jr." <dick@tar.com>
To:        "David E. Cross" <crossd@cs.rpi.edu>
Cc:        Dan Moschuk <dan@trinsec.com>, hackers@FreeBSD.ORG
Subject:   Re: -lpthread
Message-ID:  <19990420065029.G533@tar.com>
In-Reply-To: <199904201103.HAA14512@cs.rpi.edu>; from David E. Cross on Tue, Apr 20, 1999 at 07:03:54AM -0400
References:  <dan@trinsec.com> <199904201103.HAA14512@cs.rpi.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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