Creating and using LLVM bitcode libraries

后端 未结 1 2010
[愿得一人]
[愿得一人] 2021-02-14 04:10

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         


        
1条回答
  •  独厮守ぢ
    2021-02-14 04:47

    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.

    0 讨论(0)
提交回复
热议问题