[llvm-commits] [llvm] r44373 - /llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp
Chris Lattner
sabre at nondot.org
Tue Nov 27 12:41:32 PST 2007
Author: lattner
Date: Tue Nov 27 14:41:32 2007
New Revision: 44373
URL: http://llvm.org/viewvc/llvm-project?rev=44373&view=rev
Log:
Unbreak all of the darwin/ppc32 JIT failures having to do
with not being able to find printf.
Modified:
llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp
Modified: llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp?rev=44373&r1=44372&r2=44373&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JIT/Intercept.cpp Tue Nov 27 14:41:32 2007
@@ -102,6 +102,16 @@
if (Ptr) return Ptr;
}
+ // darwin/ppc adds $LDBLStub suffixes to various symbols like printf. These
+ // are references to hidden visibility symbols that dlsym cannot resolve. If
+ // we have one of these, strip off $LDBLStub and try again.
+#if defined(__APPLE__) && defined(__ppc__)
+ if (Name.size() > 9 && Name[Name.size()-9] == '$' &&
+ memcmp(&Name[Name.size()-8], "LDBLStub", 8) == 0)
+ return getPointerToNamedFunction(std::string(Name.begin(),
+ Name.end()-9));
+#endif
+
/// If a LazyFunctionCreator is installed, use it to get/create the function.
if (LazyFunctionCreator)
if (void *RP = LazyFunctionCreator(Name))
More information about the llvm-commits
mailing list