Skip to content

Commit

Permalink
Make the __morestack function available to the JIT memory manager und…
Browse files Browse the repository at this point in the history
…er 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

llvm-svn: 224993
  • Loading branch information
pcc committed Dec 30, 2014
1 parent 82fb8cb commit 06e8543
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions llvm/lib/ExecutionEngine/RTDyldMemoryManager.cpp
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 06e8543

Please sign in to comment.