Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Sep 2003 11:57:21 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        ports@freebsd.org
Subject:   Heads Up: cvs commit: src/contrib/gcc/config freebsd-spec.h (fwd)
Message-ID:  <Pine.GSO.4.10.10309031147560.26195-100000@pcnet5.pcnet.com>

next in thread | raw e-mail | index | archive | help
Here is a thread from Feb 2001:

  http://docs.freebsd.org/cgi/getmsg.cgi?fetch=629118+0+archive/2001/freebsd-current/20010218.freebsd-current

In summary, using -pthread with gcc in -current will be an error.
Our ports should really be ${PTHREAD_LIBS} clean if we want to
support different thread libraries, even on port by port basis.

If we continue to allow -pthread, we'll end up with ports linked
to both libc_r and {libkse(M:N),libkse(1:1),libthr,linuxthreads,etc}
and this doesn't work; they ports will build fine, but they won't
run correctly.

I suggest that libtool, autoconf, etc., be taught about ${PTHREAD_LIBS}
and if defined, use that instead of -lc_r, -lpthread, etc.  If
${PTHREAD_LIBS} is not defined, then order of detection should
be -lpthread, then -lc_r last.

-- 
Dan Eischen

---------- Forwarded message ----------
Date: Wed, 3 Sep 2003 08:44:34 -0700 (PDT)
From: Daniel Eischen <deischen@FreeBSD.org>
To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject: cvs commit: src/contrib/gcc/config freebsd-spec.h

deischen    2003/09/03 08:44:34 PDT

  FreeBSD src repository

  Modified files:
    contrib/gcc/config   freebsd-spec.h 
  Log:
  Remove the -pthread option (in FreeBSD versions 500016 and greater) as
  threatened over 2 years ago.
  
  Why?  -pthread was a hack to prevent linking to both libc and libc_r
  and became unecessary when libc_r became free of libc.  Now that we
  have multiple thread libraries from which to choose, it is more confusing
  because you can't link to more than one threads library at a time.
  Things like autoconf and libtool sometimes detect -pthread and
  also -lc_r, and in conjunction with ports usage of ${PTHREAD_LIBS},
  really wacky things ensue when PTHREAD_LIBS is set to another
  threads library.  This might not be so bad if the build broke
  when this happens, but it doesn't and you don't know it until
  funny things happen when you run the application (or use an
  affected library).
  
  Reviewed by:    obrien
  
  Revision  Changes    Path
  1.12      +14 -11    src/contrib/gcc/config/freebsd-spec.h



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10309031147560.26195-100000>