llvm build shared libs
by walecha from LinuxQuestions.org on (#5T4YA)
llvm.SlackBuild is using -DBUILD_SHARED_LIBS=ON to build llvm shared libs. But that is not the recommended way to build llvm shared libs
Quote:
The docs said to use DYLIB:
Quote:
So maybe switching BUILD_SHARED_LIBS with these options can do the job?
Code:-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \Any special reason to build llvm with BUILD_SHARED_LIBS=ON?
Quote:
One very important note: Distributions should never be built using the BUILD_SHARED_LIBS CMake option. That option exists for optimizing developer workflow only. Due to design and implementation decisions, LLVM relies on global data which can end up being duplicated across shared libraries resulting in bugs. As such this is not a safe way to distribute LLVM or LLVM-based tools. |
Quote:
One of the most powerful features of LLVM is its library-first design mentality and the way you can compose a wide variety of tools using different portions of LLVM. Even in this situation using BUILD_SHARED_LIBS is not supported. If you want to distribute LLVM as a shared library for use in a tool, the recommended method is using LLVM_BUILD_LLVM_DYLIB, and you can use LLVM_DYLIB_COMPONENTS to configure which LLVM components are part of libLLVM. Note: LLVM_BUILD_LLVM_DYLIB is not available on Windows. |
Code:-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \Any special reason to build llvm with BUILD_SHARED_LIBS=ON?