keith@csli.Stanford.EDU (Keith Nishihara) (11/17/89)
On building g++ on Pmax (sources from interviews `snapshot.tar.Z' distribution of Nov 8 (I think g++ was created Nov 6 for this snapshot)). (BTW: what is g++1.36.xtar.Z?) ham@Neon.Stanford.EDU (Peter R. Ham) writes: >Personally, I haven't been very successful. >Gcc 1.36 doesn't have all of the fixes to the mips >backend that Mark Linton has to make it work. >Instead of using g++-1.36.1, I'm trying to install >his version that comes with the interviews >distribution. I didn't realise that they were different! >I can't compile c.parse.tab.c with gcc (-O) itself due >to running out of swap space. I had this problem too. However, gcc will compile it if the -O flag is ommitted. > Be sure to >define USE_C_ALLOCA in the configuration file as well >as uncomment out the definition of ALLOCA in the makefile. >Without this fix, gcc runs out of swap space on much smaller files. I didn't have this problem. >In addition, I couldn't compile cplus-decl.c from g++-1.36 with >mips cc. I think that have a typechecking bug. Nor this one. >All of these problems can be worked around, but I haven't >gotten that far yet. I made a g++ which sort of worked on 20 line examples, and was about 10 times faster than cfront1.2. However, I couldn't find a definition for __main(): I hacked up a dummy, just to make the link go through, and it all worked. Static constructors didn't work though - surprise - and I couldn't see what I needed to put into __main() to achieve the desired effect. Also, there seemed to be no g++ driver - although gcc seems to do the right thing with files called *.cc. I tried iv/src/bin/CC/CC.c instead, substituting gnu instead of cfront 1.2 by changing the appropriate defines, but then I couldn't find libgnulib.a. I did not persue the matter, since the comments in CC/CC.c make it clear that the preferred compiler for interviews on the Pmax is still cfront, and also I do not have enough disc space to have iv2.5, iv2.6 and g++ all at the same time. In fact I had to go through and delete every object file I could find and a whole bunch of less useful files just to get g++ compiled. (The files I needed were probably there - just that I couldn't have them all loaded at once! I wouldn't start without 20M spare next time.) I have been using the gcc built from the same distribution, and on some (quite lengthy) programs it works just fine, compiling code about 0.1% smaller than MIPS cc, and running the same perceived speed (without actually measuring accurately). However, on some other code (xloadimage, e.g.) it produces code which core dumps where the regular cc does not. Since gcc on Pmax bombs out horribly with the -g flag (the notes say `can't create -g debugging data' - what actually happens is much more gross), it is hard to debug. A quick look with dbx says `can't seek to program offset'. So I deleted the core and gave up. I conclude that there are still some problems. I will try again in a week or so - maybe I'll get some more disc space, and really look at it. Best wishes, let us know what you find. Neil/. Neil%teleos.com@ai.sri.com ...decwrl!argosy!teleos!neil