Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Add a patch to improve libffi support for Apple Silicon#340

Merged
carlocab merged 1 commit intoHomebrew:masterfrom
hjelmn:libffi_apple
Jan 6, 2021
Merged

Add a patch to improve libffi support for Apple Silicon#340
carlocab merged 1 commit intoHomebrew:masterfrom
hjelmn:libffi_apple

Conversation

@hjelmn
Copy link
Copy Markdown
Contributor

@hjelmn hjelmn commented Jan 5, 2021

The PR adds a patch that brings in improvements from Apple's libffi
(specifically libffi-26). These improvements are needed to use libffi
with ghc.

Commits:
libffi/libffi@4c7bde3
libffi/libffi#565

I added additional configure logic to ensure that FFI_TRAMPOLINE_WHOLE_DYLIB
is set on Apple Silicon (it is hard-coded to 1 in libffi-26 for aarch64).

Signed-off-by: Nathan Hjelm hjelmn@cs.unm.edu

The PR adds a patch that brings in improvements from Apple's libffi
(specifically libffi-26). These improvements are needed to use libffi
with ghc.

Commits:
libffi/libffi@4c7bde3
libffi/libffi#565

I added additional configure logic to ensure that FFI_TRAMPOLINE_WHOLE_DYLIB
is set on Apple Silicon (it is hard-coded to 1 in libffi-26 for aarch64).

Signed-off-by: Nathan Hjelm <hjelmn@cs.unm.edu>
@hjelmn
Copy link
Copy Markdown
Contributor Author

hjelmn commented Jan 5, 2021

Patch looks big because it includes generated files (configure, Makefile.in, etc).

@SMillerDev
Copy link
Copy Markdown
Member

SMillerDev commented Jan 5, 2021

Can we not use the upstream patches?

@hjelmn
Copy link
Copy Markdown
Contributor Author

hjelmn commented Jan 5, 2021

Sure. I will have to create one myself for the configury changes. If that is the preferred way the formula will have to depend on autoconf for build and call autoreconf.

@carlocab
Copy link
Copy Markdown
Member

carlocab commented Jan 5, 2021

If you need autoreconf to use the upstream patches then it may be cleaner to just use this one. That way when the patch is outdated it's more easily noticed that it's no longer needed. The autoconf dependency, on the other hand, could stick for a while, even when not necessary.

@hjelmn
Copy link
Copy Markdown
Contributor Author

hjelmn commented Jan 5, 2021

Yeah. This patch includes a change to configure.ac to set FFI_TRAMPOLINE_WHOLE_DYLIB. I opened a PR to add that to the libffi PR referenced above.

@hjelmn
Copy link
Copy Markdown
Contributor Author

hjelmn commented Jan 6, 2021

What is the status on this? I want to update the formula but I am waiting on this to go in first.

@carlocab carlocab merged commit a4a91e6 into Homebrew:master Jan 6, 2021
@carlocab
Copy link
Copy Markdown
Member

carlocab commented Jan 6, 2021

Thanks, @hjelmn!

@Homebrew Homebrew locked as resolved and limited conversation to collaborators Feb 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants