summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Roelofs <jonathan@codesourcery.com>2014-08-18 23:43:43 +0000
committerJonathan Roelofs <jonathan@codesourcery.com>2014-08-18 23:43:43 +0000
commitd223dfd1b8eb60edeac5050633460cd27e49ab25 (patch)
treebf621565fe1b4edf5f8dcda0081a6c03a342245d
parent95272d2edab0f503e440d1425721161c122dadc6 (diff)
libcxxabi must link to dl if using bundled unwind
Patch by Ismail Donmez http://reviews.llvm.org/D4953 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@215950 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--cmake/config-ix.cmake1
-rw-r--r--src/Unwind/CMakeLists.txt1
2 files changed, 2 insertions, 0 deletions
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index bf444fb..cbf5c78 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -35,5 +35,6 @@ check_cxx_compiler_flag(/GR- LIBCXXABI_HAS_NO_GR_FLAG)
# Check libraries
check_library_exists(c printf "" LIBCXXABI_HAS_C_LIB)
+check_library_exists(dl dladdr "" LIBCXXABI_HAS_DL_LIB)
check_library_exists(pthread pthread_once "" LIBCXXABI_HAS_PTHREAD_LIB)
check_library_exists(gcc_eh _Unwind_GetRegionStart "" LIBCXXABI_HAS_GCC_EH_LIB)
diff --git a/src/Unwind/CMakeLists.txt b/src/Unwind/CMakeLists.txt
index cc53ff5..ff22e7f 100644
--- a/src/Unwind/CMakeLists.txt
+++ b/src/Unwind/CMakeLists.txt
@@ -59,6 +59,7 @@ include_directories("${LIBCXXABI_LIBCXX_INCLUDES}")
# Generate library list.
set(libraries ${LIBCXXABI_CXX_ABI_LIBRARIES})
append_if(libraries LIBCXXABI_HAS_C_LIB c)
+append_if(libraries LIBCXXABI_HAS_DL_LIB dl)
append_if(libraries LIBCXXABI_HAS_PTHREAD_LIB pthread)
target_link_libraries(unwind ${libraries})