From Axel and me: Add new patch which we will apply to our vendor drop.

The ROOT autoloading works at two different levels:
  L1 - on missing declaration that Sema expects.
  L2 - on missing library symbol.

  If there is a missing library function it the LLVM JIT will inform us through
its lazy function creator. However, for the purpose of the autoloading we need to
react not only to missing functions but to missing any symbols. Thus we need to
enhance the non-function symbol search to fire the lazy function creator callback.
Note this is a gross hack, we should come up with a more elegant way of solving 
this.


git-svn-id: http://root.cern.ch/svn/root/trunk@49355 27541ba8-7e3a-0410-8455-c3a389f83636
This commit is contained in:
Vassil Vassilev 2013-04-25 16:42:12 +00:00
parent eed7249efd
commit 896a4b3f76

View File

@ -0,0 +1,20 @@
Index: interpreter/llvm/src/lib/ExecutionEngine/JIT/JIT.cpp
===================================================================
--- interpreter/llvm/src/lib/ExecutionEngine/JIT/JIT.cpp (revision 49336)
+++ interpreter/llvm/src/lib/ExecutionEngine/JIT/JIT.cpp (working copy)
@@ -757,9 +757,14 @@
return (void*)&__dso_handle;
#endif
Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(GV->getName());
+
+ // FIXME: Not a lazy function; don't tell anyone...
+ if (!Ptr && LazyFunctionCreator)
+ Ptr = LazyFunctionCreator(GV->getName());
+
if (Ptr == 0) {
report_fatal_error("Could not resolve external global address: "
- +GV->getName());
+ +GV->getName());
}
addGlobalMapping(GV, Ptr);
} else {