Skip to content

Commit

Permalink
Merge pull request #168 from rust-embedded/riscv-rt-links
Browse files Browse the repository at this point in the history
`riscv-rt`: add links to Cargo.toml
  • Loading branch information
MabezDev authored Jan 3, 2024
2 parents d9b9df3 + b8f0523 commit 7396326
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions riscv-rt/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Added

- Add `links` field in `Cargo.toml`
- Add FPU initialization
- Static array for vectored-like handling of exceptions
- New GitHub workflow for checking invalid labels in PRs
Expand Down
1 change: 1 addition & 0 deletions riscv-rt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ documentation = "https://docs.rs/riscv-rt"
keywords = ["riscv", "runtime", "startup"]
license = "ISC"
edition = "2021"
links = "riscv-rt" # Prevent multiple versions of riscv-rt being linked

[features]
s-mode = []
Expand Down
4 changes: 4 additions & 0 deletions riscv-rt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ use riscv::register::mstatus as xstatus;

pub use riscv_rt_macros::{entry, pre_init};

/// We export this static with an informative name so that if an application attempts to link
/// two copies of riscv-rt together, linking will fail. We also declare a links key in
/// Cargo.toml which is the more modern way to solve the same problem, but we have to keep
/// __ONCE__ around to prevent linking with versions before the links key was added.
#[export_name = "error: riscv-rt appears more than once in the dependency graph"]
#[doc(hidden)]
pub static __ONCE__: () = ();
Expand Down

0 comments on commit 7396326

Please sign in to comment.