From a7ff9d32492a0e8057063d126015ca0d7aac5179 Mon Sep 17 00:00:00 2001 From: obrien Date: Sat, 12 May 2001 04:57:49 +0000 Subject: Choose the right LIB_SPEC for threads based on "__FreeBSD_version". This allows someone with an older -current to update their compiler [only]. Inspired by: Loren James Rittle --- contrib/gcc/config/freebsd.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'contrib/gcc') diff --git a/contrib/gcc/config/freebsd.h b/contrib/gcc/config/freebsd.h index f52cca2..13a099d 100644 --- a/contrib/gcc/config/freebsd.h +++ b/contrib/gcc/config/freebsd.h @@ -73,16 +73,32 @@ Boston, MA 02111-1307, USA. */ #undef CPP_SPEC #define CPP_SPEC FBSD_CPP_SPEC -/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate - libc, depending on whether we're doing profiling or need threads support. - (simular to the default, except no -lg, and no -p). */ +/* Provide a LIB_SPEC appropriate for FreeBSD. Before + __FreeBSD_version 500016, select the appropriate libc, depending on + whether we're doing profiling or need threads support. (similar to + the default, except no -lg, and no -p). At __FreeBSD_version + 500016 and later, when threads support is requested include both + -lc and -lc_r instead of only -lc_r. */ #undef LIB_SPEC +#include +#if __FreeBSD_version >= 500016 #define LIB_SPEC " \ %{!shared: \ %{!pg: %{pthread:-lc_r} -lc} \ %{pg: %{pthread:-lc_r_p} -lc_p} \ }" +#else +#define LIB_SPEC " \ + %{!shared: \ + %{!pg: \ + %{!pthread:-lc} \ + %{pthread:-lc_r}} \ + %{pg: \ + %{!pthread:-lc_p} \ + %{pthread:-lc_r_p}} \ + }" +#endif /************************[ Target stuff ]***********************************/ -- cgit v1.1