Skip to content

Commit f6c4034

Browse files
committed
Auto merge of #179 - ollie27:chkstk, r=alexcrichton
Don't include custom chkstk on MSVC MSVC includes its own __chkstk so these aren't used. These aren't included in compiler-rt: https://github.com/llvm-mirror/compiler-rt/blob/cb42103777b0fa8b8f38a7bfe5592ed8e3e48388/lib/builtins/CMakeLists.txt#L224-L284. They also weren't included in compiler-builtins: https://github.com/rust-lang/rust/blob/1685c9298685f73db4fe890c1ed27b22408aaad7/src/libcompiler_builtins/build.rs#L255-L293 until rust-lang/rust#42899.
2 parents 5e49856 + 0644524 commit f6c4034

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/x86_64.rs

Lines changed: 3 additions & 3 deletions
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)