Skip to content

Commit 97443b4

Browse files
Merge pull request #387 from kurtjd/arch-width-fix
Make ARCH_WIDTH byte aligned instead of bit aligned
2 parents d0893ea + a35a025 commit 97443b4

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

riscv-rt/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## v0.17.1 - 2026-01-13
11+
12+
### Fixed
13+
14+
- Fix `build.rs` so `ARCH_WIDTH` is passed to linker script in size of bytes (instead of bits)
15+
1016
## v0.17.0 - 2025-12-19
1117

1218
### Added

riscv-rt/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "riscv-rt"
3-
version = "0.17.0"
3+
version = "0.17.1"
44
rust-version = "1.81"
55
repository = "https://github.com/rust-embedded/riscv"
66
authors = ["The RISC-V Team <risc-v@teams.rust-embedded.org>"]

riscv-rt/build.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ fn main() {
5656
let cargo_flags = env::var("CARGO_ENCODED_RUSTFLAGS").unwrap();
5757

5858
if let Ok(target) = RiscvTarget::build(&target, &cargo_flags) {
59-
let width = target.width();
59+
// Linker script expects ARCH_WIDTH in bytes
60+
let width_bytes = u32::from(target.width()) / 8;
6061

6162
// set environment variable RISCV_RT_BASE_ISA to the base ISA of the target.
6263
println!(
@@ -86,6 +87,6 @@ fn main() {
8687
println!("cargo:rustc-cfg={flag}");
8788
}
8889
}
89-
add_linker_script(width.into()).unwrap();
90+
add_linker_script(width_bytes).unwrap();
9091
}
9192
}

0 commit comments

Comments
 (0)