www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Executable size when compiling with GDC

reply "Mars" <- -.-> writes:
Hello everybody.

Today I've tested GDC (on Windows), and a simple Hello World 
program results in a 5 MB exe file, while it's only about 200 KB 
with DMD. Is this normal? What does GDC (GCC?) put in there, to 
make it so big, and why?

Mars
Feb 21 2012
next sibling parent reply Andrea Fontana <advmail katamail.com> writes:
Have you tried to strip executable using --strip or --strip-all?



Il giorno mar, 21/02/2012 alle 13.51 +0100, Mars ha scritto:

 Hello everybody.
=20
 Today I've tested GDC (on Windows), and a simple Hello World=20
 program results in a 5 MB exe file, while it's only about 200 KB=20
 with DMD. Is this normal? What does GDC (GCC?) put in there, to=20
 make it so big, and why?
=20
 Mars
Feb 21 2012
parent reply "Mars" <- -.-> writes:
On Tuesday, 21 February 2012 at 13:19:11 UTC, Andrea Fontana 
wrote:
 Have you tried to strip executable using --strip or --strip-all?
Down to 1 MB, a good start, thanks. I guess that's more bearable.
Feb 21 2012
parent Andrea Fontana <advmail katamail.com> writes:
You can try upx too :)

Il giorno mar, 21/02/2012 alle 16.43 +0100, Mars ha scritto:

 On Tuesday, 21 February 2012 at 13:19:11 UTC, Andrea Fontana=20
 wrote:
 Have you tried to strip executable using --strip or --strip-all?
=20 Down to 1 MB, a good start, thanks. I guess that's more bearable.
Feb 22 2012
prev sibling next sibling parent Trass3r <un known.com> writes:
Lots of symbols and stuff.
You can get it down with -ffunction-sections -fdata-sections  
-Wl,-s,--gc-sections
Phobos should also be compiled with -ffunction-sections -fdata-sections to  
get the whole effect though.
Feb 21 2012
prev sibling parent Dmitry Olshansky <dmitry.olsh gmail.com> writes:
On 21.02.2012 16:51, Mars wrote:
 Hello everybody.

 Today I've tested GDC (on Windows), and a simple Hello World program
 results in a 5 MB exe file, while it's only about 200 KB with DMD. Is
 this normal? What does GDC (GCC?) put in there, to make it so big, and why?

 Mars
I recall debug builds with MinGW GCC on windows are also enormous. Try release vs debug. -- Dmitry Olshansky
Feb 22 2012