LLVM Specific Information
Project types
Executables
The executables built with the default settings of an LLVM
with Clang project are native binaries and can be run and debugged as
such. However LLVM does also support building programs to LLVM bitcode,
which in turn can be run with lli
, which is the LLVM toolchain’s
interpreter/JIT compiler. Unfortunately programs run with lli
can not be
efficiently debugged, since the only (usable) debugging information that
you can get from them is the backtrace. You can, however, compile the
bitcode versions of your programs, if you wish (TODO: even though
running them from Eclipse doesn’t work at the moment).
Compiling to LLVM bitcode instead of object code
C/C++ source files are compiled to native object code by default. You can compile your source files to LLVM bitcode instead of object code by checking the Emit LLVM IR checkbox in the Project Properties dialog on the Properties → C/C++ Build → Settings → LLVM Clang → Optimization page.
Shared and static libraries
The shared and static libraries generated with LLVM plugin are (TODO: for now) only LLVM bitcode files linked into one file and therefore cannot be used with gcc unless compiled to object code first. These libraries can naturally be used when working with the LLVM toolchain and on the other hand llvm-ld can use libraries that are object code.