Skip to content

Commit d6ebd55

Browse files
z0w0brson
authored andcommitted
---
yaml --- r: 32304 b: refs/heads/dist-snap c: 795acb7 h: refs/heads/master v: v3
1 parent 4ce2063 commit d6ebd55

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
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 7993f4820995c9b26d73e8a58bb8f3c0e2e79d47
10+
refs/heads/dist-snap: 795acb73950adf632d1e3fb48ea6104b4d61f3cd
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/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/dist-snap/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)