Don't compile probestack functions during testing

This commit is contained in:
Matt Ickstadt 2017-09-15 18:04:11 -05:00
parent b3679bcfba
commit a40cc6a12d
3 changed files with 16 additions and 16 deletions

View File

@ -44,8 +44,8 @@
#![cfg(not(windows))] // Windows already has builtins to do this
#[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
#[cfg(target_arch = "x86_64")]
#[no_mangle]
#[cfg(all(target_arch = "x86_64", not(feature = "mangled-names")))]
pub unsafe extern fn __rust_probestack() {
// Our goal here is to touch each page between %rsp+8 and %rsp+8-%rax,
// ensuring that if any pages are unmapped we'll make a page fault.
@ -87,8 +87,8 @@ pub unsafe extern fn __rust_probestack() {
}
#[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
#[cfg(target_arch = "x86")]
#[no_mangle]
#[cfg(all(target_arch = "x86", not(feature = "mangled-names")))]
pub unsafe extern fn __rust_probestack() {
// This is the same as x86_64 above, only translated for 32-bit sizes. Note
// that on Unix we're expected to restore everything as it was, this

View File

@ -8,9 +8,9 @@ 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(all(windows, target_env = "gnu"))]
#[cfg(all(windows, target_env = "gnu", not(feature = "mangled-names")))]
#[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
#[no_mangle]
pub unsafe fn ___chkstk_ms() {
asm!("
push %ecx
@ -34,17 +34,17 @@ pub unsafe fn ___chkstk_ms() {
}
// FIXME: __alloca should be an alias to __chkstk
#[cfg(all(windows, target_env = "gnu"))]
#[cfg(all(windows, target_env = "gnu", not(feature = "mangled-names")))]
#[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
#[no_mangle]
pub unsafe fn __alloca() {
asm!("jmp ___chkstk // Jump to ___chkstk since fallthrough may be unreliable");
intrinsics::unreachable();
}
#[cfg(all(windows, target_env = "gnu"))]
#[cfg(all(windows, target_env = "gnu", not(feature = "mangled-names")))]
#[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
#[no_mangle]
pub unsafe fn ___chkstk() {
asm!("
push %ecx

View File

@ -8,9 +8,9 @@ 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(all(windows, target_env = "gnu"))]
#[cfg(all(windows, target_env = "gnu", not(feature = "mangled-names")))]
#[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
#[no_mangle]
pub unsafe fn ___chkstk_ms() {
asm!("
push %rcx
@ -33,18 +33,18 @@ pub unsafe fn ___chkstk_ms() {
intrinsics::unreachable();
}
#[cfg(all(windows, target_env = "gnu"))]
#[cfg(all(windows, target_env = "gnu", not(feature = "mangled-names")))]
#[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
#[no_mangle]
pub unsafe fn __alloca() {
asm!("mov %rcx,%rax // x64 _alloca is a normal function with parameter in rcx
jmp ___chkstk // Jump to ___chkstk since fallthrough may be unreliable");
intrinsics::unreachable();
}
#[cfg(all(windows, target_env = "gnu"))]
#[cfg(all(windows, target_env = "gnu", not(feature = "mangled-names")))]
#[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
#[no_mangle]
pub unsafe fn ___chkstk() {
asm!("
push %rcx