Fix failure of unittests/ExecutionEngine/JIT/MultiJITTest.cpp on

cygwin when built with ENABLE_SHARED=1.  Patch by NAKAMURA Takumi!

llvm-svn: 111231
This commit is contained in:
Chris Lattner 2010-08-17 15:42:43 +00:00
parent b13847aeca
commit 2c76ae54e5
1 changed files with 6 additions and 0 deletions

View File

@ -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);