-
Notifications
You must be signed in to change notification settings - Fork 51
Add Mac-arm64, Linux-aarch64 support and fix mac-intel #140
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
Open
drpaneas
wants to merge
13
commits into
vitasdk:master
Choose a base branch
from
drpaneas:apple_arm64
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Remove obsolete compiler-specific code for Metrowerks CodeWarrior that was used back in 90s. The removed workarounds for fdopen() and <unix.h> inclusion are no longer needed as modern macOS (pre OS X) provides standard POSIX support. Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
Resolves "invalid host type" errors during libelf configuration by ensuring autotools recognizes aarch64-apple-darwin triple. The solution is platform-specific to avoid unnecessary changes on working systems and includes robust error handling. Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
Conditionally disable GMP assembly optimizations on ARM64 macOS to resolve build failures due to incompatible x86 assembly code. GMP's platform-specific assembly doesn't support ARM64, so we fall back to the portable C implementation on Apple Silicon M while maintaining assembly optimizations on other platforms. Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
- Fix zlib fdopen macro conflict with macOS headers - Wrap safe-ctype.h macros in #ifndef __cplusplus to avoid C++ std library conflicts - Remove -no-pie flags from configure scripts - Add aarch64-darwin to config.host for host-darwin.o compilation - Remove zlib .dylib files to force static linking Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
libzip is git-cloned, and patch modifies files causing conflicts on rebuild. Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
- Fix Linux aarch64 - Fix macOS x86_64 by patching GMP to disable assembly optimizations. - Fix macOS arm64 by setting 4 cores instead of all of them (GH hiccup) - Cosmetic changes for the CI Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
Author
|
Please review :) |
Signed-off-by: Panagiotis Georgiadis <pgeorgia@redhat.com>
Author
|
Another successful CI run after the latest refactor to minify the changes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR started for adding supporting only for Mac-arm64, however when I managed it, I've noticed linux-aarch64 was also incredibly easy to add, and also fix mac-intel which was using an outdated image (macos-12).
This has been tested and works in my Apple M2 Pro - 15.6 (24G84). It should work for others as well. I've tried to make the absolute minimum of changes possible and all the changes are in individual commits. They are affecting only Darwin arm64, so all other platforms should have absolutely zero changes (unaffected). In other words, risk merging it is minimal: all changes are platform-isolated to ARM64 macOS. That said, this PR has Zero changes to target architecture (arm-vita-eabi), Zero changes to generated binaries for PS Vita; only affects the build host environment.
I will provide some instructions to help you review this quickly but also understand the changes:
Read commits in this logical order (not chronological), so you can understand the problem I faced:
VitaSDK toolchain fails to build on Apple Silicon (M1/M2/M3) Macs due to:
aarch64-apple-darwintripleAfter this PR: Developers can build VitaSDK natively on ARM64 Macs.
Autotools Support
381d12a - "Fix ARM64 macOS support with conditional config file updates"
update_config_files.shscript68d1fca - "Fix permission error in new config.{sub,guess}"
Library Fixes
87c9446 - "fix(zlib): Remove legacy Mac fdopen workaround"
85ef304 - "Fix GMP compilation on Apple Silicon by disabling assembly"
Darwin AND arm6403cea05 - "Fix ARM64 macOS support for MPFR"
Toolchain Fixes
50a3dc9 - "fix binutils patch fdopen conflict"
0004-fix-zlib-fdopen-macos.patch6a13fa7 + c3b74e5 - "Fix GCC 10.3.0 build" + "Use patch; not script"
0002-fix-macos-arm64.patchf09b66d - "Fix gdb"
#pragma clang diagnosticis narrowly scopedf48f0ab - "Reset libzip git repo before patching"
What Each Component Does
🛠️ Scripts
cmake/update_config_files.sh🩹 Patches
patches/zlib.patchpatches/binutils/0004-fix-zlib-fdopen-macos.patchpatches/gcc/0002-fix-macos-arm64.patchpatches/gdb-zlib-fdopen-macos.patchpatches/gdb-enum-fix.patch⚙️ CMake Changes
All changes in
CMakeLists.txt:--disable-assemblyflag (conditional:Darwin AND arm64)How to test this
Just build it like this:
Basic CI
Minimal: Check CI passes on existing platforms (Linux, Windows, x86_64 Mac)
Ideal: Request contributor confirm these commands succeed:
The new commit here, is fixing the rest of the systems.
cdb0e19
Green CI: https://github.com/drpaneas/buildscripts/actions/runs/18910235182