Skip to content

GraalVM CE 22.1-dev JDK17 for Apple Silicon

Pre-release
Pre-release
Compare
Choose a tag to compare
@ganadist ganadist released this 17 Feb 10:31
· 7 commits to master since this release

This binary was created from oracle/graal@19dbed066

How to build

#!/bin/bash
# vim: ts=2 sw=2 sts=2 et ai
set -e

BREW_OPENJDK17=/opt/homebrew/Cellar/openjdk/17.0.2/libexec/openjdk.jdk/Contents/Home/

DIRNAME=$(dirname $0)
DIRNAME=$(cd $DIRNAME;pwd)
export MX_HOME=${DIRNAME}/mx
export MX_PYTHON=python3
export PATH=$MX_HOME:$PATH

fetch() {
  for DIR in mx graal labs-openjdk-17
  do
    (cd "$DIRNAME"/"$DIR" && git fetch origin && git checkout origin/master && git clean -ffdx)
  done
}

build_jdk() {
  local SRC_DIR=$1
  local JDK_VERSION=$2
  local BOOT_JDK=$3

  pushd ${DIRNAME}/${SRC_DIR}
  JVMCI_VERSION=$(git log --decorate | grep -E 'tag: jvmci-\d+\.\d+-b\d+' | sed 's/.*(\(tag: .*\))/\1/g' | tr ',' '\n' | grep 'tag:' | sed 's/.*tag: \(jvmci-[^,)]*\).*/\1/g' | sort -nr | head -1)

  bash configure \
    --with-conf-name=macos-aarch64 \
    --openjdk-target=aarch64-apple-darwin  \
    --with-version-opt="$JVMCI_VERSION" \
    --with-version-pre= \
    '--with-vendor-name=GraalVM Community' \
    --with-vendor-url=https://www.graalvm.org/ \
    --with-vendor-bug-url=https://github.com/oracle/graal/issues \
    --with-vendor-vm-bug-url=https://github.com/oracle/graal/issues \
    --with-boot-jdk="${BOOT_JDK}" \
    --with-default-make-target="product-bundles" \
    --with-zlib=system
  make CONF_NAME=macos-aarch64
  export JAVA_HOME=$PWD/build/macos-aarch64/images/jdk-bundle/jdk-${JDK_VERSION}.jdk/Contents/Home
  popd
}

build_graal() {
  pushd ${DIRNAME}/graal
  mx \
    --primary-suite-path $PWD/compiler \
    --J @"-Xmx2g" \
    --java-home=$JAVA_HOME \
    gate \
    --strict-mode \
    --tags bootstraplite,build
  popd
}

fetch
build_jdk labs-openjdk-17 \
  17.0.3 \
  /opt/homebrew/Cellar/openjdk/17.0.2/libexec/openjdk.jdk/Contents/Home/

build_graal

OSX 12.2 Installation

$ curl -LJO  https://github.com/ganadist/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-java17-22.1.0-dev-osx-aarch64.tar.gz
$ sudo tar xf graalvm-java17-22.1.0-dev-osx-aarch64.tar.gz \
    -C /Library/Java/JavaVirtualMachines
$ sudo xattr -r -d com.apple.quarantine \
   /Library/Java/JavaVirtualMachines/graalvm-java17-22.1.0-dev
$ /Library/Java/JavaVirtualMachines/graalvm-java17-22.1.0-dev/Contents/Home/bin/java -version
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment GraalVM 22.1.0-dev (build 17.0.3+0-jvmci-22.1-b01)
OpenJDK 64-Bit Server VM GraalVM 22.1.0-dev (build 17.0.3+0-jvmci-22.1-b01, mixed mode, sharing)