Skip to content

Instantly share code, notes, and snippets.

@edwardw
Created January 29, 2012 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwardw/1696874 to your computer and use it in GitHub Desktop.
Save edwardw/1696874 to your computer and use it in GitHub Desktop.
Build OpenJDK Zero VM on Mac OS X

Prerequisites

  • A bootstrap JDK. I used 6u29.

  • LLVM 3.0 installed.

Build it

$ hg clone http://hg.openjdk.java.net/jdk7u/jdk7u-osx/
$ cd jdk7u-osx
$ chmod +x get_source.sh
$ ./get_source.sh
$ . zero_env.sh
$ make sanity && make

But it will fail with something like:

vmStructs.cpp:2864: error: ‘RicochetFrame’ is not a member of ‘MethodHandles’

Chris Phillips from RedHat kindly confirmed that

Between jdk7 hsx21 and current hsx23 the support for the non-Richochet based JSR292 [invoke dynamic ] support that zero depended on was removed.

He also said he is in the process of re-working zero's 292 support. I guess utile then zero vm may work again on OS X.

#!/bin/bash
export ALLOW_DOWNLOADS=true
export SA_APPLE_BOOT_JAVA=true
export ALWAYS_PASS_TEST_GAMMA=true
export ALT_BOOTDIR=`/usr/libexec/java_home -v 1.6`
export HOTSPOT_BUILD_JOBS=`sysctl -n hw.ncpu`
export ZERO_BUILD=true
export SHARK_BUILD=true
export ZERO_LIBARCH=amd64
export ZERO_ARCHDEF=AMD64
export SHARK_LLVM_VERSION=30
## for ffi.h
export ALT_PACKAGE_PATH=/usr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment