From mi@rtfm.ziplink.net  Wed Apr 22 01:04:24 1998
Received: from aldan.ziplink.net (mi@kot.ne.mediaone.net [24.128.29.55])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA07253
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 22 Apr 1998 01:04:23 GMT
          (envelope-from mi@rtfm.ziplink.net)
Received: from rtfm.ziplink.net (rtfm [199.232.255.52])
	by aldan.ziplink.net (8.8.8/8.8.7) with ESMTP id BAA01386
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 22 Apr 1998 01:04:18 GMT
	(envelope-from mi@rtfm.ziplink.net)
Received: (from mi@localhost)
	by rtfm.ziplink.net (8.8.8/8.8.5) id VAA24873;
	Tue, 21 Apr 1998 21:04:17 -0400 (EDT)
Message-Id: <199804220104.VAA24873@rtfm.ziplink.net>
Date: Tue, 21 Apr 1998 21:04:17 -0400 (EDT)
From: Mikhail Teterin <mi@aldan.algebra.com>
Reply-To: mi@aldan.algebra.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: gcc-2.8.1 port does not create shared libs
X-Send-Pr-Version: 3.2

>Number:         6380
>Category:       ports
>Synopsis:       gcc-2.8.1 port does not create shared libs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 21 18:10:01 PDT 1998
>Closed-Date:    Thu May 21 17:26:07 PDT 1998
>Last-Modified:  Thu May 21 17:26:46 PDT 1998
>Originator:     Mikhail Teterin
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

	Nothing special

>Description:

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
gmake[2]: *** [libglib.la] Error 1
gmake[2]: Leaving directory `/ccd/ports/x11/gtk/work/gtk+-1.0.0/glib'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/ccd/ports/x11/gtk/work/gtk+-1.0.0'
gmake: *** [all-recursive-am] Error 2


>How-To-Repeat:

	See description

>Fix:
	
	Use ``cc -shared'' for shared libraries.
>Release-Note:
>Audit-Trail:

From: Ollivier Robert <roberto@keltia.freenix.fr>
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 <roberto@keltia.freenix.fr>
 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
State-Changed-From-To: open->closed 
State-Changed-By: obrien 
State-Changed-When: Thu May 21 17:26:07 PDT 1998 
State-Changed-Why:  
Patch commited. 
>Unformatted:
