aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/ExecutionEngine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r--lib/ExecutionEngine/ExecutionEngine.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp
index 74a3c867ed..5faa2e7f64 100644
--- a/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -359,14 +359,13 @@ void ExecutionEngine::emitGlobals() {
DEBUG(std::cerr << "Global '" << I->getName() << "' -> "
<< (void*)GlobalAddress[I] << "\n");
} else {
- // External variable reference, try to use dlsym to get a pointer to it in
- // the LLI image.
-#if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
- // RTLD_SELF is already defined and it's not zero
-#else
+ // On Sparc, RTLD_SELF is already defined and it's not zero
// Linux/x86 wants to use a 0, other systems may differ
+#ifndef RTLD_SELF
#define RTLD_SELF 0
#endif
+ // External variable reference, try to use dlsym to get a pointer to it in
+ // the LLI image.
if (void *SymAddr = dlsym(RTLD_SELF, I->getName().c_str()))
GlobalAddress[I] = SymAddr;
else {