From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam Lantinga To: Martin von Loewis Cc: egcs@egcs.cygnus.com, slouken@devolution.com, highlander@lokigames.com Subject: Re: Large code size? Date: Wed, 24 Mar 1999 15:05:00 -0000 Message-id: X-SW-Source: 1999-03/msg00782.html > > 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/ -- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sam Lantinga To: Martin von Loewis Cc: egcs@egcs.cygnus.com, slouken@devolution.com, highlander@lokigames.com Subject: Re: Large code size? Date: Wed, 31 Mar 1999 23:46:00 -0000 Message-ID: X-SW-Source: 1999-03n/msg00787.html Message-ID: <19990331234600.waIvJR8SaoT0TXl5rhUPNI8WWLTeAPSC84TMjmM9S3Y@z> > > 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/ --