diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index 677feb21e16..63125b79c8e 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -219,6 +219,9 @@ ExecutionEngine *JIT::createJIT(Module *M, StringRef MArch, StringRef MCPU, const SmallVectorImpl& MAttrs) { + // Try to register the program as a source of symbols to resolve against. + sys::DynamicLibrary::LoadLibraryPermanently(0, NULL); + // Pick a target either via -march or by guessing the native arch. TargetMachine *TM = JIT::selectTarget(M, MArch, MCPU, MAttrs, ErrorStr); if (!TM || (ErrorStr && ErrorStr->length() > 0)) return 0;