Cross compile GMP for Apple Silicon
pierre at chachatelier.fr
Sun Nov 22 14:44:14 UTC 2020
I succeeded in cross-compiling GMP from amd64 on a x86_64 build system.
I had overloads of defaults tools in /opt because I use macports.
Here is my build script if it can help others.
For the sake of clarity, I have removed all macros, to show absolute paths. For better compatibility, tools like "xcode-select -p" could be used.
export CFLAGS=" -fno-stack-check -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk --target=arm64-apple-darwin"
export LDFLAGS=" -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -arch arm64"
./configure --enable-fat --build=x86_64-apple-darwin13.0.0 --host=arm64-apple-darwin
> On 19 Nov 2020, at 00:31, Torbjörn Granlund <tg at gmplib.org> wrote:
> Pierre Chatelier <pierre at chachatelier.fr> writes:
> The latest release 6.2.1. I did not try develop branches.
> Ok, so this is a work in progress.
> Not work-in-progress; arm64-apple-darwin is supported in 6.2.1. Several
> people have reported that it works.
> I suspect that you did not set up a proper cross compiling environment.
> A glance in the fine GMP manual on this subject might help. Also,
> reading the output of configure and make should give you some hints.
> Please encrypt, key id 0xC8601622
More information about the gmp-discuss