summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/CMakeLists.txt10
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake16
2 files changed, 11 insertions, 15 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index b4eac034ae7..f2b3d326148 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -469,6 +469,16 @@ else(UNIX)
endif(NOT DEFINED CMAKE_INSTALL_RPATH)
endif()
+# Work around a broken bfd ld behavior. When linking a binary with a
+# foo.so library, it will try to find any library that foo.so uses and
+# check its symbols. This is wasteful (the check was done when foo.so
+# was created) and can fail since it is not the dynamic linker and
+# doesn't know how to handle search paths correctly.
+if (UNIX AND NOT APPLE)
+ set(CMAKE_EXE_LINKER_FLAGS
+ "${CMAKE_EXE_LINKER_FLAGS} -Wl,-allow-shlib-undefined")
+endif()
+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories( ${LLVM_INCLUDE_DIR} ${LLVM_MAIN_INCLUDE_DIR})
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 198393dc507..15ce6243ad5 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -359,22 +359,8 @@ function(llvm_add_library name)
${lib_deps}
${llvm_libs}
)
- elseif((CYGWIN OR WIN32) AND ARG_SHARED)
- # Win32's import library may be unaware of its dependent libs.
- target_link_libraries(${name} PRIVATE
- ${ARG_LINK_LIBS}
- ${lib_deps}
- ${llvm_libs}
- )
- elseif(ARG_SHARED AND BUILD_SHARED_LIBS)
- # FIXME: It may be PRIVATE since SO knows its dependent libs.
- target_link_libraries(${name} PUBLIC
- ${ARG_LINK_LIBS}
- ${lib_deps}
- ${llvm_libs}
- )
else()
- # MODULE|SHARED
+ # We can use PRIVATE since SO knows its dependent libs.
target_link_libraries(${name} PRIVATE
${ARG_LINK_LIBS}
${lib_deps}
OpenPOWER on IntegriCloud