From 7d099f9e6ad237061f34302b870e7b5c872d4d6c Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Tue, 30 Dec 2014 18:22:06 +0000 Subject: [PATCH] The __morestack function is only available on i386 and x86_64 architectures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224994 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ExecutionEngine/RTDyldMemoryManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ExecutionEngine/RTDyldMemoryManager.cpp b/lib/ExecutionEngine/RTDyldMemoryManager.cpp index 4c2f7977b76..975954b538a 100644 --- a/lib/ExecutionEngine/RTDyldMemoryManager.cpp +++ b/lib/ExecutionEngine/RTDyldMemoryManager.cpp @@ -210,7 +210,8 @@ ARM_MATH_IMPORTS(ARM_MATH_DECL) #undef ARM_MATH_DECL #endif -#if defined(__linux__) && defined(__GLIBC__) +#if defined(__linux__) && defined(__GLIBC__) && \ + (defined(__i386__) || defined(__x86_64__)) extern "C" void __morestack(); #endif @@ -238,8 +239,10 @@ RTDyldMemoryManager::getSymbolAddressInProcess(const std::string &Name) { if (Name == "atexit") return (uint64_t)&atexit; if (Name == "mknod") return (uint64_t)&mknod; +#if defined(__i386__) || defined(__x86_64__) // __morestack lives in libgcc, a static library. if (Name == "__morestack") return (uint64_t)&__morestack; +#endif #endif // __linux__ && __GLIBC__ // See ARM_MATH_IMPORTS definition for explanation -- 2.34.1