[kde-freebsd] Compiling arts in -CURRENT without -pthread

Daniel Eischen eischen at vigrid.com
Sat Sep 20 11:45:07 PDT 2003


On Sat, 20 Sep 2003, Will Andrews wrote:

> On Sat, Sep 20, 2003 at 10:53:04AM -0400, Daniel Eischen wrote:
> > Yes, that's really strange.  Are you sure that you have a correct
> > libc_r in /usr/lib?  You seem to be building arts in the correct
> > manner, and -lc_r _should_ work.
> 
> Dan, if PTHREAD_LIBS isn't defined, what library should 5.1C apps
> fall back to?  It seems my 5.1C (2003/09/19) system does not have
> a libpthread, which I thought it was supposed to.  So, please,
> tell me what a reasonable "default" would be to use if
> PTHREAD_LIBS is not defined.  Is it -lkse?

It should probably check for:

  1) PTHREAD_LIBS
  2) -lpthread
  3) -lc_r

in that order.  I think we want to be like other OSs
that have libpthread, Solaris for example, with the
exception that we check to see if PTHREAD_LIBS is
defined and use that in preference to the others.
Solaris has both libpthread and libthread, but
libthread exports different symbols (thr_* instead
of pthread_*), so its probably explicitly selected
rather than automagically selected.

No, we don't have libpthread yet.  We are waiting
for ports to catch up to the PTHREAD_LIBS changes
and then libkse will be renamed back to libpthread.
If we change it now, some ports may be unbroken
because they find -lpthread, but yet may still
half-heartedly support PTHREAD_LIBS.  So setting
PTHREAD_LIBS to something other than libpthread
won't break the port but will cause it not to
run correctly (if at all).  We also want to be
able to select any of our threading libraries
regardless of the existence of -lpthread, so
falling back to -lpthread should probably only
happen when building outside the ports system
(PTHREAD_LIBS not defined).

> Why is FreeBSD not exporting an -lpthread like others seem to be?

To help you guys.  Just like removing -pthread ;-)

-- 
Dan Eischen



More information about the freebsd-threads mailing list