diff options
| author | Jeffrey Yasskin <[email protected]> | 2010-07-18 07:35:25 +0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-07-18 14:25:19 +0800 |
| commit | 22eca31d98ce3e1bc5690799e669911e4d06a5aa (patch) | |
| tree | c964fb3ca34ec34f4b9685d711c5097f7c7d0a22 /src/boot/llvm/llfinal.ml | |
| parent | Fix the LLVM ocamlopt build. (diff) | |
| download | rust-22eca31d98ce3e1bc5690799e669911e4d06a5aa.tar.xz rust-22eca31d98ce3e1bc5690799e669911e4d06a5aa.zip | |
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.
Diffstat (limited to 'src/boot/llvm/llfinal.ml')
| -rw-r--r-- | src/boot/llvm/llfinal.ml | 3 |
1 files changed, 2 insertions, 1 deletions
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) |