From 22eca31d98ce3e1bc5690799e669911e4d06a5aa Mon Sep 17 00:00:00 2001 From: Jeffrey Yasskin Date: Sun, 18 Jul 2010 07:35:25 +0800 Subject: Fix argv.rs under the LLVM compiler. The call to rust_start was assuming that all rust main() functions have the same signature, but the compiler doesn't actually canonicalize them. So instead just match the C signature of rust_start, and cast. --- src/boot/llvm/llfinal.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/boot/llvm/llfinal.ml') diff --git a/src/boot/llvm/llfinal.ml b/src/boot/llvm/llfinal.ml index fd65fa6b..7241d1ab 100644 --- a/src/boot/llvm/llfinal.ml +++ b/src/boot/llvm/llfinal.ml @@ -79,7 +79,8 @@ let finalize_module | Some fn -> fn in let rust_start = abi.Llabi.rust_start in - let rust_start_args = [| rust_main_fn; crate_ptr; argc; argv |] in + let rust_start_args = [| Llvm.const_ptrtoint rust_main_fn abi.Llabi.word_ty; + crate_ptr; argc; argv |] in ignore (Llvm.build_call rust_start rust_start_args "start_rust" main_builder); ignore (Llvm.build_ret (Llvm.const_int i32 0) main_builder) -- cgit v1.2.3