Skip to content

Commit 95c0cef

Browse files
committed
Build empty wrappers. This lets us compile hello world, but so far it
just returns 0.
1 parent 2ff67ed commit 95c0cef

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,6 @@ TEST_XFAILS_RUSTC := $(CONST_TAG_XFAILS) \
484484
mlist-cycle.rs \
485485
mlist.rs \
486486
mutable-alias-vec.rs \
487-
native2.rs \
488487
native-opaque-type.rs \
489488
obj-as.rs \
490489
obj-dtor.rs \

src/comp/middle/trans.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4829,6 +4829,11 @@ fn decl_native_fn_and_pair(@crate_ctxt cx,
48294829
let str s = cx.names.next("_rust_wrapper") + sep() + name;
48304830
let ValueRef wrapper_fn = decl_fastcall_fn(cx.llmod, s, wrapper_type);
48314831

4832+
// Build the wrapper.
4833+
auto fcx = new_fn_ctxt(cx, wrapper_fn);
4834+
auto bcx = new_top_block_ctxt(fcx);
4835+
bcx.build.RetVoid();
4836+
48324837
// Declare the global constant pair that points to it.
48334838
auto wrapper_pair_type = T_fn_pair(cx.tn, wrapper_type);
48344839
let str ps = cx.names.next("_rust_wrapper_pair") + sep() + name;

0 commit comments

Comments
 (0)