Skip to content
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

Apple Silicon support #102

Merged
merged 12 commits into from May 4, 2021
Merged

Apple Silicon support #102

merged 12 commits into from May 4, 2021

Conversation

headius
Copy link
Member

@headius headius commented Mar 23, 2021

This merges in the leading edge of https://github.com/libffi/libffi, including a few tweaks from @atsweet and others for Apple arm64 support. We cannot yet use a submodule for our libffi due to libffi/libffi#630.

We would like to go with a release, but this version passes all tests on the platforms we have available and appears to be working well on Apple Silicon.

Notes:

  • On darwin-arm64 this change uses ffi_closure_alloc to avoid crashing when attempting to set the closure's memory page executable. This change came from ffi/ffi@2c9c517 by @Watson1978.
  • The build generates a fat binary containing both x86_64 and arm64 support. Darwin i386 support is removed along with ppc.
  • One test for >64-bit precision doubles has been skipped due to Apple Silicon not supporting 80-bit long doubles.

One there is a proper libffi release that incorporates our mips64el tweaks from #83 we will switch to using a git submodule.

@headius headius added this to the 1.3.2 milestone Mar 23, 2021
@headius headius force-pushed the apple_arm64 branch 2 times, most recently from 3ad89d3 to 60b8f95 Compare March 23, 2021 20:04
@headius
Copy link
Member Author

headius commented Mar 23, 2021

Fixes #92.

@headius headius linked an issue Mar 23, 2021 that may be closed by this pull request
@headius headius force-pushed the apple_arm64 branch 2 times, most recently from fa7fc24 to 76c49d6 Compare March 23, 2021 20:15
@headius
Copy link
Member Author

headius commented Mar 23, 2021

Holding off on merging this due to failures in jnr-ffi that may require further libffi patches:

https://gist.github.com/headius/153c43133aafa6d7820bf00c6a68cb7b

@headius
Copy link
Member Author

headius commented Mar 23, 2021

@larskanis This is nearly 100% other than the varargs failures in jnr-ffi. Perhaps you will be able to learn something from this for the ffi gem?

Have you any thoughts on these varargs failures? It seems like it is just passing the wrong varargs layout through to snprintf but I have not dug into it.

@headius headius modified the milestones: 1.3.2, 1.3.3 Mar 26, 2021
@headius
Copy link
Member Author

headius commented May 4, 2021

Merging to continue progress. Unsure at this point if the variadic failures are due to bugs in jffi or jnr-ffi.

@headius headius merged commit e2f5388 into jnr:master May 4, 2021
@headius headius modified the milestones: 1.3.3, 1.4.0 May 4, 2021
@headius headius removed this from the 1.4.0 milestone May 19, 2021
@headius headius added this to the 1.3.3 milestone May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for OSX arm64
1 participant