-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add Apple Silicon (M1/M2) support #128
base: master
Are you sure you want to change the base?
Conversation
5d522b0
to
4024091
Compare
Alright, rebased on To sum up the changes:
Here's a sample CI run if you wish to test the binaries. |
4024091
to
6913fb7
Compare
This allows detecting newer platforms like Apple Silicon. Also update the commands to use `cmake -E env`.
- Download from github rather than pyyaml. - Update to the latest version (0.2.5). - Use `cmake -E env` to invoke the wrapper command.
- Run autoreconf to fix flat namespace issues on macOS 11+. - Don't use the command wrapper to build, this breaks on arm64 linux.
Using |
This adds support for Apple Silicon.
This adds Apple Silicon support.
This is needed by the latest gcc, binutils, and gdb, and will avoid using the host's version.
- The version update provides support for Apple Silicon. - The patch offsets were also updated. - The configure command had to be updated to find GMP/MPFR/MPC. The GDB configure script called during build uses different flags to set lib paths.
This adds support for Apple Silicon and zstd.
- This adds support for Apple Silicon hosts. - The patch was renamed (and updated) to reflect the change. - Add zstd support.
- zstd external project requires CMake 3.7, so GIT_SHALLOW can be used unconditionally. - Use `option` to declare OFFLINE. - Expand `OFFLINE` in the ExternalProject calls instead of using an intermediate variable. - Set CMP0135 to NEW.
Binutils 2.41 requires a version newer than what is provided by macOS.
Also run autoreconf to fix a sporadic issue with automake.
Use the github URL as it will not change when the next version releases.
1c4a6c1
to
0fb473f
Compare
Thank you for your feedback! I just rebased on
For zlib, I also switched the URL to the github release, so it does not break when the next release comes out. Here's the latest CI run on my fork if you want to test the builds. |
It says it's UPDATE: i have built vitasdk from deps-upgrade. Using it for now. |
This PR doesn't seem to work with current Xcode anymore:
|
Compiling natively on my M1 machine failed with the following issues:
CONFIGURE_COMMAND
using${compiler_flags} ${command_wrapper}
fail due to_CFLAGS
being treated as a command rather than an environment variable.arm64/aarch64-apple-darwin
triple.Moreover, the latest macOS x64 release no longer works on Apple Silicon due to missing shared libraries.
For the
CONFIGURE_COMMAND
issue, the fix consists in invoking thecommand_wrapper
usingcmake -E env
. This achieves the expected behaviour where thecompiler_flags
variables are treated as environment variables, and passed to thecommand_wrapper
script.A similar issue happened for
vita-headers
with the call topython
, starting macOS 12.3 there is no longer apython
binary inPATH
. To fix this, I used CMake to find the Python executable and used it instead.For the dependencies, they typically needed to be updated to their latest version so the platform could be correctly detected.
Two notable exceptions were
gmp
andlibelf
:ForSince GMP 6.3.0, runninggmp
, the patch used by Homebrew is used.autoreconf
has the same effect as the patch.libelf
, theconfig.guess
andconfig.sub
files are updated using the ones from automake 1.16.Lastly, there were some project-specific issues:
zlib
shared libraries would not be deletedlibyaml
from thepyyaml
website, so I switched the download source to github. It is functionally identical.gdb
did not declare its dependencies on the other projects, and would also fail to find said dependencies.With these changes, I was able to build the toolchain natively on my M1 mac, compile the SDL2 port and link it against executables.
A few additional notes:
config.sub
scripts are able to canonicalisearm64-apple-darwin
intoaarch64-apple-darwin
.The patch is no longer needed for 4.2.1.mpfr
provides a cumulative patch for version 4.2.0 that addresses a handful of bugs. This patch is included in this PR.-target
CFLAGS to every configure script). Let me know if this should be part of this PR or a subsequent one.This PR closes #101, closes #107, and closes #122.