Commit 8f71f731 by Ben Clayton Committed by Chris Forbes

Fix linux link error when using LLVM reactor backend.

Seen building on Ubuntu 18.04.1: ``` libllvm.a(DynamicLibrary.cpp.o): In function `llvm::sys::DynamicLibrary::HandleSet::~HandleSet()': DynamicLibrary.cpp:(.text._ZN4llvm3sys14DynamicLibrary9HandleSetD2Ev+0x1c): undefined reference to `dlclose' DynamicLibrary.cpp:(.text._ZN4llvm3sys14DynamicLibrary9HandleSetD2Ev+0x2c): undefined reference to `dlclose' libllvm.a(DynamicLibrary.cpp.o): In function `llvm::sys::DynamicLibrary::HandleSet::DLSym(void*, char const*)': DynamicLibrary.cpp:(.text._ZN4llvm3sys14DynamicLibrary9HandleSet5DLSymEPvPKc+0x1): undefined reference to `dlsym' ``` Also removes --no-as-needed hack. Bug: b/123360006 Change-Id: Icef1078e68cbf68af991e52f7fbb6e8d449e0809 Reviewed-on: https://swiftshader-review.googlesource.com/c/24310Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 049ff387
......@@ -156,11 +156,6 @@ macro(set_shared_library_export_map TARGET DIR)
if(NOT MSAN AND NOT ASAN AND NOT TSAN AND NOT UBSAN)
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--no-undefined")
endif()
# Older version of GCC have problem linking libdl when --as-needed is set.
if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set_property(TARGET ${TARGET} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--no-as-needed")
endif()
endif()
endmacro()
......@@ -1744,6 +1739,11 @@ set_target_properties(llvm PROPERTIES
FOLDER "LLVM"
)
# Add required libraries for LLVM
if(LINUX)
target_link_libraries(llvm dl)
endif(LINUX)
###########################################################
# Subzero
###########################################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment