-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inline asm $ usage in panic_abort
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
patches/0028-stdlib-Fix-inline-asm-usage-in-panic_abort.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
From 92cf0e9491bfe120949fe2aa38701f6b3a599bde Mon Sep 17 00:00:00 2001 | ||
From: bjorn3 <17426603+bjorn3@users.noreply.github.com> | ||
Date: Fri, 6 Oct 2023 19:09:56 +0000 | ||
Subject: [PATCH] Fix inline asm $ usage in panic_abort and std | ||
|
||
--- | ||
library/panic_abort/src/lib.rs | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/library/panic_abort/src/lib.rs b/library/panic_abort/src/lib.rs | ||
index 6e097e2..e2e2be9 100644 | ||
--- a/library/panic_abort/src/lib.rs | ||
+++ b/library/panic_abort/src/lib.rs | ||
@@ -70,7 +70,7 @@ pub unsafe fn __rust_start_panic(_payload: &mut dyn PanicPayload) -> u32 { | ||
const FAST_FAIL_FATAL_APP_EXIT: usize = 7; | ||
cfg_if::cfg_if! { | ||
if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { | ||
- core::arch::asm!("int $$0x29", in("ecx") FAST_FAIL_FATAL_APP_EXIT); | ||
+ core::arch::asm!("int 0x29", in("ecx") FAST_FAIL_FATAL_APP_EXIT); | ||
} else if #[cfg(all(target_arch = "arm", target_feature = "thumb-mode"))] { | ||
core::arch::asm!(".inst 0xDEFB", in("r0") FAST_FAIL_FATAL_APP_EXIT); | ||
} else if #[cfg(target_arch = "aarch64")] { | ||
diff --git a/library/std/src/sys/windows/mod.rs b/library/std/src/sys/windows/mod.rs | ||
index b609ad2..4437be5 100644 | ||
--- a/library/std/src/sys/windows/mod.rs | ||
+++ b/library/std/src/sys/windows/mod.rs | ||
@@ -322,7 +322,7 @@ pub fn abort_internal() -> ! { | ||
unsafe { | ||
cfg_if::cfg_if! { | ||
if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { | ||
- core::arch::asm!("int $$0x29", in("ecx") FAST_FAIL_FATAL_APP_EXIT); | ||
+ core::arch::asm!("int $0x29", in("ecx") FAST_FAIL_FATAL_APP_EXIT); | ||
crate::intrinsics::unreachable(); | ||
} else if #[cfg(all(target_arch = "arm", target_feature = "thumb-mode"))] { | ||
core::arch::asm!(".inst 0xDEFB", in("r0") FAST_FAIL_FATAL_APP_EXIT); | ||
-- | ||
2.34.1 | ||
|