summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2014-12-30 22:52:33 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2014-12-30 22:52:33 +0000
commit64faca9b849cf34244d319e1d473dbdd6b8367b5 (patch)
tree0bf7460fc6be4fdb8d63574ff5e8250cc01daa82 /llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
parent6815094f9bda331e6e7905ea60269dfe384745b0 (diff)
downloadbcm5719-llvm-64faca9b849cf34244d319e1d473dbdd6b8367b5.tar.gz
bcm5719-llvm-64faca9b849cf34244d319e1d473dbdd6b8367b5.zip
RTDyldMemoryManager.cpp: Make the reference to __morestack weak.
This fixes the DSO build for now. Eventually we should develop some other mechanism to make this work correctly with DSOs. llvm-svn: 225014
Diffstat (limited to 'llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp b/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
index 975954b538a..2a5e4f83228 100644
--- a/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
+++ b/llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
@@ -13,6 +13,7 @@
#include "llvm/Config/config.h"
#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
+#include "llvm/Support/Compiler.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/ErrorHandling.h"
#include <cstdlib>
@@ -212,7 +213,7 @@ ARM_MATH_IMPORTS(ARM_MATH_DECL)
#if defined(__linux__) && defined(__GLIBC__) && \
(defined(__i386__) || defined(__x86_64__))
-extern "C" void __morestack();
+extern "C" LLVM_ATTRIBUTE_WEAK void __morestack();
#endif
uint64_t
@@ -241,7 +242,8 @@ RTDyldMemoryManager::getSymbolAddressInProcess(const std::string &Name) {
#if defined(__i386__) || defined(__x86_64__)
// __morestack lives in libgcc, a static library.
- if (Name == "__morestack") return (uint64_t)&__morestack;
+ if (&__morestack && Name == "__morestack")
+ return (uint64_t)&__morestack;
#endif
#endif // __linux__ && __GLIBC__
OpenPOWER on IntegriCloud