Skip to content

Commit 4ce2063

Browse files
z0w0brson
authored andcommitted
---
yaml --- r: 32303 b: refs/heads/dist-snap c: 7993f48 h: refs/heads/master i: 32301: 0095744 32299: d31f02a 32295: bbe93ff 32287: 6cd4b08 v: v3
1 parent 28afb79 commit 4ce2063

File tree

6 files changed

+276
-185
lines changed

6 files changed

+276
-185
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: d7aa9918ef1673edcef261da41075203de5b15b3
10+
refs/heads/dist-snap: 7993f4820995c9b26d73e8a58bb8f3c0e2e79d47
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/mk/libuv/ia32/win/src/libuv/uv.target.mk.bak

Lines changed: 0 additions & 167 deletions
This file was deleted.

branches/dist-snap/src/rustc/back/link.rs

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,37 @@ mod write {
160160
llvm::LLVMAddCFGSimplificationPass(pm.llpm);*/
161161

162162
// JIT execution takes ownership of the module,
163-
// so don't dispose and return.
163+
// so don't dispose and return. Due to a weird bug
164+
// with dynamic libraries, we need to separate jitting
165+
// into two functions and load crates inbetween.
166+
167+
if !llvm::LLVMRustPrepareJIT(pm.llpm,
168+
llmod,
169+
CodeGenOptLevel,
170+
true) {
171+
llvm_err(sess, ~"Could not JIT");
172+
}
173+
174+
// We need to tell LLVM where to resolve all linked
175+
// symbols from. The equivalent of -lstd, -lcore, etc.
176+
/*let cstore = sess.cstore;
177+
for cstore::get_used_crate_files(cstore).each |cratepath| {
178+
debug!{"linking: %s", cratepath};
179+
180+
let _: () = str::as_c_str(
181+
cratepath,
182+
|buf_t| {
183+
if !llvm::LLVMRustLoadLibrary(buf_t) {
184+
llvm_err(sess, ~"Could not link");
185+
}
186+
debug!{"linked: %s", cratepath};
187+
});
188+
}*/
164189

165-
if !llvm::LLVMRustJIT(pm.llpm,
166-
llmod,
167-
CodeGenOptLevel,
168-
true) {
190+
if !llvm::LLVMRustExecuteJIT() {
169191
llvm_err(sess, ~"Could not JIT");
170192
}
193+
171194
if sess.time_llvm_passes() { llvm::LLVMRustPrintPassTimings(); }
172195
return;
173196
}

branches/dist-snap/src/rustc/lib/llvm.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,12 +986,18 @@ extern mod llvm {
986986
call. */
987987
fn LLVMRustGetLastError() -> *c_char;
988988

989-
/** JIT the module. **/
990-
fn LLVMRustJIT(PM: PassManagerRef,
989+
/** Load a shared library to resolve symbols against. */
990+
fn LLVMRustLoadLibrary(Filename: *c_char) -> bool;
991+
992+
/** Create the JIT engine. */
993+
fn LLVMRustPrepareJIT(PM: PassManagerRef,
991994
M: ModuleRef,
992995
OptLevel: c_int,
993996
EnableSegmentedStacks: bool) -> bool;
994997

998+
/** Execute the JIT engine. */
999+
fn LLVMRustExecuteJIT() -> bool;
1000+
9951001
/** Parses the bitcode in the given memory buffer. */
9961002
fn LLVMRustParseBitcode(MemBuf: MemoryBufferRef) -> ModuleRef;
9971003

0 commit comments

Comments
 (0)