diff --git a/.github/workflows/full_ci.yml b/.github/workflows/full_ci.yml index b1a290d9df58b..e7287e0cdbf88 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 @@ -217,10 +217,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/Cargo.toml b/Cargo.toml index 45691e3e7e948..94335a711244a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,8 +106,6 @@ targets = [ "wasm32-unknown-emscripten", "wasm32-unknown-unknown", "wasm32-wasi", - "x86_64-apple-darwin", - "x86_64-apple-ios", "x86_64-fortanix-unknown-sgx", "x86_64-linux-android", "x86_64-pc-solaris", 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 7d61f27b6d5bf..bbfda0fefbcd7 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -203,6 +203,7 @@ fn test_apple(target: &str) { "limits.h", "locale.h", "malloc/malloc.h", + "mach-o/utils.h", "net/bpf.h", "net/dlil.h", "net/if.h", diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index da5e2c77caa74..4861c81faa08d 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -1892,6 +1892,8 @@ lockf log2phys login_tty lutimes +macho_arch_name_for_cpu_type +macho_cpu_type_for_arch_name madvise malloc_default_zone malloc_good_size diff --git a/src/fixed_width_ints.rs b/src/fixed_width_ints.rs index 7a6f6cfaedb9b..da4619051e8cd 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 (alternate name for [__int128][]) + pub type __int128_t = i128; + /// C __uint128_t (alternate name for [__uint128][]) + pub type __uint128_t = u128; } } diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 5cad5d320e472..db689e9089ba5 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -491,8 +491,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 { @@ -6113,7 +6112,8 @@ extern "C" { out_processor_infoCnt: *mut mach_msg_type_number_t, ) -> ::kern_return_t; - pub static mut mach_task_self_: ::mach_port_t; + // FIXME: 2024 edition forbids static mut, no easy fix for both nightly/stable neither + //pub static mut mach_task_self_: ::mach_port_t; pub fn task_for_pid( host: ::mach_port_t, pid: ::pid_t, @@ -6228,11 +6228,24 @@ extern "C" { search_path: *const ::c_char, argv: *const *mut ::c_char, ) -> ::c_int; + + pub fn macho_cpu_type_for_arch_name( + archName: *const ::c_char, + tpe: *mut ::cpu_type_t, + subtpe: *mut ::cpu_subtype_t, + ) -> bool; + pub fn macho_arch_name_for_cpu_type( + tpe: ::cpu_type_t, + subtpe: ::cpu_subtype_t, + ) -> *const ::c_char; } +// FIXME: 2024 edition forbids static mut, no easy fix for both nightly/stable neither +/* pub unsafe fn mach_task_self() -> ::mach_port_t { mach_task_self_ } +*/ cfg_if! { if #[cfg(target_os = "macos")] {