Skip to content

Commit c4e4614

Browse files
committedFeb 1, 2019
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.
1 parent 23d8d0c commit c4e4614

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)
Please sign in to comment.