Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 1998 03:50:01 -0700 (PDT)
From:      Ollivier Robert <roberto@keltia.freenix.fr>
To:        freebsd-ports
Subject:   Re: ports/6380: gcc-2.8.1 port does not create shared libs
Message-ID:  <199804221050.DAA13036@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/6380; it has been noted by GNATS.

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

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199804221050.DAA13036>