@@ -31,7 +31,7 @@ impl TrapHandler {
31
31
pub unsafe fn new ( macos_use_mach_ports : bool ) -> TrapHandler {
32
32
// Either mach ports shouldn't be in use or we shouldn't be on macOS,
33
33
// otherwise the `machports.rs` module should be used instead.
34
- assert ! ( !macos_use_mach_ports || !cfg!( target_os = "macos " ) ) ;
34
+ assert ! ( !macos_use_mach_ports || !cfg!( target_vendor = "apple " ) ) ;
35
35
36
36
foreach_handler ( |slot, signal| {
37
37
let mut handler: libc:: sigaction = mem:: zeroed ( ) ;
@@ -63,7 +63,7 @@ impl TrapHandler {
63
63
}
64
64
65
65
pub fn validate_config ( & self , macos_use_mach_ports : bool ) {
66
- assert ! ( !macos_use_mach_ports || !cfg!( target_os = "macos " ) ) ;
66
+ assert ! ( !macos_use_mach_ports || !cfg!( target_vendor = "apple " ) ) ;
67
67
}
68
68
}
69
69
@@ -81,7 +81,7 @@ unsafe fn foreach_handler(mut f: impl FnMut(*mut libc::sigaction, i32)) {
81
81
82
82
// Sometimes we need to handle SIGBUS too:
83
83
// - On Darwin, guard page accesses are raised as SIGBUS.
84
- if cfg ! ( target_os = "macos " ) || cfg ! ( target_os = "freebsd" ) {
84
+ if cfg ! ( target_vendor = "apple " ) || cfg ! ( target_os = "freebsd" ) {
85
85
f ( addr_of_mut ! ( PREV_SIGBUS ) , libc:: SIGBUS ) ;
86
86
}
87
87
@@ -209,7 +209,7 @@ unsafe extern "C" fn trap_handler(
209
209
// done running" which will clear the sigaltstack flag and allow
210
210
// reusing it for the next signal. Then upon resuming in our custom
211
211
// code we blow away the stack anyway with a longjmp.
212
- if cfg ! ( target_os = "macos " ) {
212
+ if cfg ! ( target_vendor = "apple " ) {
213
213
unsafe extern "C" fn wasmtime_longjmp_shim ( jmp_buf : * const u8 ) {
214
214
wasmtime_longjmp ( jmp_buf)
215
215
}
@@ -303,13 +303,13 @@ unsafe fn get_trap_registers(cx: *mut libc::c_void, _signum: libc::c_int) -> Tra
303
303
pc: ( cx. uc_mcontext. psw. addr - trap_offset) as usize ,
304
304
fp: * ( cx. uc_mcontext. gregs[ 15 ] as * const usize ) ,
305
305
}
306
- } else if #[ cfg( all( target_os = "macos " , target_arch = "x86_64" ) ) ] {
306
+ } else if #[ cfg( all( target_vendor = "apple " , target_arch = "x86_64" ) ) ] {
307
307
let cx = & * ( cx as * const libc:: ucontext_t) ;
308
308
TrapRegisters {
309
309
pc: ( * cx. uc_mcontext) . __ss. __rip as usize ,
310
310
fp: ( * cx. uc_mcontext) . __ss. __rbp as usize ,
311
311
}
312
- } else if #[ cfg( all( target_os = "macos " , target_arch = "aarch64" ) ) ] {
312
+ } else if #[ cfg( all( target_vendor = "apple " , target_arch = "aarch64" ) ) ] {
313
313
let cx = & * ( cx as * const libc:: ucontext_t) ;
314
314
TrapRegisters {
315
315
pc: ( * cx. uc_mcontext) . __ss. __pc as usize ,
@@ -358,7 +358,7 @@ unsafe fn get_trap_registers(cx: *mut libc::c_void, _signum: libc::c_int) -> Tra
358
358
// See more comments above where this is called for what it's doing.
359
359
unsafe fn set_pc ( cx : * mut libc:: c_void , pc : usize , arg1 : usize ) {
360
360
cfg_if:: cfg_if! {
361
- if #[ cfg( not( target_os = "macos " ) ) ] {
361
+ if #[ cfg( not( target_vendor = "apple " ) ) ] {
362
362
let _ = ( cx, pc, arg1) ;
363
363
unreachable!( ) ; // not used on these platforms
364
364
} else if #[ cfg( target_arch = "x86_64" ) ] {
@@ -382,7 +382,7 @@ unsafe fn set_pc(cx: *mut libc::c_void, pc: usize, arg1: usize) {
382
382
( * cx. uc_mcontext) . __ss. __pc = pc as u64 ;
383
383
( * cx. uc_mcontext) . __ss. __x[ 0 ] = arg1 as u64 ;
384
384
} else {
385
- compile_error!( "unsupported macos target architecture" ) ;
385
+ compile_error!( "unsupported apple target architecture" ) ;
386
386
}
387
387
}
388
388
}
0 commit comments