[comp.unix.i386] gcc and g++ compilers

jackv@turnkey.gryphon.COM (Jack F. Vogel) (08/17/89)

I have some questions concerning the GNU compilers, both gcc and g++.

First off I am running ISC 2.0.1 on a 20Mhz system with 3 Meg of memory.
I have successfully built gcc, but it has some problems. Mainly it
is SLOW!!!, it seems that when the pass gcc-cc1 runs it hangs the whole
system for quite a while, I do not know if it grabs so much memory that
everything else is swapped out or what. It does this even compiling some
simple little "hello world" type program. I have been patient and let it
run to completion and it will eventually finish, however if I turn on the
optimizer it has hung so long that I gave up and killed it. I wondered if
anyone else sees this type of behavior, am I not running with enough memory
or could something else be the problem?? Trying to compile some appreciable
source archive is completely unacceptable.

Secondly, I have tried to build the g++ compiler and had even less success.
Initially when built it was generating assembly code with symbol names that
the assembler rejected. Thanks to Tom Friedel I was pointed at a patch file
on tut.cis.ohio-state.edu (Thanks TOM!!) which fixed this problem and some
problems relating to the COFF linker. I ftp'ed that file, applied the changes
and rebuilt things. The one problem I had related to building crt0+.o and
crtn+.o. There was a string being put into an asm() function that the
compiler claimed was a bad construction. The only way I could get around
it was to generate the assembly file and then edit it before assembling it.
I would really like to know how any one got it to work as it was. 
However, after building the compiler components and installing them I am 
getting an abort, core dump from the compiler pass gcc-cc1plus. I would like
to hear from anyone else who has encountered and solved this problem. The
main thing I am worried about is that the source base that I am working on
was taken from work and it is not guaranteed untouched. If others out ther
have gotten it to work OK, perhaps I should ftp untouched distribution and
try again.

Any help or suggestions in these matters would be greatly appreciated! Post
or mail to me. The addresses in my signature are OK but I would see mail
more quickly addressed to jackv@turnkey.gryphon.COM.


-- 
Jack F. Vogel			jackv@seas.ucla.edu
AIX Technical Support	              - or -
Locus Computing Corp.		jackv@ifs.umich.edu

james@raid.dell.com (James Van Artsdalen) (08/21/89)

In <6348@turnkey.gryphon.COM>, jackv@turnkey.gryphon.COM (Jack F. Vogel) wrote:

> First off I am running ISC 2.0.1 on a 20Mhz system with 3 Meg of memory.
> I have successfully built gcc, but it has some problems. Mainly it
> is SLOW!!!, it seems that when the pass gcc-cc1 runs it hangs the whole
> system for quite a while, I do not know if it grabs so much memory that
> everything else is swapped out or what.

What version of gcc?  How was it built?  I hope you didn't try to use
the portable alloca() floating around - it can consume enormous
amounts of memory.

With only 3meg of memory, it is very likely that things are getting
swapped.  In addition, function inlining can make gcc grow
tremendously.  One file in X has a function which calls another
function several hundred times.  gcc-cc1 consumed 14meg of virtual
space inlining all of those function calls...

gcc 1.35 works quite well, with the biggest complain being the lack of
PCC compatible struct returns.  I know of no bugs in 1.35.96, so the
1.36 version should be quite good.  Keep in mind that the goal of gcc
is to produce good programs, not to run quicker than other compilers,
and there is a price to be paid for portability.

> It does this even compiling some simple little "hello world" type
> program.

Buy more memory.  Don't even consider stuff like X until you do.

> Secondly, I have tried to build the g++ compiler and had even less success.

I don't think g++ is well ported to the 386 yet.  I know of a couple
of people who have done it, and neither recommend it unless you're
really serious about doing some hacking on it.  In particular the
g++ libraries are still BSD dependent I understand.
-- 
James R. Van Artsdalen          james@raid.dell.com       "Live Free or Die"
DCC Corporation       9505 Arboretum Blvd Austin TX 78759       512-338-8789

jackv@turnkey.gryphon.COM (Jack F. Vogel) (08/23/89)

In article <2875@dell.dell.com> james@raid.dell.com (James Van Artsdalen) writes:
>In <6348@turnkey.gryphon.COM>, jackv@turnkey.gryphon.COM (Jack F. Vogel) wrote:
>
>> First off I am running ISC 2.0.1 on a 20Mhz system with 3 Meg of memory.
>> I have successfully built gcc, but it has some problems. Mainly it
>> is SLOW!!!, it seems that when the pass gcc-cc1 runs it hangs the whole
>> system for quite a while, I do not know if it grabs so much memory that
>> everything else is swapped out or what.
>
>What version of gcc?  How was it built?  I hope you didn't try to use
>the portable alloca() floating around - it can consume enormous
>amounts of memory.
 
James, you are quite right, I was using the alloca source file in the
archive. Out of curiosity, I changed the makefile to pull it out of
libPW and to use libmalloc and performance got much better. Mind you, it
still can be slow but at least it seems more agreeable.

>With only 3meg of memory, it is very likely that things are getting
>swapped.  In addition, function inlining can make gcc grow
>tremendously. 
 
Yes, I have checked using ps while the thing was running and BOY can it
chew up the memory!! g++ is even worse, I have seen it grabbing up close
to 480 pages on compiling some files, it is doing so even on small files.
I am about to alleviate this situation, since I am picking up a memory 
upgrade to 8 Meg tomorrow (I can hardly wait!!).

>> Secondly, I have tried to build the g++ compiler and had even less success.
>
>I don't think g++ is well ported to the 386 yet.  I know of a couple
>of people who have done it, and neither recommend it unless you're
>really serious about doing some hacking on it.  In particular the
>g++ libraries are still BSD dependent I understand.

I have gotton considerably further along with g++ since when I posted my first
plea for help. I want to thank all those who took the time to send me mail. I
still have not gotton it to completely work however, my biggest source of 
headaches has been that the source archive I was using was not untouched. I
still cannot completely build libg++.a since the g++ compiler actually sleeps
awaiting more memory indefinitely when compiling certain files!! As I just
said with the increase to 8Meg I expect this problem to disappear. I have made
enough of the library to use it on linking simple programs, and I can now
completely compile, assemble and link an executable load module. What is real
weird now, is that although the programs execute, the streams objects (cin,
cout,and cerr) appear not to work, i.e., a program of the form:

#include <stream.h>

main()
{
	cout << "This is a test of the g++ compiler.\n";
}

produces no output at all!?! Yet, a standard C printf sort of syntax linked
with the new crt1+.o and crtn+.o works just fine. Soooo, I am really stumped
at this point, any suggestions would be appreciated. I really want to get
this silly thing working.

Thanks in advance for any input.

-- 
Jack F. Vogel			jackv@seas.ucla.edu
AIX Technical Support	              - or -
Locus Computing Corp.		jackv@ifs.umich.edu