[cfe-dev] How to build clang into a monolithic bitcode file?

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Tue Feb 22 18:32:40 PST 2011


On 11-02-22 6:16 PM, Xiaolong Tang wrote:
>
> Hi all,
>
> I am wondering if there is any quick way to tweak the "Makefile" of
> clang (or LLVM) such that compiling clang can arrive at its bitcode
> file (where the symbols from llvm are already resolved), rather than
> the executable file?

On linux with gold you can you pass -plugin-opt=also-emit-llvm=foo.bc to 
the linker when linking clang. Note that that will give you the bitcode 
after it is merged, but before it is optimized.

> Xiaolong

Cheers,
Rafael



More information about the cfe-dev mailing list