File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ const ALLOWED_CFGS: &[&str] = &[
3131 // Corresponds to `_REDIR_TIME64` in musl
3232 "musl32_time64" ,
3333 "vxworks_lt_25_09" ,
34+ "aarch64_macos_15_5_or_newer" ,
3435] ;
3536
3637// Extra values to allow for check-cfg.
@@ -65,6 +66,20 @@ fn main() {
6566 let target_ptr_width = env:: var ( "CARGO_CFG_TARGET_POINTER_WIDTH" ) . unwrap_or_default ( ) ;
6667 let target_arch = env:: var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap_or_default ( ) ;
6768
69+ println ! ( "cargo:rerun-if-env-changed=MACOSX_DEPLOYMENT_TARGET" ) ;
70+
71+ if target_os == "macos" && target_arch == "aarch64" {
72+ if let Ok ( deployment) = env:: var ( "MACOSX_DEPLOYMENT_TARGET" ) {
73+ let mut it = deployment. split ( '.' ) ;
74+ let major = it. next ( ) . and_then ( |x| x. parse :: < u32 > ( ) . ok ( ) ) . unwrap_or ( 0 ) ;
75+ let minor = it. next ( ) . and_then ( |x| x. parse :: < u32 > ( ) . ok ( ) ) . unwrap_or ( 0 ) ;
76+
77+ if ( major, minor) >= ( 15 , 5 ) {
78+ set_cfg ( "aarch64_macos_15_5_or_newer" ) ;
79+ }
80+ }
81+ }
82+
6883 // The ABI of libc used by std is backward compatible with FreeBSD 12.
6984 // The ABI of libc from crates.io is backward compatible with FreeBSD 12.
7085 //
Original file line number Diff line number Diff line change @@ -505,6 +505,7 @@ dlopen
505505dlsym
506506dup
507507dup2
508+ environ
508509execl
509510execle
510511execlp
Original file line number Diff line number Diff line change @@ -2429,3 +2429,8 @@ cfg_if! {
24292429 // Unknown target_os
24302430 }
24312431}
2432+
2433+ extern "C" {
2434+ #[ cfg( not( aarch64_macos_15_5_or_newer) ) ]
2435+ pub static mut environ: * mut * mut crate :: c_char ;
2436+ }
You can’t perform that action at this time.
0 commit comments