Date: Sun, 9 Jan 2005 01:57:49 +0900 (JST) From: Norikatsu Shigemura <nork@FreeBSD.org> To: gerald@FreeBSD.org Cc: ports@FreeBSD.org Subject: Fix -pthread issue on lang/gcc3[34] Message-ID: <200501081657.j08GvnML053109@sakura.ninth-nine.com>
next in thread | raw e-mail | index | archive | help
Hi Gerald! I have a patch to fix -pthread issue on lang/gcc3[34]. BEFORE: on 5.2.1 or after $ gcc3? -pthread FILE of 'int main(void) { return 0; }'. $ ldd a.out a.out: libc_r.so.1 => /usr/lib/libc_r.so.5 (0x68076000) libc.so.6 => /lib/libc.so.6 (0x6809d000) AFTER: on 5.2.1 or after $ gcc3? -pthread FILE of 'int main(void) { return 0; }'. $ ldd a.out a.out: libpthread.so.1 => /usr/lib/libpthread.so.1 (0x68076000) libc.so.6 => /lib/libc.so.6 (0x6809d000) # Inspired by lang/gcc32, lang/gcc-ooo. May I commit this OK? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Index: gcc33/Makefile =================================================================== RCS file: /home/ncvs/ports/lang/gcc33/Makefile,v retrieving revision 1.189 diff -u -r1.189 Makefile --- gcc33/Makefile 17 Dec 2004 19:08:19 -0000 1.189 +++ gcc33/Makefile 8 Jan 2005 16:45:32 -0000 @@ -8,7 +8,7 @@ PORTNAME= gcc PORTVERSION= 3.3.6 -PORTREVISION= 20041215 +PORTREVISION= 20041215.1 CATEGORIES= lang java VERSIONSTRING= 3.3-${PORTREVISION} MASTER_SITES= ${MASTER_SITE_GCC} Index: gcc33/files/patch-gcc,config,freebsd-spec.h =================================================================== RCS file: gcc33/files/patch-gcc,config,freebsd-spec.h diff -N gcc33/files/patch-gcc,config,freebsd-spec.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gcc33/files/patch-gcc,config,freebsd-spec.h 8 Jan 2005 16:40:51 -0000 @@ -0,0 +1,23 @@ +--- gcc/config/freebsd-spec.h.orig Wed Mar 12 11:38:01 2003 ++++ gcc/config/freebsd-spec.h Sun Jan 9 01:39:09 2005 +@@ -131,11 +131,20 @@ + }" + #else + #if FBSD_MAJOR >= 5 ++#include <sys/param.h> ++#if __FreeBSD_version < 502102 /* upto FreeBSD 5.2.1 */ + #define FBSD_LIB_SPEC " \ + %{!shared: \ + %{!pg: %{pthread:-lc_r} -lc} \ + %{pg: %{pthread:-lc_r_p} -lc_p} \ + }" ++#else ++#define FBSD_LIB_SPEC " \ ++ %{!shared: \ ++ %{!pg: %{pthread:-lpthread} -lc} \ ++ %{pg: %{pthread:-lpthread_p} -lc_p} \ ++ }" ++#endif /* deal with FreeBSD 5.0 - 5.2.1 */ + #else + #define FBSD_LIB_SPEC " \ + %{!shared: \ Index: gcc34/Makefile =================================================================== RCS file: /home/ncvs/ports/lang/gcc34/Makefile,v retrieving revision 1.191 diff -u -r1.191 Makefile --- gcc34/Makefile 25 Dec 2004 13:41:58 -0000 1.191 +++ gcc34/Makefile 8 Jan 2005 16:45:43 -0000 @@ -8,7 +8,7 @@ PORTNAME= gcc PORTVERSION= 3.4.4 -PORTREVISION= 20041224 +PORTREVISION= 20041224.1 CATEGORIES= lang java VERSIONSTRING= 3.4-${PORTREVISION} MASTER_SITES= ${MASTER_SITE_GCC} \ Index: gcc34/files/patch-gcc,config,freebsd-spec.h =================================================================== RCS file: gcc34/files/patch-gcc,config,freebsd-spec.h diff -N gcc34/files/patch-gcc,config,freebsd-spec.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gcc34/files/patch-gcc,config,freebsd-spec.h 8 Jan 2005 16:44:08 -0000 @@ -0,0 +1,22 @@ +--- gcc/config/freebsd-spec.h.orig Wed Dec 22 03:00:24 2004 ++++ gcc/config/freebsd-spec.h Sat Jan 8 02:00:23 2005 +@@ -130,11 +130,19 @@ + }" + #else + #if FBSD_MAJOR >= 5 ++#if __FreeBSD_version < 502102 /* upto FreeBSD 5.2.1 */ ++#define FBSD_LIB_SPEC " \ ++ %{!shared: \ ++ %{!pg: %{pthread:-lc_r} -lc} \ ++ %{pg: %{pthread:-lc_r_p} -lc_p} \ ++ }" ++#else + #define FBSD_LIB_SPEC " \ + %{!shared: \ + %{!pg: %{pthread:-lpthread} -lc} \ + %{pg: %{pthread:-lpthread_p} -lc_p} \ + }" ++#endif /* deal with FreeBSD 5.0 - 5.2.1 */ + #else + #define FBSD_LIB_SPEC " \ + %{!shared: \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501081657.j08GvnML053109>