Add support for cross-compiling on Mac #186#187
Add support for cross-compiling on Mac #186#187andrewgrant wants to merge 1 commit intoxiph:masterfrom
Conversation
Adds support for cross-compiling to different targets when building on Mac. E.g the following builds Opus for an arm64 Mac target (Apple silicon) ./configure --host=aarch64-apple-macos make && make install
|
NEON has been in all Apple silicon since 3GS, so it would be reasonable. |
|
Good point RE Neon. I'll add that and resubmit in the next day or so. |
|
Can you please also document your rationale in the commit message, or a comment. I assume this is to work around autoconf's built-in cross-compiler detection not supporting Apple's new configuration, but it seems like there are several ways to do that. Why the separate |
|
It's not part of this PR, but I found that the CMake build system is also doing dubious stuff here that pessimizes x64 builds on arm64: Line 42 in ccaaffa From my understanding, The resulting binary is still compiled for x64, but without SIMD optimiations. Edit: I think that's being tracked in this issue: #198 |
|
@j-schultz so the issue is cross compiling to x64 on a m1/m2 mac for cmake? will try to test this |
Correct. And probably the other way around, too (missing NEON optimizations when cross-compiling for arm64) |
|
@j-schultz m1 stuff seems pretty hairy, unlikely I will get fixes in this release. |
|
Is cross-compiling now supposed to work on Mac M1 ? Any advice ? |
Adds support for cross-compiling to different targets when building on Mac.
E.g the following builds Opus for an arm64 Mac target (Apple silicon)
./configure --host=aarch64-apple-macos make && make install
This allows building Opus for both architectures and using lipo to create a universal binary.