klee / klee

KLEE Symbolic Execution Engine

Home Page:https://klee-se.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[CMake] Building against dynamic LLVM system builds fails.

MartinNowack opened this issue · comments

More details here:

#1477 (comment)

Yes, this breaks on openSUSE:

: && /var/lib/build/ccache/bin/clang++ -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronou
s-unwind-tables -fstack-clash-protection -Werror=return-type -flto=thin -g -O2 -g -DNDEBUG -flto=thin -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now to
ols/ktest-randgen/CMakeFiles/ktest-randgen.dir/ktest-randgen.cpp.o -o bin/ktest-randgen  lib/libkleeBasic.a  -lLLVMSupport && :
 /usr/bin/ld: cannot find -lLLVMSupport: No such file or directory

If it helps I use in one of my (abandoned) projects:

set(USE_MAP FALSE)
if (TARGET LLVMSupport)
        get_target_property(LLVMSupport_TYPE LLVMSupport TYPE)
        if (LLVMSupport STREQUAL SHARED_LIBRARY)
                set(USE_MAP TRUE)
        endif()
endif()
if (USE_MAP)
        llvm_map_components_to_libnames(llvm_libs support core)
else()
        set(llvm_libs LLVM)
endif()
message(STATUS "Mapped LLVM libs: ${llvm_libs}")

https://github.com/jirislaby/stansec/blob/83e08034f2a6a900cc1e2257df88e3f7f7e05d56/src/parser/CMakeLists.txt#L19-L31

And that works for me:
jirislaby@af721cd

Fixed with #1588