Large code size?

Sam Lantinga slouken@devolution.com
Wed Mar 24 15:05:00 GMT 1999


> > It looks like exception handling is disabled by default, and we don't use it
> > in our code...  ?

> Well, then I recommend compiling with -fno-exceptions. Exception handling
> *is* activated by default.

The smallest I could get it, using -Os, -fno-exceptions, no optimization,
and -s was 950K, still 50% bigger than VC++.

I think it's the template code that might be big.  It uses templates all
over the place, templates which don't compile using gcc.  Can anyone 
confirm this?  I don't know if it's something that can be reduced to
a simple case.  (I could be wrong, too. :)

It's also interesting that linking it with cc1plus as opposed to cc1
results in a binary 24K bigger, because, according to the linker, it
links in file io stuff from /usr/lib/stdc++.  The final binary which
dynamically loads it presumably has those routines available, and is
compiled with -Wl,--export-dynamic, so it should pick them up.

Also, when linking with either cc1 or cc1plus, and specifying
-fno-exceptions, the exception.o object from libgcc.a is still
linked in.

Ideas?
	-Sam Lantinga				(slouken@devolution.com)

Lead Programmer, Loki Entertainment Software
--
Author of Simple DirectMedia Layer -
	http://www.devolution.com/~slouken/SDL/
--


More information about the Gcc mailing list