Skip to content

Commit eeeea01

Browse files
committed
macOs various updates.
- CI only for macOs arm64. - Fixing build issues for macOs arm64. - Adding macos cpu to arch api.
1 parent 0e28c86 commit eeeea01

File tree

5 files changed

+21
-16
lines changed

5 files changed

+21
-16
lines changed

Diff for: .github/workflows/full_ci.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131
contents: read # to fetch code (actions/checkout)
3232

3333
name: macOS
34-
runs-on: macos-13
34+
runs-on: macos-14
3535
strategy:
3636
fail-fast: true
3737
matrix:
3838
target: [
39-
x86_64-apple-darwin,
39+
aarch64-apple-darwin,
4040
]
4141
steps:
4242
- uses: actions/checkout@v4
@@ -218,10 +218,10 @@ jobs:
218218
max-parallel: 4
219219
matrix:
220220
target:
221-
- { toolchain: stable, os: macos-13 }
222-
- { toolchain: beta, os: macos-13 }
223-
- { toolchain: nightly, os: macos-13 }
224-
- { toolchain: 1.71.0, os: macos-13 }
221+
- { toolchain: stable, os: macos-14 }
222+
- { toolchain: beta, os: macos-14 }
223+
- { toolchain: nightly, os: macos-14 }
224+
- { toolchain: 1.71.0, os: macos-14 }
225225
runs-on: ${{ matrix.target.os }}
226226
steps:
227227
- uses: actions/checkout@v4

Diff for: ci/build.sh

-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ x86_64-unknown-redox \
147147

148148
RUST_APPLE_TARGETS="\
149149
aarch64-apple-ios \
150-
x86_64-apple-darwin \
151-
x86_64-apple-ios \
152150
"
153151

154152
RUST_NIGHTLY_APPLE_TARGETS="\

Diff for: libc-test/build.rs

+8
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ fn test_apple(target: &str) {
294294
"tcp_connection_info" => true,
295295
// FIXME: The size is changed in recent macOSes.
296296
"malloc_introspection_t" => true,
297+
// sonoma changes the padding `rmx_filler` field.
298+
"rt_metrics" => true,
297299

298300
_ => false,
299301
}
@@ -2215,6 +2217,12 @@ fn test_freebsd(target: &str) {
22152217
// should've been used anywhere anyway.
22162218
"TDF_UNUSED23" => true,
22172219

2220+
// Removed in FreeBSD 15
2221+
"TDF_CANSWAP" | "TDF_SWAPINREQ" => true,
2222+
2223+
// Unaccessible in FreeBSD 15
2224+
"TDI_SWAPPED" | "P_SWAPPINGOUT" | "P_SWAPPINGIN" => true,
2225+
22182226
// Removed in FreeBSD 14 (git a6b55ee6be1)
22192227
"IFF_KNOWSEPOCH" => true,
22202228

Diff for: src/fixed_width_ints.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub type uint32_t = u32;
2020
pub type uint64_t = u64;
2121

2222
cfg_if! {
23-
if #[cfg(all(target_arch = "aarch64", not(target_os = "windows")))] {
23+
if #[cfg(all(target_arch = "aarch64", not(any(target_os = "windows", target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))))] {
2424
// This introduces partial support for FFI with __int128 and
2525
// equivalent types on platforms where Rust's definition is validated
2626
// to match the standard C ABI of that platform.
@@ -92,5 +92,10 @@ cfg_if! {
9292

9393
// static_assert_eq!(core::mem::size_of::<__uint128_t>(), _SIZE_128);
9494
// static_assert_eq!(core::mem::align_of::<__uint128_t>(), _ALIGN_128);
95+
} else if #[cfg(all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos")))] {
96+
/// C __int128_t (alternate name for [__int128][])
97+
pub type __int128_t = i128;
98+
/// C __uint128_t (alternate name for [__uint128][])
99+
pub type __uint128_t = u128;
95100
}
96101
}

Diff for: src/unix/bsd/apple/mod.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -493,8 +493,7 @@ s! {
493493
pub rmx_rtt: u32,
494494
pub rmx_rttvar: u32,
495495
pub rmx_pksent: u32,
496-
pub rmx_state: u32,
497-
pub rmx_filler: [u32; 3],
496+
pub rmx_filler: [u32; 4],
498497
}
499498

500499
pub struct rt_msghdr {
@@ -6296,7 +6295,6 @@ extern "C" {
62966295
out_processor_infoCnt: *mut mach_msg_type_number_t,
62976296
) -> ::kern_return_t;
62986297

6299-
pub static mut mach_task_self_: ::mach_port_t;
63006298
pub fn task_for_pid(
63016299
host: ::mach_port_t,
63026300
pid: ::pid_t,
@@ -6413,10 +6411,6 @@ extern "C" {
64136411
) -> ::c_int;
64146412
}
64156413

6416-
pub unsafe fn mach_task_self() -> ::mach_port_t {
6417-
mach_task_self_
6418-
}
6419-
64206414
cfg_if! {
64216415
if #[cfg(target_os = "macos")] {
64226416
extern "C" {

0 commit comments

Comments
 (0)