Get GMP building on Apple Silicon#57315
Get GMP building on Apple Silicon#57315claui merged 10 commits intoHomebrew:masterfrom BytesGuy:gmp-arm
Conversation
|
This might be really helpful, given that lots of popular formulae depend on gmp. |
Yeah, it's probably about as good as it gets for now 😄 I started working on this because I was trying to install GCC which depends on it - working on that next! |
|
Alternatively there is a patch for this on the gmp-bugs mailing list: https://gmplib.org/list-archives/gmp-bugs/2020-July/004837.html |
I have just been trying to get this to work with little success for some reason. Are you doing anything noteworthy that I might be missing here? Fairly new to this so apologies if it's something obvious! Applying the patch and having no Adding just |
|
Since it's a configure.ac patch, it needs to regenerate configure before running it, with:
and build-dependencies on |
|
Example: homebrew-core/Formula/libopendkim.rb Lines 30 to 31 in 628584b |
|
With Lines 50 to 52 in dc859fc It’s hard to see with some fonts but somehow it seems to be about the number of leading |
|
@fxcoudert @claui Thank you for the pointers! 🙂 I really need to brush up on these things again, it's been a long time! Just pushed a new commit which now seems to build ok. Tests fail though, as mentioned. Hopefully this is at least a step in the right direction 🤞 |
|
I think the branch statement in Evidence$ nm /usr/local/lib/libgmp.a | grep gmpn_pi
U ___gmpn_pi1_bdiv_q_1
U ___gmpn_pi1_bdiv_q_1
U ___gmpn_pi1_bdiv_q_1
U ___gmpn_pi1_bdiv_q_1
U ___gmpn_pi1_bdiv_q_1
U ___gmpn_pi1_bdiv_q_1
0000000000000048 T ___gmpn_pi1_bdiv_q_1
U __gmpn_pi1_bdiv_q_1 ←
U ___gmpn_pi1_bdiv_q_1
U ___gmpn_pi1_bdiv_q_1
|
A branch statement in the arm64 flavour of `bdiv_q_1.asm` caused
the following error on `brew test`:
```
Undefined symbols for architecture arm64:
"__gmpn_pi1_bdiv_q_1", referenced from:
___gmpn_bdiv_q_1 in libgmp.a(bdiv_q_1.o)
(maybe you meant: ___gmpn_pi1_bdiv_q_1)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
This commit fixes the issue by prepending `GSYM_PREFIX`.
It’s warranted to incorporate this patch early because a large number
of formulae depends on `gmp`, and waiting for an upstream fix would
introduce undue delay in testing those dependent formulae.
BytesGuy
left a comment
There was a problem hiding this comment.
Awesome, thank you! 🎉
|
The CI failures in |
|
Pinging @fxcoudert for a second review/opinion. |
|
Double-checked that the consolidated patch works on arm64. Waiting on CI (style/audit only) to pass, and for Homebrew/formula-patches#288 to be merged. |
This comment has been minimized.
This comment has been minimized.
This commit consolidates the two patches proposed in Homebrew/homebrew-core#57315. Suggested-by: FX Coudert <fxcoudert@gmail.com>
The commit hash for the patch needed an update due to Homebrew/formula-patches#288 being rebased and merged.
|
Thanks to all of you! This is a textbook example for excellent collaboration among contributors and with upstream. ❤️ |
Thank you for working on this too! So glad to see this fixed as it should unblock a number of other packages 🎉 |
brew install --build-from-source <formula>, where<formula>is the name of the formula you're submitting?brew test <formula>, where<formula>is the name of the formula you're submitting?brew audit --strict <formula>(after doingbrew install <formula>)?This is a bit of a halfway fix to get GMP building and working on Apple Silicon. The architecture is not yet supported officially, so while we wait this will produce a generic C build - according to the documentation this may run slowly, but at least it gets it working for now!