7132779: build-infra merge: Enable ccache to work for most developer builds.

Tue, 31 Jan 2012 13:12:39 +0100

author
ohrstrom
date
Tue, 31 Jan 2012 13:12:39 +0100
changeset 3517
c77d473e71f7
parent 3516
869be5c8882e
child 3518
719f7007c8e8

7132779: build-infra merge: Enable ccache to work for most developer builds.
Summary: When a build number is not specified, the JRE_RELEASE_VERSION define contains a date and timestamp. Thus ccache cannot cache the object files for longer than a minute since the define is passed to the compilation of all source files. This change passes JRE_RELEASE_VERSION only to vm_version.cpp and adds a function jre_release_version() to Abstract_VM_Version. This allows all other source files to be ccached.
Reviewed-by: ohair, rottenha
Contributed-by: fredrik.ohrstrom@oracle.com

make/bsd/makefiles/vm.make file | annotate | diff | comparison | revisions
make/linux/makefiles/vm.make file | annotate | diff | comparison | revisions
make/solaris/makefiles/vm.make file | annotate | diff | comparison | revisions
src/share/vm/runtime/vm_version.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/vm_version.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/make/bsd/makefiles/vm.make	Fri Feb 03 17:21:52 2012 -0500
     1.2 +++ b/make/bsd/makefiles/vm.make	Tue Jan 31 13:12:39 2012 +0100
     1.3 @@ -89,9 +89,13 @@
     1.4    ${BUILD_TARGET}    \
     1.5    ${BUILD_USER}      \
     1.6    ${HS_LIB_ARCH}     \
     1.7 -  ${JRE_VERSION}     \
     1.8    ${VM_DISTRO}
     1.9  
    1.10 +# This is VERY important! The version define must only be supplied to vm_version.o
    1.11 +# If not, ccache will not re-use the cache at all, since the version string might contain
    1.12 +# a time and date. 
    1.13 +vm_version.o: CPPFLAGS += ${JRE_VERSION} 
    1.14 +
    1.15  ifdef DEFAULT_LIBPATH
    1.16  CPPFLAGS += -DDEFAULT_LIBPATH="\"$(DEFAULT_LIBPATH)\""
    1.17  endif
     2.1 --- a/make/linux/makefiles/vm.make	Fri Feb 03 17:21:52 2012 -0500
     2.2 +++ b/make/linux/makefiles/vm.make	Tue Jan 31 13:12:39 2012 +0100
     2.3 @@ -95,9 +95,13 @@
     2.4    ${BUILD_TARGET}    \
     2.5    ${BUILD_USER}      \
     2.6    ${HS_LIB_ARCH}     \
     2.7 -  ${JRE_VERSION}     \
     2.8    ${VM_DISTRO}
     2.9  
    2.10 +# This is VERY important! The version define must only be supplied to vm_version.o
    2.11 +# If not, ccache will not re-use the cache at all, since the version string might contain
    2.12 +# a time and date. 
    2.13 +vm_version.o: CPPFLAGS += ${JRE_VERSION}
    2.14 +
    2.15  ifndef JAVASE_EMBEDDED
    2.16  CFLAGS += -DINCLUDE_TRACE
    2.17  endif
     3.1 --- a/make/solaris/makefiles/vm.make	Fri Feb 03 17:21:52 2012 -0500
     3.2 +++ b/make/solaris/makefiles/vm.make	Tue Jan 31 13:12:39 2012 +0100
     3.3 @@ -83,9 +83,13 @@
     3.4    ${BUILD_TARGET}    \
     3.5    ${BUILD_USER}      \
     3.6    ${HS_LIB_ARCH}     \
     3.7 -  ${JRE_VERSION}     \
     3.8    ${VM_DISTRO}
     3.9  
    3.10 +# This is VERY important! The version define must only be supplied to vm_version.o
    3.11 +# If not, ccache will not re-use the cache at all, since the version string might contain
    3.12 +# a time and date. 
    3.13 +vm_version.o: CPPFLAGS += ${JRE_VERSION} 
    3.14 +
    3.15  # CFLAGS_WARN holds compiler options to suppress/enable warnings.
    3.16  CFLAGS += $(CFLAGS_WARN)
    3.17  
     4.1 --- a/src/share/vm/runtime/vm_version.cpp	Fri Feb 03 17:21:52 2012 -0500
     4.2 +++ b/src/share/vm/runtime/vm_version.cpp	Tue Jan 31 13:12:39 2012 +0100
     4.3 @@ -165,6 +165,13 @@
     4.4    return VM_RELEASE;
     4.5  }
     4.6  
     4.7 +// NOTE: do *not* use stringStream. this function is called by
     4.8 +//       fatal error handlers. if the crash is in native thread,
     4.9 +//       stringStream cannot get resource allocated and will SEGV.
    4.10 +const char* Abstract_VM_Version::jre_release_version() {
    4.11 +  return JRE_RELEASE_VERSION;
    4.12 +}
    4.13 +
    4.14  #define OS       LINUX_ONLY("linux")             \
    4.15                   WINDOWS_ONLY("windows")         \
    4.16                   SOLARIS_ONLY("solaris")         \
     5.1 --- a/src/share/vm/runtime/vm_version.hpp	Fri Feb 03 17:21:52 2012 -0500
     5.2 +++ b/src/share/vm/runtime/vm_version.hpp	Tue Jan 31 13:12:39 2012 +0100
     5.3 @@ -71,6 +71,7 @@
     5.4  
     5.5    // Internal version providing additional build information
     5.6    static const char* internal_vm_info_string();
     5.7 +  static const char* jre_release_version();
     5.8  
     5.9    // does HW support an 8-byte compare-exchange operation?
    5.10    static bool supports_cx8()  {return _supports_cx8;}

mercurial