RFR (S): 8007639: Workaround for ccache in vm.make is incorrect (original) (raw)

Erik Joelsson erik.joelsson at oracle.com
Mon Feb 11 08:38:43 UTC 2013


Looks good to me.

/Erik

On 2013-02-08 19:30, Mikael Vidstedt wrote:

Please review the following change: Webrev: http://cr.openjdk.java.net/~mikael/webrevs/8007639/webrev.00/webrev Bug: http://bugs.sun.com/viewbug.do?bugid=8007639 This change corrects the workaround that was introduced in vm.make for enabling ccache for HotSpot builds. The change introduces a file specific makefile variable (CFLAGS/<file.o>) which is used to only set the JRERELEASEVERSION define when compiling vmversion.o. Verified manually by observing command lines with/without fix, also passes JPRT.

Some additional background below, more information is available in the bug report: To enable the use of ccache 7132779 [1] introduced some new makefile logic in vm.make to only pass the JRERELEASEVERSION define when compiling the vmversion.cpp file. The underlying reason for that is that the JRERELEASEVERSION can in some cases contain a time stamp and since ccache checks that the defines match before reusing the cache version of the object file that would mean that if the time stamp changed all files would have to be recompiled. With the fix only vmversion.cpp needs to be recompiled. This almost works, but the logic introduced in the makefile is actually incorrect. Today it looks like this: # This is VERY important! The version define must only be supplied to vmversion.o # If not, ccache will not re-use the cache at all, since the version string might contain # a time and date. vmversion.o: CXXFLAGS += ${JREVERSION} However, the above syntax does not only add the ${JREVERSION} to the CXXFLAGS of vmversion.o as originally intended - it also /in some cases/ adds it to the CXXFLAGS for any and all prerequisites of vmversion.o. And vmversion.o depends on all other object files, which means in theory this actually passes in that potentially time stamped version string define to all object files anyway. For various reasons in reality it only passes it to files that are lexicographically after vmversion.o - see bug report for more background on why - but there's still a handful of files that will be recompiled unnecessarily. Cheers, Mikael [1] http://bugs.sun.com/viewbug.do?bugid=7132779



More information about the build-dev mailing list