X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=CMakeLists.txt;h=f2b3d32614804741c3b761e9d1e931683c9595e4;hb=e9b30c72ada2e6ed950b820d61965c193d8b8fa6;hp=b4eac034ae79d69b3561ab685569aaab15023184;hpb=71926e73ba99c07a02671b9001197cedc06f8905;p=oota-llvm.git diff --git a/CMakeLists.txt b/CMakeLists.txt index b4eac034ae7..f2b3d326148 100644 --- a/CMakeLists.txt +++ b/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})