diff --git a/.github/workflows/full_ci.yml b/.github/workflows/full_ci.yml index d22084889d292..042d81b158c0c 100644 --- a/.github/workflows/full_ci.yml +++ b/.github/workflows/full_ci.yml @@ -31,12 +31,12 @@ jobs: contents: read # to fetch code (actions/checkout) name: macOS - runs-on: macos-13 + runs-on: macos-14 strategy: fail-fast: true matrix: target: [ - x86_64-apple-darwin, + aarch64-apple-darwin, ] steps: - uses: actions/checkout@v4 @@ -179,10 +179,10 @@ jobs: max-parallel: 4 matrix: target: - - { toolchain: stable, os: macos-13 } - - { toolchain: beta, os: macos-13 } - - { toolchain: nightly, os: macos-13 } - - { toolchain: 1.71.0, os: macos-13 } + - { toolchain: stable, os: macos-14 } + - { toolchain: beta, os: macos-14 } + - { toolchain: nightly, os: macos-14 } + - { toolchain: 1.71.0, os: macos-14 } runs-on: ${{ matrix.target.os }} steps: - uses: actions/checkout@v4 diff --git a/ci/build.sh b/ci/build.sh index e22b893222312..696a23eb534d8 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -147,8 +147,6 @@ x86_64-unknown-redox \ RUST_APPLE_TARGETS="\ aarch64-apple-ios \ -x86_64-apple-darwin \ -x86_64-apple-ios \ " RUST_NIGHTLY_APPLE_TARGETS="\ diff --git a/libc-test/build.rs b/libc-test/build.rs index 767a4baf49b74..20cb56e9869ad 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -294,6 +294,8 @@ fn test_apple(target: &str) { "tcp_connection_info" => true, // FIXME: The size is changed in recent macOSes. "malloc_introspection_t" => true, + // sonoma changes the padding `rmx_filler` field. + "rt_metrics" => true, _ => false, } diff --git a/src/fixed_width_ints.rs b/src/fixed_width_ints.rs index 7a6f6cfaedb9b..f24fa5dd2d1d7 100644 --- a/src/fixed_width_ints.rs +++ b/src/fixed_width_ints.rs @@ -20,7 +20,7 @@ pub type uint32_t = u32; pub type uint64_t = u64; cfg_if! { - if #[cfg(all(target_arch = "aarch64", not(target_os = "windows")))] { + if #[cfg(all(target_arch = "aarch64", not(any(target_os = "windows", target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))))] { // This introduces partial support for FFI with __int128 and // equivalent types on platforms where Rust's definition is validated // to match the standard C ABI of that platform. @@ -92,5 +92,10 @@ cfg_if! { // static_assert_eq!(core::mem::size_of::<__uint128_t>(), _SIZE_128); // static_assert_eq!(core::mem::align_of::<__uint128_t>(), _ALIGN_128); + } else if #[cfg(all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos")))] { + /// /// C `__int128_t` + pub type __int128_t = i128; + /// /// C `__uint128_t` + pub type __uint128_t = u128; } } diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index d19c0e9dd9cea..ff3326475970d 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -493,8 +493,7 @@ s! { pub rmx_rtt: u32, pub rmx_rttvar: u32, pub rmx_pksent: u32, - pub rmx_state: u32, - pub rmx_filler: [u32; 3], + pub rmx_filler: [u32; 4], } pub struct rt_msghdr { @@ -6296,7 +6295,6 @@ extern "C" { out_processor_infoCnt: *mut mach_msg_type_number_t, ) -> ::kern_return_t; - pub static mut mach_task_self_: ::mach_port_t; pub fn task_for_pid( host: ::mach_port_t, pid: ::pid_t, @@ -6413,10 +6411,6 @@ extern "C" { ) -> ::c_int; } -pub unsafe fn mach_task_self() -> ::mach_port_t { - mach_task_self_ -} - cfg_if! { if #[cfg(target_os = "macos")] { extern "C" {