From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22944 invoked by alias); 25 Sep 2002 18:34:46 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 22921 invoked from network); 25 Sep 2002 18:34:44 -0000 Received: from unknown (HELO mailsrv2.magsoft.com) (206.155.37.253) by sources.redhat.com with SMTP; 25 Sep 2002 18:34:44 -0000 Received: by mailsrv2.magellan.com with Internet Mail Service (5.5.2653.19) id ; Wed, 25 Sep 2002 11:34:42 -0700 Message-ID: From: Douglas Richardson To: 'Chris Croswhite' Cc: "'gcc-help@gcc.gnu.org'" Subject: RE: Executable size Date: Wed, 25 Sep 2002 11:34:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-SW-Source: 2002-09/txt/msg00194.txt.bz2 Chris, I noticed the same thing. Based on some test programs I wrote I believe that the C++ STL is to blame. I wrote two hello world programs that I compiled with g++, one including and using cout, the other one including and using printf. Both were statically linked with the runtime libraries and stripped. The program that used cout was about 194k while the one that used printf was about 4k. I also wrote a small test program that only included and it was about 32k. I know the STL library that ships with g++ has changed since 2.95, that that is probably why you have seen the growth in your program size. The only ways I can think of to reduce your code size is to either use gcc 2.95 or replace the code that relies on STL. I know that isn't a very satisfying answer, but it's all I got. Douglas Richardson. -----Original Message----- From: Chris Croswhite [mailto:ccroswhite@get2chip.com] Sent: Wednesday, September 25, 2002 11:06 To: Douglas Richardson Subject: RE: Executable size I am currently using 3.2, but I have watched from 2.95 to 3.03, 3.1 and then 3.2 that the executable is growing by at least 30%. I have tried this across all optimizations - O,O2,O3,g. In the case of -g, the executable is 55% larger, in the case of O3 it is 31% larger (than using 2.953). Here: 2.953: -g = 30560264 -O = 8889831 -O2 = 8893383 -O3 = 9009271 3.2: -g = 63274234 -O = 11198086 -O2 = 11458534 -O3 = 11252525 The code base is mixed c/c++ but I use g++ to compile everything. I am making a statically linked executable. TIA, Chris On Wed, 2002-09-25 at 10:57, Douglas Richardson wrote: > Chris, > > Are you using any optimizations? How are you linking with the runtime > libraries? > > Send the output of gcc -v. > > Douglas Richardson. > > -----Original Message----- > From: Chris Croswhite [mailto:ccroswhite@get2chip.com] > Sent: Wednesday, September 25, 2002 10:55 > To: gcc-help@gcc.gnu.org > Subject: Executable size > > > Sirs, > > I am trying to figure out how to reduce the size of my executable (that > has grown with the increments of gcc upgrades even though the code base > has not changed). I would like to understand how I can reduce/cut out > so that the executable to back down to the 2.953 size. Can anyone give > me some pointers? > > TIA, > Chris >