4141//! probes on any other architecture like ARM or PowerPC64. LLVM I'm sure would
4242//! be more than welcome to accept such a change!
4343
44- #![ cfg( not( windows) ) ] // Windows already has builtins to do this
44+ #![ cfg( not( feature = "mangled-names" ) ) ]
45+ // Windows already has builtins to do this.
46+ #![ cfg( not( windows) ) ]
47+ // We only define stack probing for these architectures today.
48+ #![ cfg( any( target_arch = "x86_64" , target_arch = "x86" ) ) ]
4549
4650extern "C" {
4751 pub fn __rust_probestack ( ) ;
@@ -52,11 +56,7 @@ extern "C" {
5256// emitted for the function.
5357//
5458// This is the ELF version.
55- #[ cfg( all(
56- any( target_arch = "x86_64" , target_arch = "x86" ) ,
57- not( feature = "mangled-names" ) ,
58- not( target_vendor = "apple" )
59- ) ) ]
59+ #[ cfg( not( target_vendor = "apple" ) ) ]
6060macro_rules! define_rust_probestack {
6161 ( $body: expr) => {
6262 concat!(
@@ -76,11 +76,7 @@ macro_rules! define_rust_probestack {
7676}
7777
7878// Same as above, but for Mach-O.
79- #[ cfg( all(
80- any( target_arch = "x86_64" , target_arch = "x86" ) ,
81- not( feature = "mangled-names" ) ,
82- target_vendor = "apple"
83- ) ) ]
79+ #[ cfg( target_vendor = "apple" ) ]
8480macro_rules! define_rust_probestack {
8581 ( $body: expr) => {
8682 concat!(
@@ -98,7 +94,7 @@ macro_rules! define_rust_probestack {
9894//
9995// The ABI here is that the stack frame size is located in `%rax`. Upon
10096// return we're not supposed to modify `%rsp` or `%rax`.
101- #[ cfg( all ( target_arch = "x86_64" , not ( feature = "mangled-names" ) ) ) ]
97+ #[ cfg( target_arch = "x86_64" ) ]
10298global_asm ! ( define_rust_probestack!( "
10399 .cfi_startproc
104100 pushq %rbp
@@ -150,7 +146,7 @@ global_asm!(define_rust_probestack!("
150146 .cfi_endproc
151147" ) ) ;
152148
153- #[ cfg( all ( target_arch = "x86" , not ( feature = "mangled-names" ) ) ) ]
149+ #[ cfg( target_arch = "x86" ) ]
154150// This is the same as x86_64 above, only translated for 32-bit sizes. Note
155151// that on Unix we're expected to restore everything as it was, this
156152// function basically can't tamper with anything.
0 commit comments