summaryrefslogtreecommitdiff
path: root/lib/System/DynamicLibrary.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-08-17 15:42:43 +0000
committerChris Lattner <sabre@nondot.org>2010-08-17 15:42:43 +0000
commit6ccd0da0fe0186380c7ad9aa50128d3d3ab09794 (patch)
treeb368b29c7c0440e5c65fb57ebc6cbd50b6aa9808 /lib/System/DynamicLibrary.cpp
parent8466efc36f57ec24fc42f91d70d5a70f38690a48 (diff)
downloadllvm-6ccd0da0fe0186380c7ad9aa50128d3d3ab09794.tar.gz
llvm-6ccd0da0fe0186380c7ad9aa50128d3d3ab09794.tar.bz2
llvm-6ccd0da0fe0186380c7ad9aa50128d3d3ab09794.tar.xz
Fix failure of unittests/ExecutionEngine/JIT/MultiJITTest.cpp on
cygwin when built with ENABLE_SHARED=1. Patch by NAKAMURA Takumi! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/DynamicLibrary.cpp')
-rw-r--r--lib/System/DynamicLibrary.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/System/DynamicLibrary.cpp b/lib/System/DynamicLibrary.cpp
index 6f6890c06c..660db492d6 100644
--- a/lib/System/DynamicLibrary.cpp
+++ b/lib/System/DynamicLibrary.cpp
@@ -70,6 +70,12 @@ bool DynamicLibrary::LoadLibraryPermanently(const char *Filename,
if (ErrMsg) *ErrMsg = dlerror();
return true;
}
+#ifdef __CYGWIN__
+ // Cygwin searches symbols only in the main
+ // with the handle of dlopen(NULL, RTLD_GLOBAL).
+ if (Filename == NULL)
+ H = RTLD_DEFAULT;
+#endif
if (OpenedHandles == 0)
OpenedHandles = new std::vector<void *>();
OpenedHandles->push_back(H);