I have a C++ project that uses a C++ library that I also wrote. I\'m using clang++ 3.3 to build everything. Each file in the library is compiled as
clang++ -c -O
EDIT: It is actually ar which makes it work.
Bit late but still might be relevant to someone, we use ar
and ld.gold
with LLVM plugin to link bitcode:
ar r --plugin /usr/lib64/llvm/LLVMgold.so library.a
ld.gold --plugin /usr/lib64/llvm/LLVMgold.so -plugin-opt emit-llvm main.bc library.a
Of course the path to LLVMgold.so might be different. This way resulting .bc has just needed symbols.