Skip to content
Snippets Groups Projects
Commit f265d7c5 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix linking issues with lang items

parent 878f466b
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
#![no_std]
#![feature(asm)]
#![feature(linkage)]
#![feature(naked_functions)]
#![feature(panic_implementation)]
......@@ -60,8 +61,9 @@ pub unsafe extern "C" fn _start_rust(sp: &'static Stack) -> ! {
}
#[panic_implementation]
#[linkage = "weak"]
#[no_mangle]
pub extern "C" fn _start_panic(pi: &::core::panic::PanicInfo) -> ! {
pub extern "C" fn rust_begin_unwind(pi: &::core::panic::PanicInfo) -> ! {
use core::fmt::Write;
let mut w = platform::FileWriter(2);
......
#![no_std]
#![feature(lang_items)]
#![feature(linkage)]
#![feature(panic_implementation)]
//extern crate compiler_builtins;
......@@ -28,9 +29,11 @@ pub extern crate time;
pub extern crate unistd;
pub extern crate wctype;
#[cfg(not(test))]
#[panic_implementation]
#[linkage = "weak"]
#[no_mangle]
pub extern "C" fn relibc_panic(pi: &::core::panic::PanicInfo) -> ! {
pub extern "C" fn rust_begin_unwind(pi: &::core::panic::PanicInfo) -> ! {
use core::fmt::Write;
let mut w = platform::FileWriter(2);
......@@ -39,9 +42,17 @@ pub extern "C" fn relibc_panic(pi: &::core::panic::PanicInfo) -> ! {
platform::exit(1);
}
#[cfg(not(test))]
#[lang = "eh_personality"]
#[no_mangle]
#[linkage = "weak"]
pub extern "C" fn rust_eh_personality() {}
#[cfg(not(test))]
#[lang = "oom"]
#[linkage = "weak"]
#[no_mangle]
pub extern fn relibc_oom(layout: ::core::alloc::Layout) -> ! {
pub extern fn rust_oom(layout: ::core::alloc::Layout) -> ! {
use core::fmt::Write;
let mut w = platform::FileWriter(2);
......@@ -49,3 +60,16 @@ pub extern fn relibc_oom(layout: ::core::alloc::Layout) -> ! {
platform::exit(1);
}
#[cfg(not(test))]
#[allow(non_snake_case)]
#[linkage = "weak"]
#[no_mangle]
pub extern "C" fn _Unwind_Resume() -> ! {
use core::fmt::Write;
let mut w = platform::FileWriter(2);
let _ = w.write_str("_Unwind_Resume\n");
platform::exit(1);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment