Skip to content

Commit f73decb

Browse files
z0w0brson
authored andcommitted
---
yaml --- r: 28220 b: refs/heads/try c: 795acb7 h: refs/heads/master v: v3
1 parent 6dab011 commit f73decb

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5-
refs/heads/try: 7993f4820995c9b26d73e8a58bb8f3c0e2e79d47
5+
refs/heads/try: 795acb73950adf632d1e3fb48ea6104b4d61f3cd
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df

branches/try/mk/rustllvm.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ RUSTLLVM_OBJS_OBJS_$(1) := $$(RUSTLLVM_OBJS_CS_$(1):rustllvm/%.cpp=rustllvm/$(1)
2323
ALL_OBJ_FILES += $$(RUSTLLVM_OBJS_OBJS_$(1))
2424

2525
rustllvm/$(1)/$(CFG_RUSTLLVM): $$(RUSTLLVM_OBJS_OBJS_$(1)) \
26+
rt/$(1)/arch/$$(HOST_$(1))/libmorestack.a \
2627
$$(MKFILE_DEPS) $$(RUSTLLVM_DEF_$(1))
2728
@$$(call E, link: $$@)
2829
$$(Q)$$(call CFG_LINK_C_$(1),$$@,$$(RUSTLLVM_OBJS_OBJS_$(1)) \
29-
$$(CFG_GCCISH_PRE_LIB_FLAGS) $$(LLVM_LIBS_$(1)) \
30+
$$(CFG_GCCISH_PRE_LIB_FLAGS) $$(LLVM_LIBS_$(1)) rt/$(1)/arch/$$(HOST_$(1))/libmorestack.a \
3031
$$(CFG_GCCISH_POST_LIB_FLAGS) \
3132
$$(LLVM_LDFLAGS_$(1)),$$(RUSTLLVM_DEF_$(1)),$$(CFG_RUSTLLVM))
3233

branches/try/src/rustllvm/RustWrapper.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
#include <unistd.h>
5050
#endif
5151

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+
5255
using namespace llvm;
5356

5457
static const char *LLVMRustError;
@@ -269,17 +272,12 @@ void *RustMCJITMemoryManager::getPointerToNamedFunction(const std::string &Name,
269272
if (Name == "mknod") return (void*)(intptr_t)&mknod;
270273
#endif
271274

275+
if (Name == "__morestack") return (void*)(intptr_t)&__morestack;
276+
272277
const char *NameStr = Name.c_str();
273278
void *Ptr = sys::DynamicLibrary::SearchForAddressOfSymbol(NameStr);
274279
if (Ptr) return Ptr;
275280

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-
283281
if (AbortOnFailure)
284282
report_fatal_error("Program used external function '" + Name +
285283
"' which could not be resolved!");
@@ -309,8 +307,8 @@ LLVMRustPrepareJIT(LLVMPassManagerRef PMR,
309307
std::string Err;
310308
TargetOptions Options;
311309
Options.JITEmitDebugInfo = true;
312-
//Options.NoFramePointerElim = true;
313-
//Options.EnableSegmentedStacks = EnableSegmentedStacks;
310+
Options.NoFramePointerElim = true;
311+
Options.EnableSegmentedStacks = EnableSegmentedStacks;
314312

315313
unwrap<PassManager>(PMR)->run(*unwrap(M));
316314

0 commit comments

Comments
 (0)