GDC2 [Re: GDC2 compilation warnings]

Iain Buclaw ibuclaw at ubuntu.com
Wed Nov 24 10:46:11 PST 2010


== Quote from bearophile (bearophileHUGS at lycos.com)'s article
> >If you compare GDC1 and GDC2, you'll see the same thing. The problem is likely
because Phobos2 is heavily templated in comparison to Phobos1, so you're pulling
in a lot more functions than you bargain for.<
> That little path tracer uses mostly the C std lib (or just it). And DMD2
produces a twice smaller program (unstripped), so I think the problem is elsewhere.

Oh, just remembered. Stripping the installed libraries helps just a wee bit:

Really bad example to prove :)
---
import std.stdio;

void main()
{
    writeln("Hello World");
}

Output program size on my system:
DMD - with debugged libphobos2.a: 2.5M (unstripped)
DMD - with stripped libphobos2.a: 532K (unstripped)
DMD - with stripped libphobos2.a: 296K (stripped)
GDC - with debugged libgphobos2.a: 1.9M* (unstripped)
GDC - with stripped libgphobos2.a: 688K* (unstripped)
GDC - with stripped libgphobos2.a: 424K* (stripped)

*Includes debugged/stripped libgdruntime.a too.

The extra few hundred kilobytes I can imagine being because of linking in
libgcc_s.a, which is used for the DWARF exception handling routines. If someone
finds this may not be the case, I'd like to hear of your replies.



> >File a bug against GCC then.<
> I don't think they will change GCC about this.

Then I won't change GCC about this either.


Regards
Iain


More information about the Digitalmars-d mailing list