www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/06/27/04:16:41

From: djr AT dit DOT upm DOT es (Daniel J. Rodriksson)
Subject: Re: Why MINGW32-EGCC compiled programs so big in size?
27 Jun 1998 04:16:41 -0700 :
Message-ID: <35939317.D41EB921.cygnus.gnu-win32@dit.upm.es>
References: <000601bda052$12910be0$e616e2c2 AT andrei-i DOT akdi DOT ru>
Mime-Version: 1.0
To: "\"GNU-Win32\"" <gnu-win32 AT cygnus DOT com>

--------------028824158ECF953BFAA2335F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Andrey I. Iliev wrote:

> I build some program (source.cpp) using 3 different compilers.
> Here is file size of executables :
> 1) VC5                                68096
> 2) BCC 5.02                      69632
> 3) Cygnus b19                   23746
> 4) MINGW32-EGCC      176149 !!!
> 5) MINGW32-GCC           26046
>
> Can anybody explain why  MINGW32-EGCC produce so big executable?
>  I feel it's probably because MINGW32-EGCC  link statically some libs?
> What libs and why?
>
> All executables has been compiled with default options:
> GNU GCC: gcc -o source.exe source.cpp
> VC5: cl source.cpp
> BCC5: bcc32 source.cpp.
>
> The program use the following headers:
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <time.h>
> #include <math.h>

I attained these results myself, but then decided to produce a C++
executable
with mingw32-gcc ( bare bones program ), and the size was that of the
mingw32-egcc c compiled program.

My guess: C++ library is always being linked into your program. I might be
wrong of course.

Cheers

--
-------------------------------------------------------------|
|         Remember Scotch: 'THERE CAN BE ONLY ONE'           |
-------------------------------------------------------------|
| Daniel J. Rodriksson       | C-220,ETSI Telecomunicaciones |
| djr AT dit DOT upm DOT es             | Avda Paraninfo S/N            |
| http://www.dit.upm.es/~djr | 28040 Madrid                  |
| +34-91-3367366 + ext 469   | SPAIN                         |
|------------------------------------------------------------|



--------------028824158ECF953BFAA2335F
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
Andrey I. Iliev wrote:
<BLOCKQUOTE TYPE=CITE>I build some program (source.cpp) using 3 different
compilers.
<BR>Here is file size of executables :
<BR>1) VC5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
68096
<BR>2) BCC 5.02&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
69632
<BR>3) Cygnus b19&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
23746
<BR>4) MINGW32-EGCC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 176149 !!!
<BR>5) MINGW32-GCC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
26046

<P>Can anybody explain why&nbsp; MINGW32-EGCC produce so big executable?
<BR>&nbsp;I feel it's probably because MINGW32-EGCC&nbsp; link statically
some libs?
<BR>What libs and why?

<P>All executables has been compiled with default options:
<BR>GNU GCC: gcc -o source.exe source.cpp
<BR>VC5: cl source.cpp
<BR>BCC5: bcc32 source.cpp.

<P>The program use the following headers:
<BR>#include &lt;stdio.h>
<BR>#include &lt;stdlib.h>
<BR>#include &lt;string.h>
<BR>#include &lt;time.h>
<BR>#include &lt;math.h></BLOCKQUOTE>
I attained these results myself, but then decided to produce a C++ executable
<BR>with mingw32-gcc ( bare bones program ), and the size was that of the
<BR>mingw32-egcc c compiled program.

<P>My guess: C++ library is always being linked into your program. I might
be
<BR>wrong of course.

<P>Cheers
<PRE>--&nbsp;
-------------------------------------------------------------|
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Remember Scotch: 'THERE CAN BE ONLY ONE'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
-------------------------------------------------------------|
| Daniel J. Rodriksson&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | C-220,ETSI Telecomunicaciones |
| djr AT dit DOT upm DOT es&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Avda Paraninfo S/N&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
| <A HREF="http://www.dit.upm.es/~djr">http://www.dit.upm.es/~djr</A> | 28040 Madrid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
| +34-91-3367366 + ext 469&nbsp;&nbsp; | SPAIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
|------------------------------------------------------------|</PRE>
&nbsp;</HTML>

--------------028824158ECF953BFAA2335F--

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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