From 83a09f0b4f4d3cad8e45e30c41dc1ad0fc06b7b3 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Tue, 17 Aug 2010 16:19:18 +0000 Subject: When creating a JIT, try to load the program so that we can resolve symbols against it. This affects Windows. llvm-svn: 111240 --- llvm/lib/ExecutionEngine/JIT/JIT.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/lib') diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp index 677feb21e16..63125b79c8e 100644 --- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp +++ b/llvm/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; -- cgit v1.2.3