summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/DynamicLibrary.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-12-03 05:30:41 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-12-03 05:30:41 +0000
commit9050bd1f687d04742ca54bb2541197c0c905934f (patch)
tree796c4cbc9935aa2836aee5b6acb55d33ce1b9d8d /llvm/lib/System/DynamicLibrary.cpp
parent9746782cea5ae75d4b404f04a2f0abffa2a0d091 (diff)
downloadbcm5719-llvm-9050bd1f687d04742ca54bb2541197c0c905934f.tar.gz
bcm5719-llvm-9050bd1f687d04742ca54bb2541197c0c905934f.zip
Provide hook for _alloca to make JITing on Cygwin slightly happier :)
llvm-svn: 44528
Diffstat (limited to 'llvm/lib/System/DynamicLibrary.cpp')
-rw-r--r--llvm/lib/System/DynamicLibrary.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/lib/System/DynamicLibrary.cpp b/llvm/lib/System/DynamicLibrary.cpp
index b06f6b08be9..0a8ac59dc27 100644
--- a/llvm/lib/System/DynamicLibrary.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud