Skip to content

Commit f51ebc8

Browse files
committed
fix: resolve aarch64 compilation issues
- Wrap naked_asm! in unsafe block for aarch64 entry_trampoline to comply with Rust 2024 edition requirements - Remove problematic outline-atomics target feature flag that was causing warnings
1 parent 92e142c commit f51ebc8

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

.cargo/config.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@ rustflags = ["-C", "relocation-model=pie", "-Z", "plt=yes"]
44
[target.'cfg(target_arch = "aarch64")']
55
rustflags = [
66
"-C", "relocation-model=pie", "-Z", "plt=yes",
7-
8-
# <https://github.com/rust-lang/rust/issues/109064> :/
9-
"-C", "target-feature=-outline-atomics",
107
]

src/arch.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,21 @@ pub const ENTRY_TRAMPOLINE: Option<unsafe extern "C" fn() -> !> = Some(entry_tra
156156
#[cfg(target_arch = "aarch64")]
157157
#[naked]
158158
unsafe extern "C" fn entry_trampoline() -> ! {
159-
core::arch::naked_asm!(
160-
"adrp x8, {context}",
161-
"ldr x9, [x8, {env_entry_off}]", // .env_entry
162-
"cbz x9, 2f",
163-
"ldr x10, [x8, {env_string_off}]", // .env_string
164-
"str x10, [x9]",
165-
"2:",
166-
"ldr x8, [x8]",
167-
"br x8",
168-
context = sym TRAMPOLINE_CONTEXT,
169-
env_entry_off = const TrampolineContext::ENV_ENTRY_OFFSET,
170-
env_string_off = const TrampolineContext::ENV_STRING_OFFSET,
171-
)
159+
unsafe {
160+
core::arch::naked_asm!(
161+
"adrp x8, {context}",
162+
"ldr x9, [x8, {env_entry_off}]", // .env_entry
163+
"cbz x9, 2f",
164+
"ldr x10, [x8, {env_string_off}]", // .env_string
165+
"str x10, [x9]",
166+
"2:",
167+
"ldr x8, [x8]",
168+
"br x8",
169+
context = sym TRAMPOLINE_CONTEXT,
170+
env_entry_off = const TrampolineContext::ENV_ENTRY_OFFSET,
171+
env_string_off = const TrampolineContext::ENV_STRING_OFFSET,
172+
)
173+
}
172174
}
173175

174176
// !!!!

0 commit comments

Comments
 (0)