Make test suite pass on macOS on aarch64#2008
Conversation
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
|
Thanks!
I think we could use the same workaround in #2000. |
This one: #2000 (comment) |
|
I can do that, but it does not pass the tests either. It also does not have the correct alignment. |
Hmm, then could you tweak the alignment with |
|
This passes on macOS 10.15.7 (Catalina), what errors are you seeing @bsteinb? |
|
@Thomasdezeeuw The error should occur on Apple Silicon. But yeah, I'd like to see the error too. |
|
Oops, turns out it's Intel silicon. |
|
Right now, if I run u128(*__test_field_type___darwin_arm_neon_state64___v(struct __darwin_arm_neon_state64* b))[32] {
return &b->__v;
} Which the C compiler refuses to compile, saying: It does not recognize If I change the pull request to have uint64_t(*__test_field_type___darwin_arm_neon_state64___v(struct __darwin_arm_neon_state64* b))[32][2] {
return &b->__v;
}About which the compiler complains: Also, as I mentioned above, So, two possible solutions:
|
|
Translating to |
|
I have pushed a change to use This does not match the declaration in the C headers 100%, but is closer than what exists now and probably as close as possible without using Once |
|
What about #1414 ? Would that approach work? |
|
So, we should make it "at least it works" in this PR as |
af5faa8 to
a15491e
Compare
|
With the tests ignoring the Would you like the fixes for those as separate pull requests or should I include them here? |
Either way is fine to me if you separate commits! |
|
The test suite now fails on x86_64, because of the changes to the How is this normally handled? |
|
Let's skip the test for now, you should tweak here: Lines 193 to 204 in 7e7452f Big Sur is available as a preview on GHA but it may cause another issue and I'd avoid it. |
|
@bors r+ |
|
📌 Commit d57347a has been approved by |
Make test suite pass on macOS on aarch64 While working on #2007 I tried to run `cargo test` in `libc-test`, which failed, because the definition of `__darwin_mcontext64` was incomplete (see #1990). This adds definitions for the exception state and the floating point state as well. `libc-test` still does not pass, because I use the type `[u128; 32]` for the `__v` field of `__darwin_arm_neon_state64` (in C it is `__uint128_t __v[32]`. `ctest2` does not translate `u128` to `__uint128_t` and the generated C code does not compile. Any ideas for working around this?
|
💔 Test failed - checks-actions |
src/unix/bsd/apple/b64/mod.rs
Outdated
| pub type c_long = i64; | ||
| pub type c_ulong = u64; | ||
| pub type boolean_t = ::c_uint; | ||
| pub type mcontext_t = *mut __darwin_mcontext64; |
There was a problem hiding this comment.
I'm not sure about aarch64-apple-ios but if it's the same as macOS, we could move this to align.rs on AArch64 (and mod.rs on x86_64).
|
Let's try again, @bors r+ |
|
📌 Commit ee84dae has been approved by |
|
☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13 |
While working on #2007 I tried to run
cargo testinlibc-test, which failed, because the definition of__darwin_mcontext64was incomplete (see #1990). This adds definitions for the exception state and the floating point state as well.libc-teststill does not pass, because I use the type[u128; 32]for the__vfield of__darwin_arm_neon_state64(in C it is__uint128_t __v[32].ctest2does not translateu128to__uint128_tand the generated C code does not compile. Any ideas for working around this?