Skip to content

Commit 0644524

Browse files
committed
Don't include custom chkstk on MSVC
MSVC includes its own __chkstk so these aren't used.
1 parent 5e49856 commit 0644524

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/x86_64.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use core::intrinsics;
88
// NOTE These functions are never mangled as they are not tested against compiler-rt
99
// and mangling ___chkstk would break the `jmp ___chkstk` instruction in __alloca
1010

11-
#[cfg(windows)]
11+
#[cfg(all(windows, target_env = "gnu"))]
1212
#[naked]
1313
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
1414
pub unsafe fn ___chkstk_ms() {
@@ -32,7 +32,7 @@ pub unsafe fn ___chkstk_ms() {
3232
intrinsics::unreachable();
3333
}
3434

35-
#[cfg(windows)]
35+
#[cfg(all(windows, target_env = "gnu"))]
3636
#[naked]
3737
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
3838
pub unsafe fn __alloca() {
@@ -41,7 +41,7 @@ pub unsafe fn __alloca() {
4141
intrinsics::unreachable();
4242
}
4343

44-
#[cfg(windows)]
44+
#[cfg(all(windows, target_env = "gnu"))]
4545
#[naked]
4646
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
4747
pub unsafe fn ___chkstk() {

0 commit comments

Comments
 (0)