Commit 4427b856 authored by Per's avatar Per

rust no_std compiles

parent 7ec07144
......@@ -2,6 +2,15 @@
name = "rust"
version = "0.1.0"
authors = ["pln <Per Lindgren>"]
edition = "2018"
# edition = "2018"
[dependencies]
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
codegen-units = 1 # better optimizations
debug = true # symbols are nice and they don't increase the size on Flash
lto = true # better optimizations
\ No newline at end of file
#![no_std]
#![feature(compiler_builtins_lib)]
#![feature(lang_items)]
#![feature(core_intrinsics)]
#![no_main]
//use core::ptr::read;
use core::intrinsics;
use core::panic::PanicInfo;
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
unsafe { intrinsics::abort() }
}
#[inline(never)]
fn f1() -> u32 {
0
}
#[no_mangle]
fn main() {
f1();
}
// cargo rustc --release -- -C linker=true --emit=llvm-ir,llvm-bc
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