Skip to content

Commit 56d665c

Browse files
devnexentgross35
authored andcommitted
macOs various updates.
- CI only for macOs arm64. - Fixing build issues for macOs arm64. - Adding macos cpu to arch api.
1 parent be1c8e5 commit 56d665c

File tree

5 files changed

+15
-16
lines changed

5 files changed

+15
-16
lines changed

.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
@@ -179,10 +179,10 @@ jobs:
179179
max-parallel: 4
180180
matrix:
181181
target:
182-
- { toolchain: stable, os: macos-13 }
183-
- { toolchain: beta, os: macos-13 }
184-
- { toolchain: nightly, os: macos-13 }
185-
- { toolchain: 1.71.0, os: macos-13 }
182+
- { toolchain: stable, os: macos-14 }
183+
- { toolchain: beta, os: macos-14 }
184+
- { toolchain: nightly, os: macos-14 }
185+
- { toolchain: 1.71.0, os: macos-14 }
186186
runs-on: ${{ matrix.target.os }}
187187
steps:
188188
- uses: actions/checkout@v4

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="\

libc-test/build.rs

+2
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
}

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`
97+
pub type __int128_t = i128;
98+
/// /// C `__uint128_t`
99+
pub type __uint128_t = u128;
95100
}
96101
}

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)