-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make test suite pass on macOS on aarch64 #2008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
@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
@@ -2,7 +2,6 @@ | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 test
inlibc-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 translateu128
to__uint128_t
and the generated C code does not compile. Any ideas for working around this?