[comp.windows.x] C++ on Sun 4.1

don@zardoz.coral.COM (Don Dewar) (12/13/90)

) >Please save me.  A few weeks ago I requested that someone resend me
) >the patch that fixed g++-ld on Sparcs using SunOS 4.1.  No one
) >responced )-:  Since then, at least 5 other people have asked me to
) >forward them the phantom patch.  If you are still out there, please help
) >us.  Our numbers are growing.
) >
) 
) Hi, 
) 	If you haven't received any response, I hope the following posting
) which I saved when I was buliding g++ is of help.
) -thana
) --------------------------------------------------------------------------
) 
) Status: RO
) 
) >I am having problems running the test programs in the libg++ test suite.
) >All of the programs dump core (segmentation violation). I have compiled
) >
) >gcc-1.37.1
) >g++-1.37.2 (xtar.Z)
) >libg++-1.37.2
) >
) >The g++ loader (ld.c) is the same as the latest one posted on 
) >labrea.stanford.edu.  Has anyone gotten g++/libg++ working on Sun 4/110
) >running SUNOS 4.1? If so, what was the trick?
) 
) Apparently there are two tricks.
) 
) First, get a new (and different) copy of the special linker for g++ from
) labrea.stanford.edu.  Its called ld.c.Z and is in the pub/gnu directory.
) 
) The second trick was described here not that long ago:
) 
) ========================================================================
) >From: caveh@csl.sri.com (Caveh Jalali)
) 
) i have run across this problem also.  after some investigation it turns out
) that when compiling under 4.1, the linker links the a.out to the wrong
) address; hence, the core dumps.  turns out that sun screwed with a macro
) in one of the .h files, so things don't work quite the same under 4.1.
) 
) here is a quick and dirty fix:
) 
) in g++/ld.c: around line 1002, just after
) 
)   N_SET_MAGIC (outheader, magic);
) 
) add the following line:
) 
)   outheader.a_entry = PAGSIZ;
) 
) and everything should work.  i don't have the unpatched source online right
) now so i can't give a diff, but i think that is the only change required.
) 
) -- 
) 
) // Ron Guilmette  -  C++ Entomologist
) // Internet: rfg@ncd.com      uucp: ...uunet!lupine!rfg
) // Motto:  If it sticks, force it.  If it breaks, it needed replacing anyway.
) 
) 

Praise be to the net.  Although I haven't tried this yet, I am sure
that it or some of the other additional suggestions to this will work.
One message also suggested getting the new bison (1.11), gas (1.37),
and gcc (1.37.1).  Then do what it says above.  Thank you all (Ron,
Frank, Dave, George, and whoever else) for responding.


  +---------+
  | Coral   |
  |@@@@@*@**|
  |@@*@@**@@|     Don Dewar
  |*@@**@@@@|     Coral Network Corporation, Marlborough, MA
  |@***@@@@@|     Internet: don@coral.com
  |@@**@@@@@|     Phone:    (508) 460-6010
  |*********|     Fax:      (508) 481-6258
  |Networks |
  +---------+