Don't compile probestack functions during testing

master
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 #![cfg(not(windows))] // Windows already has builtins to do this
#[naked] #[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)] #[no_mangle]
#[cfg(target_arch = "x86_64")] #[cfg(all(target_arch = "x86_64", not(feature = "mangled-names")))]
pub unsafe extern fn __rust_probestack() { pub unsafe extern fn __rust_probestack() {
// Our goal here is to touch each page between %rsp+8 and %rsp+8-%rax, // 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. // ensuring that if any pages are unmapped we'll make a page fault.
@ -87,8 +87,8 @@ pub unsafe extern fn __rust_probestack() {
} }
#[naked] #[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)] #[no_mangle]
#[cfg(target_arch = "x86")] #[cfg(all(target_arch = "x86", not(feature = "mangled-names")))]
pub unsafe extern fn __rust_probestack() { pub unsafe extern fn __rust_probestack() {
// This is the same as x86_64 above, only translated for 32-bit sizes. Note // 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 // 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 // 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 // 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] #[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)] #[no_mangle]
pub unsafe fn ___chkstk_ms() { pub unsafe fn ___chkstk_ms() {
asm!(" asm!("
push %ecx push %ecx
@ -34,17 +34,17 @@ pub unsafe fn ___chkstk_ms() {
} }
// FIXME: __alloca should be an alias to __chkstk // 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] #[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)] #[no_mangle]
pub unsafe fn __alloca() { pub unsafe fn __alloca() {
asm!("jmp ___chkstk // Jump to ___chkstk since fallthrough may be unreliable"); asm!("jmp ___chkstk // Jump to ___chkstk since fallthrough may be unreliable");
intrinsics::unreachable(); intrinsics::unreachable();
} }
#[cfg(all(windows, target_env = "gnu"))] #[cfg(all(windows, target_env = "gnu", not(feature = "mangled-names")))]
#[naked] #[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)] #[no_mangle]
pub unsafe fn ___chkstk() { pub unsafe fn ___chkstk() {
asm!(" asm!("
push %ecx 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 // 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 // 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] #[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)] #[no_mangle]
pub unsafe fn ___chkstk_ms() { pub unsafe fn ___chkstk_ms() {
asm!(" asm!("
push %rcx push %rcx
@ -33,18 +33,18 @@ pub unsafe fn ___chkstk_ms() {
intrinsics::unreachable(); intrinsics::unreachable();
} }
#[cfg(all(windows, target_env = "gnu"))] #[cfg(all(windows, target_env = "gnu", not(feature = "mangled-names")))]
#[naked] #[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)] #[no_mangle]
pub unsafe fn __alloca() { pub unsafe fn __alloca() {
asm!("mov %rcx,%rax // x64 _alloca is a normal function with parameter in rcx asm!("mov %rcx,%rax // x64 _alloca is a normal function with parameter in rcx
jmp ___chkstk // Jump to ___chkstk since fallthrough may be unreliable"); jmp ___chkstk // Jump to ___chkstk since fallthrough may be unreliable");
intrinsics::unreachable(); intrinsics::unreachable();
} }
#[cfg(all(windows, target_env = "gnu"))] #[cfg(all(windows, target_env = "gnu", not(feature = "mangled-names")))]
#[naked] #[naked]
#[cfg_attr(not(feature = "mangled-names"), no_mangle)] #[no_mangle]
pub unsafe fn ___chkstk() { pub unsafe fn ___chkstk() {
asm!(" asm!("
push %rcx push %rcx