summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/DynamicLibrary.cpp
diff options
context:
space:
mode:
authorJeffrey Yasskin <jyasskin@google.com>2010-03-11 06:14:32 +0000
committerJeffrey Yasskin <jyasskin@google.com>2010-03-11 06:14:32 +0000
commit0069d72c053accc3e3c1713f6faa8ee6e9ee135e (patch)
tree90fe5874f810c6268195fbc8d7569f59005e9f26 /llvm/lib/System/DynamicLibrary.cpp
parent9f28dbc53ac9829d2cc6ccc731717ab5b415cbc2 (diff)
downloadbcm5719-llvm-0069d72c053accc3e3c1713f6faa8ee6e9ee135e.tar.gz
bcm5719-llvm-0069d72c053accc3e3c1713f6faa8ee6e9ee135e.zip
Make clang bootstrap happier on OSX 10.5 by reducing the number of headers
included when using global symbols to ask the linker for the addresses of various functions. One of the symbols was actually getting declared by a header included in DynamicLibrary.cpp, which conflicted with the "extern void*" declaration in SearchForAddressOfSpecialSymbol(). llvm-svn: 98243
Diffstat (limited to 'llvm/lib/System/DynamicLibrary.cpp')
-rw-r--r--llvm/lib/System/DynamicLibrary.cpp42
1 files changed, 3 insertions, 39 deletions
diff --git a/llvm/lib/System/DynamicLibrary.cpp b/llvm/lib/System/DynamicLibrary.cpp
index 63baa6d787c..d6f3140a88e 100644
--- a/llvm/lib/System/DynamicLibrary.cpp
+++ b/llvm/lib/System/DynamicLibrary.cpp
@@ -69,44 +69,8 @@ bool DynamicLibrary::LoadLibraryPermanently(const char *Filename,
return false;
}
-static void *SearchForAddressOfSpecialSymbol(const char* symbolName) {
-#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__
- {
- 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__
- {
- EXPLICIT_SYMBOL(_alloca);
- EXPLICIT_SYMBOL(__main);
- }
-#endif
-
-#undef EXPLICIT_SYMBOL
- return 0;
+namespace llvm {
+void *SearchForAddressOfSpecialSymbol(const char* symbolName);
}
void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) {
@@ -132,7 +96,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char* symbolName) {
}
}
- if (void *Result = SearchForAddressOfSpecialSymbol(symbolName))
+ if (void *Result = llvm::SearchForAddressOfSpecialSymbol(symbolName))
return Result;
// This macro returns the address of a well-known, explicit symbol
OpenPOWER on IntegriCloud