[llvm-dev] Linking tools against libLLVM.dylib and libclang.dylib

Evan Swick via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 2 08:02:12 PST 2015


Hello. I am trying to build LLVM and Clang for iOS. To save precious storage space, I would like to link all the tools against libLLVM.dylib and libclang.dylib, instead of using static libraries. I believe this is how Clang/LLVM is linked on Linux when BUILD_SHARED_LIBS is turned on.

I am able to compile libLLVM.dylib by turning on the LLVM_BUILD_LLVM_DYLIB CMake flag. However, the tools are still linked against static libraries.

When compiling with BUILD_SHARED_LIBS and LLVM_BUILD_LLVM_DYLIB turned on, the tools aren’t linked against libLLVM.dylib, but rather are linked against all of the individual dynamic libraries needed. Also, when building with these flags, libLLVM.dylib contains no symbols, and llvm-c-test fails to link.

Can the Clang & LLVM tools be linked against only libclang.dylib and libLLVM.dylib? Is it feasible for this to be done?


More information about the llvm-dev mailing list