diff options
author | Douglas Gregor <doug.gregor@gmail.com> | 2009-12-23 19:04:10 +0000 |
---|---|---|
committer | Douglas Gregor <doug.gregor@gmail.com> | 2009-12-23 19:04:10 +0000 |
commit | da09e58b4b9838e81f781dae2ebcc7e7639ec3c5 (patch) | |
tree | fe3a49726f467e2fbfd6ee84a9090541354e6969 /lib/System/DynamicLibrary.cpp | |
parent | 16cd8cdb95d1de94593c0b7913a56a37ae4a8b6e (diff) | |
download | external_llvm-da09e58b4b9838e81f781dae2ebcc7e7639ec3c5.zip external_llvm-da09e58b4b9838e81f781dae2ebcc7e7639ec3c5.tar.gz external_llvm-da09e58b4b9838e81f781dae2ebcc7e7639ec3c5.tar.bz2 |
Revert 92020 until I figure out a more portable fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/DynamicLibrary.cpp')
-rw-r--r-- | lib/System/DynamicLibrary.cpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/lib/System/DynamicLibrary.cpp b/lib/System/DynamicLibrary.cpp index b511a3c..7eb9f5f 100644 --- a/lib/System/DynamicLibrary.cpp +++ b/lib/System/DynamicLibrary.cpp @@ -69,10 +69,6 @@ bool DynamicLibrary::LoadLibraryPermanently(const char *Filename, return false; } -#define EXPLICIT_SYMBOL(SYM) \ - extern "C" void *SYM; -#include "DynamicLibrarySymbolDefs.def" - void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) { // First check symbols added via AddSymbol(). if (ExplicitSymbols) { @@ -97,15 +93,41 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) { } #define EXPLICIT_SYMBOL(SYM) \ - if (!strcmp(symbolName, #SYM)) return &SYM; + extern void *SYM; if (!strcmp(symbolName, #SYM)) return &SYM // If this is darwin, it has some funky issues, try to solve them here. Some // important symbols are marked 'private external' which doesn't allow // SearchForAddressOfSymbol to find them. As such, we special case them here, // there is only a small handful of them. + +#ifdef __APPLE__ + { + EXPLICIT_SYMBOL(__ashldi3); + EXPLICIT_SYMBOL(__ashrdi3); + EXPLICIT_SYMBOL(__cmpdi2); + EXPLICIT_SYMBOL(__divdi3); + EXPLICIT_SYMBOL(__eprintf); + EXPLICIT_SYMBOL(__fixdfdi); + EXPLICIT_SYMBOL(__fixsfdi); + EXPLICIT_SYMBOL(__fixunsdfdi); + EXPLICIT_SYMBOL(__fixunssfdi); + EXPLICIT_SYMBOL(__floatdidf); + EXPLICIT_SYMBOL(__floatdisf); + EXPLICIT_SYMBOL(__lshrdi3); + EXPLICIT_SYMBOL(__moddi3); + EXPLICIT_SYMBOL(__udivdi3); + EXPLICIT_SYMBOL(__umoddi3); + } +#endif + +#ifdef __CYGWIN__ { -#include "DynamicLibrarySymbolDefs.def" + EXPLICIT_SYMBOL(_alloca); + EXPLICIT_SYMBOL(__main); } +#endif + +#undef EXPLICIT_SYMBOL // This macro returns the address of a well-known, explicit symbol #define EXPLICIT_SYMBOL(SYM) \ |