From 064452423a4b03f8f55a51ea98465ebb5290b655 Mon Sep 17 00:00:00 2001 From: Oliver Middleton Date: Wed, 12 Jul 2017 22:40:49 +0100 Subject: [PATCH] Don't include custom chkstk on MSVC MSVC includes its own __chkstk so these aren't used. --- src/x86_64.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x86_64.rs b/src/x86_64.rs index 64cc06c..bc3c4ee 100644 --- a/src/x86_64.rs +++ b/src/x86_64.rs @@ -8,7 +8,7 @@ use core::intrinsics; // NOTE These functions are never mangled as they are not tested against compiler-rt // and mangling ___chkstk would break the `jmp ___chkstk` instruction in __alloca -#[cfg(windows)] +#[cfg(all(windows, target_env = "gnu"))] #[naked] #[cfg_attr(not(feature = "mangled-names"), no_mangle)] pub unsafe fn ___chkstk_ms() { @@ -32,7 +32,7 @@ pub unsafe fn ___chkstk_ms() { intrinsics::unreachable(); } -#[cfg(windows)] +#[cfg(all(windows, target_env = "gnu"))] #[naked] #[cfg_attr(not(feature = "mangled-names"), no_mangle)] pub unsafe fn __alloca() { @@ -41,7 +41,7 @@ pub unsafe fn __alloca() { intrinsics::unreachable(); } -#[cfg(windows)] +#[cfg(all(windows, target_env = "gnu"))] #[naked] #[cfg_attr(not(feature = "mangled-names"), no_mangle)] pub unsafe fn ___chkstk() {