[llvm-dev] Correctly linking against libLLVM (single shared library build)
Jiri Slaby via llvm-dev
llvm-dev at lists.llvm.org
Mon Nov 20 00:07:31 PST 2017
On 11/16/2017, 08:45 AM, Michal Srb wrote:
> On Thursday, 16 November 2017 08:34:50 CET Jiri Slaby wrote:
>> Actually it does not work at all. It behaves exactly the same as
>> map_components with this CMakeLists.txt:
>> llvm_config(bubak support core irreader)
> I think the llvm_config needs USE_SHARED parameter, something like:
> llvm_config(bubak USE_SHARED support core irreader)
> Otherwise it assumes you want to link with the static libraries.
> In our case we do not package the static libraries, so it would make sense if
> llvm_config defaulted to USE_SHARED - we could patch it to behave that way in
> our package.
That neither works for me, unfortunately:
-- Components mapped by llvm_config: LLVMSupport;LLVMCore;LLVMIRReader
So it's huge defunct mess :(. This all should be indeed handled by the
internals of llvm cmake files. And I believe this is exactly the reason
why klee by default invokes llvm-config *program* and not the
llvm-config (or other) cmake macro (one has to explicitly set
USE_CMAKE_FIND_PACKAGE_LLVM=ON to use the latter).
On the top of all that, trying to map the "native" component errors the
cmake process with:
CMake Error at /usr/lib64/cmake/llvm/LLVM-Config.cmake:126 (message):
Target X86 is not in the set of libraries.
Call Stack (most recent call first):
With or without USE_SHARED, with llvm_map_components_to_libnames or
This works, of course:
$ llvm-config --libnames native
More information about the llvm-dev