File tree Expand file tree Collapse file tree 2 files changed +5
-18
lines changed Expand file tree Collapse file tree 2 files changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ panic-halt = "1.0"
88riscv = { path = " ../riscv" }
99riscv-rt = { path = " ../riscv-rt" }
1010
11+ [build-dependencies ]
12+ minilink = " 0.2"
13+
1114[features ]
1215pre-init = [" riscv-rt/pre-init" ]
1316single-hart = [" riscv-rt/single-hart" ]
Original file line number Diff line number Diff line change 11use std:: { env, fs:: File , io:: Write , path:: PathBuf } ;
22
33fn main ( ) {
4- // Put device.x somewhere the linker can find it
5- let out = & PathBuf :: from ( env:: var_os ( "OUT_DIR" ) . unwrap ( ) ) ;
6- File :: create ( out. join ( "device.x" ) )
7- . unwrap ( )
8- . write_all ( include_bytes ! ( "device.x" ) )
9- . unwrap ( ) ;
10- println ! ( "cargo:rustc-link-search={}" , out. display( ) ) ;
11- println ! ( "cargo:rerun-if-changed=device.x" ) ;
12-
13- // Put memory.x somewhere the linker can find it
14- File :: create ( out. join ( "memory.x" ) )
15- . unwrap ( )
16- . write_all ( include_bytes ! ( "memory.x" ) )
17- . unwrap ( ) ;
18- println ! ( "cargo:rustc-link-search={}" , out. display( ) ) ;
19- println ! ( "cargo:rerun-if-changed=memory.x" ) ;
20-
21- println ! ( "cargo:rerun-if-changed=build.rs" ) ;
4+ minilink:: register_template ( "device.x" , "device.x" ) ;
5+ minilink:: register_template ( "memory.x" , "memory.x" ) ;
226}
You can’t perform that action at this time.
0 commit comments