digitalmars.D.learn - Executable size when compiling with GDC
- Mars (6/6) Feb 21 2012 Hello everybody.
- Andrea Fontana (2/10) Feb 21 2012
- Mars (3/4) Feb 21 2012 Down to 1 MB, a good start, thanks. I guess that's more bearable.
- Andrea Fontana (2/7) Feb 22 2012
- Trass3r (5/5) Feb 21 2012 Lots of symbols and stuff.
- Dmitry Olshansky (5/10) Feb 22 2012 I recall debug builds with MinGW GCC on windows are also enormous. Try
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
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
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
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
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
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? MarsI recall debug builds with MinGW GCC on windows are also enormous. Try release vs debug. -- Dmitry Olshansky
Feb 22 2012