Skip to content

Commit 4af96ae

Browse files
committed
Auto merge of #58060 - andre-richter:master, r=nagisa
targets: aarch64-unknown-none: Add +strict-align On AArch64, an unaligned access causes a synchronous exception. In the current state of the target, the compiler might generate unaligned accesses, see rust-embedded/rust-raspberrypi-OS-tutorials#10. Since this is a bare-metal target, it is possible that there is no exception handling in place (yet) to recover from this case, causing a binary to just silently fail. Add `+strict-align` to avoid this case.
2 parents 2efa31b + c4e4614 commit 4af96ae

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librustc_target/spec/aarch64_unknown_none.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use super::{LldFlavor, LinkerFlavor, Target, TargetOptions, PanicStrategy};
1111
pub fn target() -> Result<Target, String> {
1212
let opts = TargetOptions {
1313
linker: Some("rust-lld".to_owned()),
14+
features: "+strict-align".to_string(),
1415
executables: true,
1516
relocation_model: "static".to_string(),
1617
disable_redzone: true,

0 commit comments

Comments
 (0)