From a460c5b32744292ed50922a159fa22c830aa61b9 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Sun, 7 Apr 2019 00:52:17 +0800 Subject: [PATCH] Fix mips rust programs --- rust/src/lang_items.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rust/src/lang_items.rs b/rust/src/lang_items.rs index 67624ad..878a046 100644 --- a/rust/src/lang_items.rs +++ b/rust/src/lang_items.rs @@ -17,6 +17,12 @@ fn init_heap() { unsafe { ALLOCATOR.lock().init(HEAP.as_ptr() as usize, HEAP_SIZE); } } +/// MIPS use __start for entry point instead of _start +#[no_mangle] +pub extern "C" fn __start(argc: isize, argv: *const *const u8) -> ! { + _start(argc, argv) +} + #[no_mangle] pub extern "C" fn _start(_argc: isize, _argv: *const *const u8) -> ! { init_heap();