瀏覽代碼

Don't include custom chkstk on MSVC

MSVC includes its own __chkstk so these aren't used.
Oliver Middleton 7 年之前
父節點
當前提交
064452423a
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/x86_64.rs

+ 3 - 3
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() {