RFR: JDK-8087195: Support building hotspot with devkits on Macosx

Erik Joelsson erik.joelsson at oracle.com
Thu Jun 11 10:53:33 UTC 2015


Hello,

Please review this small makefile tweak. When using a devkit to build 
hotspot on Macosx, the dtrace command gets confused and tries to use the 
wrong preprocessor. I've fixed this by splitting out the running of the 
preprocessor to a separate call. I've verified by comparing the 
generated header files with and without the patch.

Bug: https://bugs.openjdk.java.net/browse/JDK-8087195
Patch inline:
diff -r 11af3990d56c make/bsd/makefiles/dtrace.make
--- a/make/bsd/makefiles/dtrace.make
+++ b/make/bsd/makefiles/dtrace.make
@@ -263,14 +263,19 @@
  $(DtraceOutDir):
      mkdir $(DtraceOutDir)

+# When building using a devkit, dtrace cannot find the correct 
preprocessor so
+# we run it explicitly before runing dtrace.
  $(DtraceOutDir)/hotspot.h: $(DTRACE_COMMON_SRCDIR)/hotspot.d | 
$(DtraceOutDir)
-    $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s 
$(DTRACE_COMMON_SRCDIR)/hotspot.d
+    $(QUIETLY) $(CC) -E $(DTRACE_OPTS) -I. -x c 
$(DTRACE_COMMON_SRCDIR)/hotspot.d > $(DtraceOutDir)/hotspot.d
+    $(QUIETLY) $(DTRACE_PROG) -h -o $@ -s $(DtraceOutDir)/hotspot.d

  $(DtraceOutDir)/hotspot_jni.h: $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d | 
$(DtraceOutDir)
-    $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s 
$(DTRACE_COMMON_SRCDIR)/hotspot_jni.d
+    $(QUIETLY) $(CC) -E $(DTRACE_OPTS) -I. -x c 
$(DTRACE_COMMON_SRCDIR)/hotspot_jni.d > $(DtraceOutDir)/hotspot_jni.d
+    $(QUIETLY) $(DTRACE_PROG) -h -o $@ -s $(DtraceOutDir)/hotspot_jni.d

  $(DtraceOutDir)/hs_private.h: $(DTRACE_COMMON_SRCDIR)/hs_private.d | 
$(DtraceOutDir)
-    $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s 
$(DTRACE_COMMON_SRCDIR)/hs_private.d
+    $(QUIETLY) $(CC) -E $(DTRACE_OPTS) -I. -x c 
$(DTRACE_COMMON_SRCDIR)/hs_private.d > $(DtraceOutDir)/hs_private.d
+    $(QUIETLY) $(DTRACE_PROG) -h -o $@ -s $(DtraceOutDir)/hs_private.d

  dtrace_gen_headers: $(DtraceOutDir)/hotspot.h 
$(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h


/Erik


More information about the hotspot-dev mailing list