diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-12-03 05:30:41 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-12-03 05:30:41 +0000 |
commit | 96ea209b52c4f23c41d3202e5d345ad0187c1c18 (patch) | |
tree | a59f214b1f76778d3988eeef0db7d25818096241 /lib/System/DynamicLibrary.cpp | |
parent | 64270d5d4638dbda271d7ccb945ebbb34e9ab572 (diff) |
Provide hook for _alloca to make JITing on Cygwin slightly happier :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44528 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/DynamicLibrary.cpp')
-rw-r--r-- | lib/System/DynamicLibrary.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/System/DynamicLibrary.cpp b/lib/System/DynamicLibrary.cpp index b06f6b08be..0a8ac59dc2 100644 --- a/lib/System/DynamicLibrary.cpp +++ b/lib/System/DynamicLibrary.cpp @@ -138,14 +138,15 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) { return ptr; } +#define EXPLICIT_SYMBOL(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__ -#define EXPLICIT_SYMBOL(SYM) \ - extern void *SYM; if (!strcmp(symbolName, #SYM)) return &SYM { EXPLICIT_SYMBOL(__ashldi3); EXPLICIT_SYMBOL(__ashrdi3); @@ -163,9 +164,16 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) { EXPLICIT_SYMBOL(__udivdi3); EXPLICIT_SYMBOL(__umoddi3); } -#undef EXPLICIT_SYMBOL #endif +#ifdef __CYGWIN__ + { + EXPLICIT_SYMBOL(_alloca); + } +#endif + +#undef EXPLICIT_SYMBOL + // This macro returns the address of a well-known, explicit symbol #define EXPLICIT_SYMBOL(SYM) \ if (!strcmp(symbolName, #SYM)) return &SYM |