delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/11/19/21:25:33

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Fri, 19 Nov 1999 21:24:55 -0500
To: Luke Liu <LLIU AT fipsco DOT com>
Cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: newbie: Why Cygwin/Egcs compiled executable is so bloated
Message-ID: <19991119212455.A19686@cygnus.com>
Mail-Followup-To: Luke Liu <LLIU AT fipsco DOT com>, cygwin AT sourceware DOT cygnus DOT com
References: <D05836441ECFD211A24800C0F02CC8F11E12D1 AT mail DOT fipsco DOT com>
Mime-Version: 1.0
X-Mailer: Mutt 1.0i
In-Reply-To: <D05836441ECFD211A24800C0F02CC8F11E12D1@mail.fipsco.com>; from LLIU@fipsco.com on Fri, Nov 19, 1999 at 06:57:48PM -0600

On Fri, Nov 19, 1999 at 06:57:48PM -0600, Luke Liu wrote:
>I understand that it is not as easy to work with dll with cygwin as with
>Visual C++ or Borland C++.  However, when I compiled the Hello world program
>generated by Visual C++ 6.0 wizard with Cygwin B20.1, the executable was
>530KB, meanwhile the mingw32 build was 315KB. Then I got the egcs2.95.2 and
>after renaming old lib for mingw32 by watching the gcc include/lib search
>path, I was able to reduce the executable of hello.exe with mingw32 to
>173KB. The size with Cygwin remains > 500KB.
>
>The compiler switch I used were
>	gcc -Os -mwindows -v -mno-cygwin -e _mainCRTStartup
>and 
>	gcc -Os -mwindows -v -e _mainCRTStartup
>
>respectively. Am I simply didn't enable the correct gcc switch? BTW, the
>VC++6.0 compiled debug executable is 157KB and the released version should
>be much smaller.
>Thanks,
>
>Luke
>
>P.S. I found that due to some screwed security of something, I cannot post
>to the solutioncentral from company. :-(((

Actually, you did post to solutioncentral three times. :-)

Here is my answer:

By default, gcc adds debugging information to every executable.  To
remove this you can either add a '-s' to the gcc command line or use the
strip command on the resulting executable:

strip file.exe

This should greatly reduce the size of the executable. 

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019