From owner-freebsd-ports Wed Apr 22 03:50:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA13056 for freebsd-ports-outgoing; Wed, 22 Apr 1998 03:50:04 -0700 (PDT) (envelope-from owner-freebsd-ports@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA13036; Wed, 22 Apr 1998 03:50:01 -0700 (PDT) (envelope-from gnats) Date: Wed, 22 Apr 1998 03:50:01 -0700 (PDT) Message-Id: <199804221050.DAA13036@hub.freebsd.org> To: freebsd-ports Cc: From: Ollivier Robert Subject: Re: ports/6380: gcc-2.8.1 port does not create shared libs Reply-To: Ollivier Robert Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR ports/6380; it has been noted by GNATS. From: Ollivier Robert To: mi@aldan.algebra.com, FreeBSD-gnats-submit@FreeBSD.ORG Cc: obrien@FreeBSD.ORG Subject: Re: ports/6380: gcc-2.8.1 port does not create shared libs Date: Wed, 22 Apr 1998 12:32:00 +0200 According to Mikhail Teterin: > pgcc -shared -o .libs/libglib.so.1.0 garray.lo gcache.lo gerror.lo ghash.lo glist.lo gmem.lo gprimes.lo gslist.lo gtimer.lo gtree.lo gstring.lo gscanner.lo gutils.lo > ld: No reference to __DYNAMIC The following patch should be adapted to gcc 2.8.1 and sent to the gcc folks. This fix is present in our 2.7.2.1 gcc and since January in the egcs/pgcc tree. Date: Wed, 28 Jan 1998 08:35:55 +0100 From: Ollivier Robert To: current@freebsd.org Subject: Re: Building EGCS. What am I missing? According to John Polstra: > Probably building shared libraries by hand with "ld -Bshareable > /usr/lib/c++rt0.o *.so ..." will work OK. The problem just affects > "gcc -shared". Here is John's fix, adapted to egcs. The fix was made on pgcc 980122 but it should apply mostly cleanly on every version of either egcs or pgcc. I was able to build a shared lib with our bsd.lib.mk after that. egcs doesn't have a STARTFILE_SPEC so I added our own (I'm not sure about it). I'll send them to the egcs folks. --- freebsd.h.old Mon Jan 26 22:07:49 1998 +++ freebsd.h Wed Jan 28 07:56:19 1998 @@ -38,7 +38,7 @@ #define CPP_PREDEFINES "-Dunix -Di386 -Dbsd4_4 -D__FreeBSD__=2 -D__386BSD__ -Asystem(unix) -Asystem(FreeBSD) -Acpu(i386) -Amachine(i386)" /* Like the default, except no -lg. */ -#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" +#define LIB_SPEC "%{!shared:%{!pg:-lc}%{pg:-lc_p}}" #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" @@ -220,7 +220,15 @@ #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k}" #define LINK_SPEC \ - "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} %{assert*}" + "%{p:%e`-p' not supported; use `-pg' and gprof(1)} \ + %{shared:-Bshareable} \ + %{!shared:%{!nostdlib:%{!r:%{!e*:-e start}}} -dc -dp %{static:-Bstatic} \ + %{pg:-Bstatic} %{Z}} \ + %{assert*} %{R*}" + +#define STARTFILE_SPEC \ + "%{shared:c++rt0.o%s} \ + %{!shared:%{pg:gcrt0.o%s}%{!pg:%{static:scrt0.o%s}%{!static:crt0.o%s}}}" /* This is defined when gcc is compiled in the BSD-directory-tree, and must * make up for the gap to all the stuff done in the GNU-makefiles. -- Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr FreeBSD keltia.freenix.fr 3.0-CURRENT #3: Tue Apr 14 21:41:01 CEST 1998 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message