Skip to content

Instantly share code, notes, and snippets.

@cpuspellcaster
Forked from bonifaido/build-openjdk9-osx.sh
Last active September 19, 2015 03:19
Show Gist options
  • Save cpuspellcaster/3d9f81aabffb98f02602 to your computer and use it in GitHub Desktop.
Save cpuspellcaster/3d9f81aabffb98f02602 to your computer and use it in GitHub Desktop.
Build OpenJDK 9 Zero(Shark) on Mac OS X Yosemite (bash build-openjdk9-osx.sh)
#!/bin/bash
# Latest Mercurial, OS X Command Line Tools, JDK 8 and libffi are needed
# Tested with OSX 10.10.3 and Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)
brew install mercurial
brew install libffi
brew link libffi --force
# only needed if you build the zeroshark variant
# brew install llvm
# brew link llvm --force
hg clone http://hg.openjdk.java.net/jdk9/jdk9
cd jdk9
bash get_source.sh
hg import https://gist.githubusercontent.com/bonifaido/cc306a7c22d3d550f7c9/raw/7d066bbcd8895555ecec5ed4c39f1bc3f92a8aa0/zero_osx.patch
cd jdk
hg import https://gist.githubusercontent.com/bonifaido/cc306a7c22d3d550f7c9/raw/2f76caacc21d934c650ee4b4832900853befaa9e/jdk_zero_osx.patch
cd ../hotspot
hg import https://gist.githubusercontent.com/bonifaido/cc306a7c22d3d550f7c9/raw/3eadc57ba285e81c8522e339c92feafc15cee267/hotspot_zero_osx.patch
cd ..
bash configure \
--with-boot-jdk=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home \
--with-jvm-variants=zero \
make images
diff --git a/make/defs.make b/make/defs.make
--- a/make/defs.make
+++ b/make/defs.make
@@ -355,7 +355,7 @@
# non-universal macosx builds need to appear universal
ifeq ($(OS_VENDOR), Darwin)
- ifneq ($(MACOSX_UNIVERSAL), true)
+ ifeq ($(MACOSX_UNIVERSAL), true)
EXPORT_LIB_ARCH_DIR = $(EXPORT_LIB_DIR)
endif
endif
diff --git a/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp b/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
--- a/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
+++ b/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
@@ -254,11 +254,9 @@
}
#endif // !PRODUCT
- const char *fmt =
- "caught unhandled signal " INT32_FORMAT " at address " PTR_FORMAT;
char buf[128];
- sprintf(buf, fmt, sig, info->si_addr);
+ sprintf(buf, "caught unhandled signal " INT32_FORMAT " at address " PTR_FORMAT, sig, info->si_addr);
fatal(buf);
return false;
}
diff --git a/make/copy/Copy-java.base.gmk b/make/copy/Copy-java.base.gmk
--- a/make/copy/Copy-java.base.gmk
+++ b/make/copy/Copy-java.base.gmk
@@ -95,7 +95,7 @@
endif
ifeq ($(OPENJDK_TARGET_OS), macosx)
- JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/macosx/conf/$(JVMCFG_ARCH)/jvm.cfg
+ JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/macosx/conf/x86_64/jvm.cfg
else
JVMCFG_SRC := $(JDK_TOPDIR)/src/java.base/$(OPENJDK_TARGET_OS_TYPE)/conf/$(JVMCFG_ARCH)/jvm.cfg
# Allow override by ALT_JVMCFG_SRC if it exists
diff --git a/src/java.base/share/native/launcher/main.c b/src/java.base/share/native/launcher/main.c
--- a/src/java.base/share/native/launcher/main.c
+++ b/src/java.base/share/native/launcher/main.c
@@ -129,6 +129,6 @@
DOT_VERSION,
(const_progname != NULL) ? const_progname : *margv,
(const_launcher != NULL) ? const_launcher : *margv,
- (const_jargs != NULL) ? JNI_TRUE : JNI_FALSE,
+ const_jargs ? JNI_TRUE : JNI_FALSE,
const_cpwildcard, const_javaw, const_ergo_class);
}
diff --git a/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m b/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m
--- a/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m
+++ b/src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m
@@ -275,7 +275,7 @@
[image addRepresentation: rep];
float scaleFactor = splash->scaleFactor;
if (scaleFactor > 0 && scaleFactor != 1) {
- [image setScalesWhenResized:YES];
+ // [image setScalesWhenResized:YES]; // deprecated and not needed anymore according to docs
NSSize size = [image size];
size.width /= scaleFactor;
size.height /= scaleFactor;
diff --git a/src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c b/src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c
--- a/src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c
+++ b/src/java.desktop/share/native/libawt/awt/image/awt_parseImage.c
@@ -852,7 +852,7 @@
hintP->needToExpand = TRUE;
hintP->expandToNbits = cmodelP->maxNbits;
}
- else if (rasterP->sppsm.offsets != NULL) {
+ else if (rasterP->sppsm.offsets) {
for (i=0; i < rasterP->numBands; i++) {
if (!(rasterP->sppsm.offsets[i] % 8)) {
hintP->needToExpand = TRUE;
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -14817,9 +14817,9 @@
# 64 bit intel. This invalidates control of which jvms are built
# from configure, but only server is valid anyway. Fix this
# when hotspot makefiles are rewritten.
- if test "x$MACOSX_UNIVERSAL" = xtrue; then
- HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT}
- fi
+ # if test "x$MACOSX_UNIVERSAL" = xtrue; then
+ # HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT}
+ # fi
#####
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment