Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gburd/2d11fbf14932e8d2ff538544a78c62e8 to your computer and use it in GitHub Desktop.
Save gburd/2d11fbf14932e8d2ff538544a78c62e8 to your computer and use it in GitHub Desktop.
Build OpenJDK 9 Zero(Shark) with ShenandoahGC on macOS High Sierra 10.13 (bash build-openjdk9-with-shenandoahgc-zero-shark-for-macos-10.13.sh)
#!/bin/bash
# Latest Mercurial, OS X Command Line Tools, JDK 8 and libffi are needed
# WIP, not yet fully functional.
# Targeting macOS High Sierra 10.13 LLVM version: 5.0.0, clang version 5.0.0 (tags/RELEASE_500/final)
# Strict Mode: http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
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/shenandoah/jdk9 jdk9
cd jdk9
bash get_source.sh
cd jdk
hg import https://gist.githubusercontent.com/gburd/2d11fbf14932e8d2ff538544a78c62e8/raw/fc43f466c5d26df578138c21882efdfe8c539fa2/jdk_zero_osx.patch
cd ../hotspot
hg import https://gist.githubusercontent.com/gburd/2d11fbf14932e8d2ff538544a78c62e8/raw/fc43f466c5d26df578138c21882efdfe8c539fa2/hotspot_zero_osx.patch
cd ..
JDK=jdk1.8.0_144.jdk
bash configure --with-debug-level=optimized --enable-dtrace=yes --with-boot-jdk=/Library/Java/JavaVirtualMachines/${JDK}/Contents/Home --with-jvm-variants=zero
env CONF=macosx-x86_64-normal-zero-release make images
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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment