Incremental compilation with DMD

Tom S h3r3tic at remove.mat.uni.torun.pl
Sat Sep 12 16:19:09 PDT 2009


Walter Bright wrote:
> Tom S wrote:
>> As for my own impressions of this idea, its biggest drawback probably 
>> is that the multitude of object files created via -multiobj strains 
>> the filesystem.
> 
> Sure, but -multiobj and -lib generate exactly the same object files, 
> it's just that -lib puts them all into a library so it doesn't strain 
> the file system.
> 
> Extracting the obj files from the lib is pretty simple, you can see the 
> libomf.c for the format.

You're right, I'm sorry. I must've overlooked something in the lib dumps 
and assumed one module overwrites the other.

So with -lib, it should be possible to only extract the object files 
that contain static constructors and the main function and keep the rest 
packed up. Does that sound about right?

By the way, using -lib causes DMD to eat a LOT of memory compared to the 
'normal' mode - in one of my projects, it eats up easily > 1.2GB and 
dies. This could be a downside to this approach. I haven't tested 
whether it's the same with -multiobj

Would it be hard to add an option to DMD to control template emission? 
Apparently GDC has -femit-templates, so it's doable ;) LDC outputs 
instantiations to all objects.


-- 
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode



More information about the Digitalmars-d mailing list