diff options
author | deischen <deischen@FreeBSD.org> | 2003-09-03 15:44:34 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2003-09-03 15:44:34 +0000 |
commit | 6a3d4cfc63b463ccab2e4e78c0f432e6d62219ed (patch) | |
tree | 0dd747d8e81dc40de24dbd99eb68fdca65272f4e /contrib | |
parent | d5c4ef5547dcaf9a4533862700c38b7ea4313cff (diff) | |
download | FreeBSD-src-6a3d4cfc63b463ccab2e4e78c0f432e6d62219ed.zip FreeBSD-src-6a3d4cfc63b463ccab2e4e78c0f432e6d62219ed.tar.gz |
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
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/gcc/config/freebsd-spec.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/contrib/gcc/config/freebsd-spec.h b/contrib/gcc/config/freebsd-spec.h index 42311f2..03003c4 100644 --- a/contrib/gcc/config/freebsd-spec.h +++ b/contrib/gcc/config/freebsd-spec.h @@ -131,15 +131,17 @@ Boston, MA 02111-1307, USA. */ required by the user-land thread model. Before __FreeBSD_version 500016, select the appropriate libc, depending on whether we're doing profiling or need threads support. At __FreeBSD_version - 500016 and later, when threads support is requested include both - -lc and -lc_r instead of only -lc_r. To make matters interesting, - we can't actually use __FreeBSD_version provided by <osreldate.h> - directly since it breaks cross-compiling. As a final twist, make - it a hard error if -pthread is provided on the command line and gcc - was configured with --disable-threads (this will help avoid bug - reports from users complaining about threading when they - misconfigured the gcc bootstrap but are later consulting FreeBSD - manual pages that refer to the mythical -pthread option). */ + 500016 and later, threads libraries can be linked with libc. + Because of this, and because different (not multiple) threading + libraries may be selected in the link option, the -pthread option + is no longer supported. To make matters interesting, we can't + actually use __FreeBSD_version provided by <osreldate.h> directly + since it breaks cross-compiling. As a final twist, make it a hard + error if -pthread is provided on the command line and gcc was + configured with --disable-threads (this will help avoid bug reports + from users complaining about threading when they misconfigured the + gcc bootstrap but are later consulting FreeBSD manual pages that + refer to the mythical -pthread option). */ /* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate libc, depending on whether we're doing profiling or need threads support. @@ -157,9 +159,10 @@ is built with the --enable-threads configure-time option.} \ #include <sys/param.h> #if __FreeBSD_version >= 500016 #define FBSD_LIB_SPEC " \ + %{pthread: %eThe -pthread option is deprecated.} \ %{!shared: \ - %{!pg: %{pthread:-lc_r} -lc} \ - %{pg: %{pthread:-lc_r_p} -lc_p} \ + %{!pg: -lc} \ + %{pg: -lc_p} \ }" #else #define FBSD_LIB_SPEC " \ |