diff options
author | Chris Lattner <sabre@nondot.org> | 2007-11-27 20:41:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-11-27 20:41:32 +0000 |
commit | fffd0ae2f19b967a9a4da0e966d1cc5434ce6700 (patch) | |
tree | 5346b6cebf6c98f0db048ba492cc6abd63bf314c /llvm/lib/ExecutionEngine | |
parent | 14d5f741abb81349cc8161357fb951a468327883 (diff) | |
download | bcm5719-llvm-fffd0ae2f19b967a9a4da0e966d1cc5434ce6700.tar.gz bcm5719-llvm-fffd0ae2f19b967a9a4da0e966d1cc5434ce6700.zip |
Unbreak all of the darwin/ppc32 JIT failures having to do
with not being able to find printf.
llvm-svn: 44373
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r-- | llvm/lib/ExecutionEngine/JIT/Intercept.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/Intercept.cpp b/llvm/lib/ExecutionEngine/JIT/Intercept.cpp index 318d6067d6c..6d5e7da772f 100644 --- a/llvm/lib/ExecutionEngine/JIT/Intercept.cpp +++ b/llvm/lib/ExecutionEngine/JIT/Intercept.cpp @@ -102,6 +102,16 @@ void *JIT::getPointerToNamedFunction(const std::string &Name) { 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)) |