JDK-6769128 : failure to run generateJvmOffsets is ignored
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2008-11-07
  • Updated: 2012-10-08
  • Resolved: 2008-11-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u14Fixed 7Fixed hs14Fixed
Description
dtrace.make builds and runs generateJvmOffsets to generate source files used to build hotspot.  The makefile uses shell commands that effectively ignore errors that occur running generateJvmOffsets.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/96c6da8f095c
2008-11-12

SUGGESTED FIX Use a separate shell command to run generateJvmOffsets. Also consolidate the commands to conditionally update the target into a make macro. # HG changeset patch # User jcoomes # Date 1226091136 28800 # Node ID 96c6da8f095c8080a48fb2a615c61cf9818a63e3 # Parent 03f4fdd1b6af72dc68590fca226cd9879af2d9c5 6769128: failure to run generateJvmOffsets is ignored Reviewed-by: xlu diff --git a/make/solaris/makefiles/dtrace.make b/make/solaris/makefiles/dtrace.make --- a/make/solaris/makefiles/dtrace.make +++ b/make/solaris/makefiles/dtrace.make @@ -116,27 +116,25 @@ $(QUIETLY) $(LINK.CC) -z nodefs -o $@ $(DTRACE_SRCDIR)/$(GENOFFS)Main.c \ ./lib$(GENOFFS).so -# $@.tmp is created first. It's to avoid empty $(JVMOFFS).h produced in error case. +CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \ + cmp -s $@ $@.tmp; \ + case $$? in \ + 0) rm -f $@.tmp;; \ + *) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \ + esac + +# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs. $(JVMOFFS).h: $(GENOFFS) - $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp ; \ - if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \ - then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \ - else rm -f $@.tmp; \ - fi + $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp + $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) $(JVMOFFS)Index.h: $(GENOFFS) - $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp ; \ - if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \ - then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \ - else rm -f $@.tmp; \ - fi + $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp + $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) $(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h - $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp ; \ - if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \ - then rm -f $@; mv $@.tmp $@; echo Updated $@ ; \ - else rm -f $@.tmp; \ - fi + $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp + $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET) $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp $(QUIETLY) $(CCC) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
2008-11-07

EVALUATION Use a separate shell command to run generateJvmOffsets so errors are not ignored.
2008-11-07