diff --git a/example/alloc_example.rs b/example/alloc_example.rs index 20a8642cbd1..f75103c76a5 100644 --- a/example/alloc_example.rs +++ b/example/alloc_example.rs @@ -13,7 +13,7 @@ #[link(name = "c")] extern "C" { - fn puts(s: *const u8); + fn puts(s: *const u8) -> i32; } #[panic_handler] diff --git a/example/mini_core.rs b/example/mini_core.rs index 5311d84e72a..0c95ac6772a 100644 --- a/example/mini_core.rs +++ b/example/mini_core.rs @@ -488,7 +488,7 @@ pub mod intrinsics { pub mod libc { #[link(name = "c")] extern "C" { - pub fn puts(s: *const u8); + pub fn puts(s: *const u8) -> i32; pub fn printf(format: *const i8, ...) -> i32; pub fn malloc(size: usize) -> *mut u8; pub fn free(ptr: *mut u8); diff --git a/src/trap.rs b/src/trap.rs index 86af1ee5381..2b437a0f769 100644 --- a/src/trap.rs +++ b/src/trap.rs @@ -12,7 +12,7 @@ fn codegen_print(fx: &mut FunctionCx<'_, '_, impl cranelift_module::Backend>, ms &Signature { call_conv: CallConv::triple_default(fx.triple()), params: vec![AbiParam::new(pointer_ty(fx.tcx))], - returns: vec![], + returns: vec![AbiParam::new(types::I32)], }, ) .unwrap();