Compiling to LLVM Bitcode

Dave G test at test.com
Tue May 14 20:30:14 PDT 2013


LDC has the -output-bc flag to generate bitcode files, but they 
are generated before linking. Is there any way to generate a 
single complete bitcode file (instead of an executable or 
library)?

"llvm-link" can link the files "ldc2 -output-bc" generates, but I 
still need it to link to the standard library and runtime. I 
rebuilt LDC to generate the bitcode files for phobos and the 
runtime and then joined them all, but could not create a working 
executable from that.

The goal here is to generate something that emscripten can 
compile.


PS: I've played around with D a bit, but have never used LDC or 
emscripten before.


More information about the digitalmars-d-ldc mailing list