Skip to content
Snippets Groups Projects
Commit 4427b856 authored by Per's avatar Per
Browse files

rust no_std compiles

parent 7ec07144
No related branches found
No related tags found
No related merge requests found
File moved
......@@ -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;
fn main() {
#[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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment