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 | 5370e6291fcda1a7a90bf3ee51350f6b41b56180 (patch) | |
| tree | f87ccac1718f87529682050960828eafdb89d306 /lib | |
| parent | a887b22898359143c97df8f17df8fd6012286da4 (diff) | |
| download | external_llvm-5370e6291fcda1a7a90bf3ee51350f6b41b56180.zip external_llvm-5370e6291fcda1a7a90bf3ee51350f6b41b56180.tar.gz external_llvm-5370e6291fcda1a7a90bf3ee51350f6b41b56180.tar.bz2 | |
Unbreak all of the darwin/ppc32 JIT failures having to do
with not being able to find printf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ExecutionEngine/JIT/Intercept.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/JIT/Intercept.cpp b/lib/ExecutionEngine/JIT/Intercept.cpp index 318d606..6d5e7da 100644 --- a/lib/ExecutionEngine/JIT/Intercept.cpp +++ b/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)) |
