Skip to content

Commit 1f391db

Browse files
committed
Import 'std_stub' module from the ruduino crate
1 parent cf99901 commit 1f391db

File tree

2 files changed

+47
-6
lines changed

2 files changed

+47
-6
lines changed

avr-atmega328p.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"arch": "avr",
3+
"cpu": "atmega328p",
4+
"data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
5+
"env": "",
6+
"executables": true,
7+
"linker": "avr-gcc",
8+
"linker-flavor": "gcc",
9+
"linker-is-gnu": true,
10+
"llvm-target": "avr-unknown-unknown",
11+
"no-compiler-rt": true,
12+
"os": "unknown",
13+
"position-independent-executables": false,
14+
"exe-suffix": ".elf",
15+
"eh-frame-header": false,
16+
"pre-link-args": {
17+
"gcc": [
18+
"-Os",
19+
"-mmcu=atmega328p"
20+
]
21+
},
22+
"late-link-args": {
23+
"gcc": [
24+
"-lc",
25+
"-lgcc"
26+
]
27+
},
28+
"target-c-int-width": "16",
29+
"target-endian": "little",
30+
"target-pointer-width": "16",
31+
"vendor": "unknown"
32+
}

src/lib.rs

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
#[cfg(test)]
2-
mod tests {
3-
#[test]
4-
fn it_works() {
5-
assert_eq!(2 + 2, 4);
6-
}
1+
//! Defines simple implementations of required language items that `libstd` normally defines.
2+
3+
#![no_std]
4+
5+
#![feature(lang_items)]
6+
7+
#[lang = "eh_personality"]
8+
#[no_mangle]
9+
pub unsafe extern "C" fn rust_eh_personality() -> () {
710
}
11+
12+
#[panic_handler]
13+
fn panic(_info: &::core::panic::PanicInfo) -> ! {
14+
loop {}
15+
}
16+

0 commit comments

Comments
 (0)