From 8919b82605680cd2b9af1fffb555cdbeb66c71bd Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 30 Dec 2014 18:06:52 +0000 Subject: [PATCH] Make the __morestack function available to the JIT memory manager under Linux. This function's implementation lives in libgcc, a static library, so we need to expose it explicitly, like the other such functions. Differential Revision: http://reviews.llvm.org/D6788 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224993 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/RTDyldMemoryManager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ExecutionEngine/RTDyldMemoryManager.cpp b/lib/ExecutionEngine/RTDyldMemoryManager.cpp index 51b2d0faab8..4c2f7977b76 100644 --- a/lib/ExecutionEngine/RTDyldMemoryManager.cpp +++ b/lib/ExecutionEngine/RTDyldMemoryManager.cpp @@ -210,6 +210,10 @@ ARM_MATH_IMPORTS(ARM_MATH_DECL) #undef ARM_MATH_DECL #endif +#if defined(__linux__) && defined(__GLIBC__) +extern "C" void __morestack(); +#endif + uint64_t RTDyldMemoryManager::getSymbolAddressInProcess(const std::string &Name) { // This implementation assumes that the host program is the target. @@ -233,6 +237,9 @@ RTDyldMemoryManager::getSymbolAddressInProcess(const std::string &Name) { if (Name == "lstat64") return (uint64_t)&lstat64; if (Name == "atexit") return (uint64_t)&atexit; if (Name == "mknod") return (uint64_t)&mknod; + + // __morestack lives in libgcc, a static library. + if (Name == "__morestack") return (uint64_t)&__morestack; #endif // __linux__ && __GLIBC__ // See ARM_MATH_IMPORTS definition for explanation -- 2.34.1