www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Poor man's LTO on windows

clang builds have some LTO.dll, but I didn't hear about it 
working on windows. Looks like there's a tool that can work like 
lto, the process is as follows:

ldc2.exe -m64 -of=tmp.bc -Os -singleobj -output-bc -c *.d
llvm-lto.exe -O2 -filetype=obj -exported-symbol=_Dmain -o tmp.o 
tmp.bc

Here we get an object file that can be subsequently linked. This 
removes module constructors too :)

BTW does ldc support gcc-style -o option?
Oct 08 2015