Link time optimization in D

Walter Bright newshound1 at digitalmars.com
Tue Jun 1 02:57:07 PDT 2010


Alex Makhotin wrote:
> So the best way to build release version(assuming two-phase build) 
> should be:
> 
> 1. Synchronize DMD compilation switches with DMD link switches(-release 
> -O -inline).
> 2. Pass all the project sources in one DMD cmd line, compile.
> 3. Link produced object file with other libs.
> 
> Am I correct?

You don't need to "synchronize" switches. Just pass all the source files that 
you can that make up your project on one command line.

> Does single-phase(compile-link in one command line) give optimization 
> gain with the DMD?

Yes.


More information about the Digitalmars-d mailing list