|
49 | 49 | #include <unistd.h>
|
50 | 50 | #endif
|
51 | 51 |
|
| 52 | +// Does this need to be done, or can it be made to resolve from the main program? |
| 53 | +extern "C" void __morestack(void *args, void *fn_ptr, uintptr_t stack_ptr); |
| 54 | + |
52 | 55 | using namespace llvm;
|
53 | 56 |
|
54 | 57 | static const char *LLVMRustError;
|
@@ -269,17 +272,12 @@ void *RustMCJITMemoryManager::getPointerToNamedFunction(const std::string &Name,
|
269 | 272 | if (Name == "mknod") return (void*)(intptr_t)&mknod;
|
270 | 273 | #endif
|
271 | 274 |
|
| 275 | + if (Name == "__morestack") return (void*)(intptr_t)&__morestack; |
| 276 | + |
272 | 277 | const char *NameStr = Name.c_str();
|
273 | 278 | void *Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr);
|
274 | 279 | if (Ptr) return Ptr;
|
275 | 280 |
|
276 |
| - // If it wasn't found and if it starts with an underscore ('_') character, |
277 |
| - // try again without the underscore. |
278 |
| - if (NameStr[0] == '_') { |
279 |
| - Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr+1); |
280 |
| - if (Ptr) return Ptr; |
281 |
| - } |
282 |
| - |
283 | 281 | if (AbortOnFailure)
|
284 | 282 | report_fatal_error("Program used external function '" + Name +
|
285 | 283 | "' which could not be resolved!");
|
@@ -309,8 +307,8 @@ LLVMRustPrepareJIT(LLVMPassManagerRef PMR,
|
309 | 307 | std::string Err;
|
310 | 308 | TargetOptions Options;
|
311 | 309 | Options.JITEmitDebugInfo = true;
|
312 |
| - //Options.NoFramePointerElim = true; |
313 |
| - //Options.EnableSegmentedStacks = EnableSegmentedStacks; |
| 310 | + Options.NoFramePointerElim = true; |
| 311 | + Options.EnableSegmentedStacks = EnableSegmentedStacks; |
314 | 312 |
|
315 | 313 | unwrap<PassManager>(PMR)->run(*unwrap(M));
|
316 | 314 |
|
|
0 commit comments