-
Notifications
You must be signed in to change notification settings - Fork 986
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
How to cross compile on macOS for a different macOS architecture #847
Comments
You're right that Here's a recipe that should work:
This recipe should work in general, except that more work may be needed to select the right C compiler in the middle step, depending on how the target platform relates to the current one. |
Thanks, I'm trying that out. We are also currently using the configure args |
The second |
I am running macOS 12 on an x86_64 Mac. How can I compile chez scheme for arm64 macOS? I have read the BUILDING document and have not gained an understanding of how to do this. The document refers often to
<machine type>
without explaining whether this refers to the type of the build machine or the type of the machine for which the build is being done. I already have lz4 and zlib installed universal (compiled for both arm64 and x86_64 in the same binary).What I have tried:
Naturally I can't run an arm64 executable on an x86_64 machine. This happens because, if
CFLAGS
is empty, this code setsCFLAGS
to contain-arch arm64
:ChezScheme/configure
Lines 810 to 811 in f1ad314
and, if
CC_FOR_BUILD
is empty, this code setsCC_FOR_BUILD="$CC $CFLAGS"
:ChezScheme/configure
Lines 833 to 834 in f1ad314
So I try setting
CC_FOR_BUILD
myself to a value that does not include-arch
flags which failed:This happens because, if
CC_FOR_BUILD
is set, this code setsenableFrompb=no
.ChezScheme/configure
Lines 833 to 836 in f1ad314
Am I now supposed to add
--pb
or--pbarch
to the configure flags? If so, which one? The descriptions of these flags do not provide any guidance for how one should choose between them.I tried adding
--pbarch
which failed:I tried instead adding
--pb
which failed:pb/bin/pb/scheme
has been compiled for arm64; of course it cannot be executed on an x86_64 machine:The text was updated successfully, but these errors were encountered: