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

Add support for the arm64 architecture for macOS #1517

Merged
merged 1 commit into from Dec 9, 2020

Conversation

dsanghan
Copy link
Contributor

Verified with:

> lipo -archs jre_emul/build_result/macosx/libjre_emul.a 
x86_64 arm64

Is anything else needed?

Remove conflicting target

Fix spacing
@dsanghan
Copy link
Contributor Author

dsanghan commented Nov 22, 2020

make dist completes correctly, but make frameworks outputs an error:
Both macos-arm64 and macos-x86_64 represent two equivalent library definitions.

From the forums it seems we're supposed to use lipo for this - so use build_result/macosx/lib instead of build_results/objs_/lib - but not sure how to do that

@dsanghan
Copy link
Contributor Author

dsanghan commented Nov 22, 2020

That does seem to work - making the above change does generate a xcframework but involves modifying the gen_frameworks script to use the fat lib with 2 archs instead of the static lib:

Screenshot 2020-11-22 at 5 33 39 PM

@tomball tomball self-requested a review December 8, 2020 19:24
@tomball
Copy link
Collaborator

tomball commented Dec 8, 2020

Unfortunately xcodebuild -create-framework fails because it considers macos-x86_64 and macos-arm64 to "represent two equivalent definitions." This Apple Developer Forum discussion has the fix.

Adding a lipo step to some of the framework slices involves more Make hackery than just adding a new architecture. Do you want to give it a shot, or should I add it in a follow-up commit?

@dsanghan
Copy link
Contributor Author

dsanghan commented Dec 9, 2020

Would be great if you could add a follow-up commit

Copy link
Collaborator

@tomball tomball left a comment

Choose a reason for hiding this comment

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

LGTM -- thanks!

@j2objc-copybara j2objc-copybara merged commit 989ff59 into google:master Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants