From:	CRDGW2::CRDGW2::MRGATE::"SMTP::PREP.AI.MIT.EDU::INFO-G++-REQUEST" 13-AUG-1989 15:11
To:	MRGATE::"ARISIA::EVERHART"
Subj:	Re: Compiling g++ on SUN3 w/OS4

Received: by life.ai.mit.edu (4.1/AI-4.10) id AA02621; Sun, 13 Aug 89 13:55:04 EDT
Return-Path: <info-g++-request@prep.ai.mit.edu>
Received: from tut.cis.ohio-state.edu by life.ai.mit.edu (4.1/AI-4.10) id AA02563; Sun, 13 Aug 89 13:40:18 EDT
Received: by tut.cis.ohio-state.edu (5.61/4.890725)
	id AA28699; Sun, 13 Aug 89 13:38:00 -0400
Received: from USENET by tut.cis.ohio-state.edu with netnews
	for info-g++@prep.ai.mit.edu (info-g++@prep.ai.mit.edu)
	(contact usenet@tut.cis.ohio-state.edu if you have questions)
Date: 13 Aug 89 00:54:21 GMT
From: pacbell!osc!strick@ames.arc.nasa.gov  (henry strickland)
Organization: the techwood toaster pastry users group
Subject: Re: Compiling g++ on SUN3 w/OS4
Message-Id: <477@osc.COM>
References: <919@dialogic.UUCP>
Sender: info-g++-request@prep.ai.mit.edu
To: info-g++@prep.ai.mit.edu

In article <919@dialogic.UUCP> gerry@dialogic.UUCP (Gerry Lachac) writes:
>
>I'm having trouble getting g++1.35 to work on a Sun 3 running SUN OS
>4.0.3.  I have compiled the g++ compiler and the library (libg++.a).
>The problem is that when I attempt to compile tests (the tests
>programs that come with libg++1.35) I receive a 
>
>	Undefined symbol __DYNAMIC referenced from text
>
>The makefile hints at problems with SUNOS4 and the linker.  Is there
>some fix for my problems?
>
>-- 
>uunet!dialogic!gerry   | 			   |	Dialogic Corporation
>	OR	       |  			   |	129 Littleton Rd
>gerry@dialogic.UUCP    |			   |	Parsippany, NJ 07054 
>		       |  			   |	(201)334-8450

Here was my unofficial solution to your problem (I wrote this for a friend
a while ago).   Be sure crt0+.o is in /usr/local/lib/.

===============================
README:

APPLY THIS DIFF TO g++/config/tm-sun3.h ....

** BUT FIRST ** notice that it is a symbolic link!

SO -- copy g++/config/tm-sun3.h somewhere, remove the link, and copy it back.
BECAUSE you don't want these diffs in the "gcc" -- only in the "g++".   

WHAT THESE DO:  make g++ look for the c runtime "crt0+.o" rather than
the usual "crt0.o".   "crt0+.o" knows how to initialize global and static
objects with constructors,  using lists make by g++'s ld++ linker, which
has a built-in muncher (rather than using a separate munch program like
at&t does).   

If you use this on something besides a sun3, you may have to make similar
diffs to other dot-h files.

					strick

==========================

*** tm-sun3.h.orig	Wed Feb 22 09:27:23 1989
--- tm-sun3.h	Tue Jul  4 15:20:39 1989
***************
*** 77,84 ****
  
  #if TARGET_DEFAULT & 0100
  /* -mfpa is the default */
  #define STARTFILE_SPEC					\
!   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}	\
     %{m68881:Mcrt1.o%s}					\
     %{msoft-float:Fcrt1.o%s}				\
     %{!m68881:%{!msoft-float:Wcrt1.o%s}}"
--- 77,85 ----
  
  #if TARGET_DEFAULT & 0100
  /* -mfpa is the default */
+ /* ------> NOTA BENE: strick adds the "+" to  p:crt0.o%s.   4jul89 */
  #define STARTFILE_SPEC					\
!   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0+.o%s}}	\
     %{m68881:Mcrt1.o%s}					\
     %{msoft-float:Fcrt1.o%s}				\
     %{!m68881:%{!msoft-float:Wcrt1.o%s}}"
***************
*** 85,99 ****
  #else
  #if TARGET_DEFAULT & 2
  /* -m68881 is the default */
  #define STARTFILE_SPEC					\
!   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}	\
     %{mfpa:Wcrt1.o%s}					\
     %{msoft-float:Fcrt1.o%s}				\
     %{!mfpa:%{!msoft-float:Mcrt1.o%s}}"
  #else
  /* -msoft-float is the default */
  #define STARTFILE_SPEC					\
!   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}	\
     %{m68881:Mcrt1.o%s}					\
     %{mfpa:Wcrt1.o%s}					\
     %{!m68881:%{!mfpa:Fcrt1.o%s}}"
--- 86,102 ----
  #else
  #if TARGET_DEFAULT & 2
  /* -m68881 is the default */
+ /* ------> NOTA BENE: strick adds the "+" to  p:crt0.o%s.   4jul89 */
  #define STARTFILE_SPEC					\
!   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0+.o%s}}	\
     %{mfpa:Wcrt1.o%s}					\
     %{msoft-float:Fcrt1.o%s}				\
     %{!mfpa:%{!msoft-float:Mcrt1.o%s}}"
  #else
  /* -msoft-float is the default */
+ /* ------> NOTA BENE: strick adds the "+" to  p:crt0.o%s.   4jul89 */
  #define STARTFILE_SPEC					\
!   "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0+.o%s}}	\
     %{m68881:Mcrt1.o%s}					\
     %{mfpa:Wcrt1.o%s}					\
     %{!m68881:%{!mfpa:Fcrt1.o%s}}"
-- 
					strick@osc.osc.com     415-325-2300
					uunet!lll-winken!pacbell!osc!strick
					( strick@gatech.edu )
