File tree 3 files changed +6
-0
lines changed
3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ default-target = "i686-unknown-linux-gnu"
18
18
19
19
[dependencies ]
20
20
cty = " ^0.2"
21
+ # see https://github.com/immunant/c2rust/pull/307
22
+ c2rust-asm-casts = { git = " https://github.com/chrysn-pull-requests/c2rust" , branch = " nostd-c2rust-asm-casts" }
21
23
22
24
[build-dependencies ]
23
25
bindgen = " 0.53.1"
Original file line number Diff line number Diff line change @@ -191,6 +191,8 @@ static {type_name} init_{macro_name}(void) {{
191
191
rustcode = rustcode. replace ( " #[no_mangle]\n fn " , " #[no_mangle]\n pub fn " ) ;
192
192
// used as a callback, therefore does need the extern "C" -- FIXME probably worth a RIOT issue
193
193
rustcode = rustcode. replace ( r"pub unsafe fn _evtimer_msg_handler" , r#"pub unsafe extern "C" fn _evtimer_msg_handler"# ) ;
194
+ // C2Rust still generates old-style ASM -- workaround for https://github.com/immunant/c2rust/issues/306
195
+ rustcode = rustcode. replace ( " asm!(" , " llvm_asm!(" ) ;
194
196
// particular functions known to be const because they have macro equivalents as well
195
197
// (Probably we could remove the 'extern "C"' from all functions)
196
198
rustcode = rustcode. replace ( r#"pub unsafe extern "C" fn mutex_init("# , r#"pub const unsafe fn mutex_init("# ) ;
Original file line number Diff line number Diff line change 57
57
// when experimenting with C2Rust generated extern functions, C library fn are pulled in and they
58
58
// have stuff like `pub type iovec`
59
59
#![ feature( extern_types) ]
60
+ // eg. for irq_enable on arm
61
+ #![ feature( llvm_asm) ]
60
62
61
63
pub mod libc;
62
64
You can’t perform that action at this time.
0 commit comments