From 45a7693962e75ae0653645328aa2c78e8708cb24 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. --- library/compiler-builtins/src/x86_64.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/compiler-builtins/src/x86_64.rs b/library/compiler-builtins/src/x86_64.rs index 64cc06c98345..bc3c4ee4c555 100644 --- a/library/compiler-builtins/src/x86_64.rs +++ b/library/compiler-builtins/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() {