Skip to content
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

OSX: Build universal binaries with ARM64 #10

Merged
merged 1 commit into from
Nov 20, 2020
Merged

OSX: Build universal binaries with ARM64 #10

merged 1 commit into from
Nov 20, 2020

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Jul 8, 2020

Untested for now, but preparing the ground for building universal binaries with ARM64 support for macOS.

Requirements to finish this:

Sooo... it's not for today ;)

@akien-mga akien-mga requested a review from bruvzg July 8, 2020 08:57
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build with Xcode 12

Note: Currently, it not just any Xcode 12 beta, but special separate "beta for universal apps" (with iOS stuff mostly broken), Xcode 12 beta provided by travis is not the correct one.

Everything looks OK, at least with current beta toolchain.

cp -rp out/macosx/x64/tools-mono/GodotSharp/Mono/lib Godot_mono.app/Contents/Frameworks/GodotSharp/Mono
cp -rp out/macosx/x64/tools-mono/GodotSharp/Tools Godot_mono.app/Contents/Frameworks/GodotSharp
cp -rp out/macosx/x64/tools-mono/GodotSharp/Mono/etc Godot_mono.app/Contents/Resources/GodotSharp/Mono
cp -rp out/macosx/tools-mono/GodotSharp/Api Godot_mono.app/Contents/Frameworks/GodotSharp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since official releases are not signed, it's currently not relevant, but I do not think placing non-native binaries in the Frameworks is correct, probably dlls should go to Resources instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the implication of this change (especially whether the binary would still find them properly). Might need to be checked with @neikeq (who should get a M1 device in coming weeks too).

@beraekoklu
Copy link

How is the progress for this going?

@akien-mga
Copy link
Member Author

I need to give this a new try now that OSXCross has been updated with preliminary support for ARM64.

I have Xcode 12.0.1 available on the buildsystem, but I'm not sure yet if it includes the relevant SDK (at least what I extracted from it so far is the MacOSX10.15 SDK).

@bruvzg
Copy link
Member

bruvzg commented Nov 12, 2020

I have Xcode 12.0.1

I do not think it is. 12.0 had a separate beta for Universal, and it was not included into release. Probably ARM SDK is included in 12.2 RC only (SDK version and should be MacOSX11.0.sdk).

@akien-mga
Copy link
Member Author

Makes sense, thanks. I'll wait for 12.2 to be released as stable, I don't specifically need/want to be an early adopter and run into testing issues for Apple software... especially when using a non-standard toolchain like OSXCross on top of it.

@bruvzg
Copy link
Member

bruvzg commented Nov 13, 2020

I'll wait for 12.2 to be released as stable

Xcode 12.2 stable is released, and building ARM64 Godot (both master and 3.2 branches) without any issues. I have checked release-debug tool builds without Mono only (Mono build seems to work all the way to the linking, where it fails since my Mono install is x86_64 only).

On Silicon Macs all executables must be signed, but any signature is fine (Gatekeeper will be complaining if it's not Apple approved signature and the app is not notarized, in the same way it does on macOS 10.15).

Xcode linker is adding ad-hoc signatures automatically, and it's preserved when lipo is used to create universal binary, OSXCross should do the same, but I not sure how automated it is.

akien-mga added a commit to godotengine/build-containers that referenced this pull request Nov 19, 2020
- macOS 11.0 SDK for Big Sur update
- iOS 14.2 SDK

Cf. godotengine/godot-build-scripts#10
@akien-mga akien-mga changed the title [WIP] OSX: Build universal binaries with ARM64 OSX: Build universal binaries with ARM64 Nov 20, 2020
@akien-mga
Copy link
Member Author

I've now used the containers from godotengine/build-containers#60 and the build scripts from this PR to build 3.2.4-beta2 for macOS arm64:
https://downloads.tuxfamily.org/godotengine/3.2.4/beta2/Godot_v3.2.4-beta2_osx.universal.zip

This is only the standard build, I haven't looked into building Mono for arm64 yet. I'll do that in a separate PR (and maybe not right now as it seems @bruvzg had troubles on real hardware too, so it might be worth waiting for first issues to be ironed out at Mono upstream).

@akien-mga akien-mga merged commit 463b957 into master Nov 20, 2020
@akien-mga akien-mga deleted the macos-arm64 branch November 20, 2020 16:18
@beraekoklu
Copy link

Thanks!

@monokrome
Copy link

Thank you all for being so amazing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants