Commit 878f466b authored by Jeremy Soller's avatar Jeremy Soller

Update to new ralloc, new panic implementation, new compiler-builtins

parent be0aed56
This diff is collapsed.
......@@ -11,10 +11,9 @@ crate-type = ["staticlib"]
members = ["src/crt0"]
[build-dependencies]
cc = "1.0"
cc = "1.0.17"
[dependencies]
compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-builtins.git", default-features = false }
ctype = { path = "src/ctype" }
errno = { path = "src/errno" }
fcntl = { path = "src/fcntl" }
......@@ -40,6 +39,11 @@ time = { path = "src/time" }
unistd = { path = "src/unistd" }
wctype = { path = "src/wctype" }
[dependencies.compiler_builtins]
git = "https://github.com/rust-lang-nursery/compiler-builtins.git"
default-features = false
features = ["no-lang-items"]
[profile.dev]
panic = "abort"
......
......@@ -52,7 +52,7 @@ $(BUILD)/debug/libc.a: $(SRC)
touch $@
$(BUILD)/debug/crt0.o: $(SRC)
cargo rustc --manifest-path src/crt0/Cargo.toml $(CARGOFLAGS) -- --emit obj=$@
CARGO_INCREMENTAL=0 cargo --verbose --verbose rustc --manifest-path src/crt0/Cargo.toml $(CARGOFLAGS) -- --emit obj=$@
touch $@
$(BUILD)/release/libc.a: $(SRC)
......@@ -60,7 +60,7 @@ $(BUILD)/release/libc.a: $(SRC)
touch $@
$(BUILD)/release/crt0.o: $(SRC)
cargo rustc --release --manifest-path src/crt0/Cargo.toml $(CARGOFLAGS) -- --emit obj=$@
CARGO_INCREMENTAL=0 cargo rustc --release --manifest-path src/crt0/Cargo.toml $(CARGOFLAGS) -- --emit obj=$@
touch $@
$(BUILD)/openlibm: openlibm
......
Subproject commit 2d8d44970eb5bb2ecc55f5ced8a33f21ed9407f4
Subproject commit 311db75868ff73089a3ab46258ce8cdb2d1670f9
nightly-2018-03-04
nightly-2018-06-19
......@@ -2,8 +2,8 @@
#![no_std]
#![feature(asm)]
#![feature(lang_items)]
#![feature(naked_functions)]
#![feature(panic_implementation)]
extern crate platform;
......@@ -59,7 +59,13 @@ pub unsafe extern "C" fn _start_rust(sp: &'static Stack) -> ! {
platform::exit(main(argc, argv));
}
#[lang = "panic_fmt"]
pub extern "C" fn rust_begin_unwind(_fmt: ::core::fmt::Arguments, _file: &str, _line: u32) -> ! {
loop {}
#[panic_implementation]
#[no_mangle]
pub extern "C" fn _start_panic(pi: &::core::panic::PanicInfo) -> ! {
use core::fmt::Write;
let mut w = platform::FileWriter(2);
let _ = w.write_fmt(format_args!("RELIBC CRT0 PANIC: {}\n", pi));
platform::exit(1);
}
sys_includes = ["sys/types.h"]
sys_includes = ["stdint.h", "sys/types.h"]
include_guard = "_FENV_H"
language = "C"
......
#![no_std]
#![feature(lang_items)]
#![feature(panic_implementation)]
extern crate compiler_builtins;
//extern crate compiler_builtins;
extern crate platform;
pub extern crate ctype;
......@@ -27,28 +28,24 @@ pub extern crate time;
pub extern crate unistd;
pub extern crate wctype;
#[lang = "eh_personality"]
#[panic_implementation]
#[no_mangle]
pub extern "C" fn rust_eh_personality() {}
#[lang = "panic_fmt"]
#[no_mangle]
pub extern "C" fn rust_begin_unwind(fmt: ::core::fmt::Arguments, file: &str, line: u32) -> ! {
pub extern "C" fn relibc_panic(pi: &::core::panic::PanicInfo) -> ! {
use core::fmt::Write;
let mut w = platform::FileWriter(2);
let _ = w.write_fmt(format_args!("{}:{}: {}\n", file, line, fmt));
let _ = w.write_fmt(format_args!("RELIBC PANIC: {}\n", pi));
platform::exit(1);
}
#[allow(non_snake_case)]
#[lang = "oom"]
#[no_mangle]
pub extern "C" fn _Unwind_Resume() -> ! {
pub extern fn relibc_oom(layout: ::core::alloc::Layout) -> ! {
use core::fmt::Write;
let mut w = platform::FileWriter(2);
let _ = w.write_str("_Unwind_Resume\n");
let _ = w.write_fmt(format_args!("RELIBC OOM: {} bytes aligned to {} bytes\n", layout.size(), layout.align()));
platform::exit(1);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment