-
Notifications
You must be signed in to change notification settings - Fork 143
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
Support for Apple Silicon (macOS on AArch64) #195
Comments
Azul have builds of OpenJDK for AArch64 available now. I should be able to download and extract one of those archives and use its contents as the Azul provides an API for locating downloads, but the macOS AArch64 builds don't appear to be visible there yet: In the meantime, a hacky workaround is to scrape the download URL from the downloads page: download_page="$(curl -sL https://www.azul.com/downloads/zulu-community/)"
# JDK “bandles” (bands of bundles? Typo?) are defined as JSON in the page.
bandles="$(echo "$download_page" | grep -m 1 "bandles:" | sed -e 's/^\s*bandles:\s*sortArray(\s*//;s/),$//')"
# Use jq to filter the JSON for the JDK 8 bandle for macOS on AArch64, and extract its download link.
jdk_url="$(echo "$bandles" | jq -r 'map(select((.["category_slug"] == "java-8-lts") and (.["os_slug"] | map(. == "macos") | any) and (.["arch_slug"] == "arm-64-bit")))[0]["bundles"][0]["link"]')" |
I've rebased onto the latest version of my refactored native builds (#189) in the I need to confirm that this build still works correctly on Intel-based macOS. I don't anticipate any problems, but I do still need to confirm that I haven't broken anything. After that, I'll have taken this basically as far as I can. There are no changes required to the Java loading code to support this, because |
Last week, I rebased my branch onto #238, and included the loader changes that @ArtRoman pointed out in #219. I was then able to smoke-test that build on macOS 12.6 on ARM64 and Mac OS X 10.9 on x86_64. I plan to submit a PR for that branch after #238 merges. Per the project milestones I set up a few years ago, I was planning for the next library release (v5.3.0) to be a purely bugfix release, and to put this work into the subsequent release (v5.4.0); but we've picked up two other platform support changes in the meantime (#218, #236), and this work is basically done, so we might as well include it. |
This issue is a rallying point for future AArch64 porting as much as anything. I've taken a quick stab at hacking a Universal 2 build onto my refactored native build process (#189). Superficially, I think that what I have might be okay, but the build failed miserably. It failed deep in the bowels of a system header indirectly included from
jni.h
; assuming I got my compiler flags set correctly, I interpret this as meaning that Java (or at least, JNI) on AArch64 macOS is not yet ready for prime time. I'll check again in a month or two when a new Xcode beta is released and Travis bumps the Xcode build version for thexcode12u
image from “Xcode 12 for macOS Universal Apps Beta 2”/12A8161k.The text was updated successfully, but these errors were encountered: