File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
9
9
10
10
### Added
11
11
12
+ - Add ` links ` field in ` Cargo.toml `
12
13
- Add FPU initialization
13
14
- Static array for vectored-like handling of exceptions
14
15
- New GitHub workflow for checking invalid labels in PRs
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ documentation = "https://docs.rs/riscv-rt"
10
10
keywords = [" riscv" , " runtime" , " startup" ]
11
11
license = " ISC"
12
12
edition = " 2021"
13
+ links = " riscv-rt" # Prevent multiple versions of riscv-rt being linked
13
14
14
15
[features ]
15
16
s-mode = []
Original file line number Diff line number Diff line change @@ -423,6 +423,10 @@ use riscv::register::mstatus as xstatus;
423
423
424
424
pub use riscv_rt_macros:: { entry, pre_init} ;
425
425
426
+ /// We export this static with an informative name so that if an application attempts to link
427
+ /// two copies of riscv-rt together, linking will fail. We also declare a links key in
428
+ /// Cargo.toml which is the more modern way to solve the same problem, but we have to keep
429
+ /// __ONCE__ around to prevent linking with versions before the links key was added.
426
430
#[ export_name = "error: riscv-rt appears more than once in the dependency graph" ]
427
431
#[ doc( hidden) ]
428
432
pub static __ONCE__: ( ) = ( ) ;
You can’t perform that action at this time.
0 commit comments