Merge
authoramurillo
Tue, 27 Oct 2015 10:15:37 -0700
changeset 33059 6de465484e43
parent 33058 fed2bbca5c75 (current diff)
parent 33055 3676b99f33cf (diff)
child 33233 6b61c54e47d7
Merge
--- a/common/autoconf/build-performance.m4	Thu Oct 22 16:25:34 2015 -0700
+++ b/common/autoconf/build-performance.m4	Tue Oct 27 10:15:37 2015 -0700
@@ -328,12 +328,23 @@
 
   AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac],
       [use sjavac to do fast incremental compiles @<:@disabled@:>@])],
-      [ENABLE_SJAVAC="${enableval}"], [ENABLE_SJAVAC='no'])
+      [ENABLE_SJAVAC="${enableval}"], [ENABLE_SJAVAC="no"])
   if test "x$JVM_ARG_OK" = "xfalse"; then
     AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling sjavac])
-    ENABLE_SJAVAC=no;
+    ENABLE_SJAVAC="no"
   fi
   AC_MSG_CHECKING([whether to use sjavac])
   AC_MSG_RESULT([$ENABLE_SJAVAC])
   AC_SUBST(ENABLE_SJAVAC)
+
+  AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--enable-javac-server],
+      [use only the server part of sjavac for faster javac compiles @<:@disabled@:>@])],
+      [ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER="no"])
+  if test "x$JVM_ARG_OK" = "xfalse"; then
+    AC_MSG_WARN([Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server])
+    ENABLE_JAVAC_SERVER="no"
+  fi
+  AC_MSG_CHECKING([whether to use javac server])
+  AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
+  AC_SUBST(ENABLE_JAVAC_SERVER)
 ])
--- a/common/autoconf/generated-configure.sh	Thu Oct 22 16:25:34 2015 -0700
+++ b/common/autoconf/generated-configure.sh	Tue Oct 27 10:15:37 2015 -0700
@@ -632,6 +632,7 @@
 CFLAGS_CCACHE
 CCACHE
 USE_PRECOMPILED_HEADER
+ENABLE_JAVAC_SERVER
 ENABLE_SJAVAC
 SJAVAC_SERVER_JAVA_FLAGS
 SJAVAC_SERVER_JAVA
@@ -1117,6 +1118,7 @@
 with_boot_jdk_jvmargs
 with_sjavac_server_java
 enable_sjavac
+enable_javac_server
 enable_precompiled_headers
 enable_ccache
 with_ccache_dir
@@ -1867,6 +1869,8 @@
                           --with-freetype, disabled otherwise]
   --enable-sjavac         use sjavac to do fast incremental compiles
                           [disabled]
+  --enable-javac-server   use only the server part of sjavac for faster javac
+                          compiles [disabled]
   --disable-precompiled-headers
                           disable using precompiled headers when compiling C++
                           [enabled]
@@ -4591,7 +4595,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1445524829
+DATE_WHEN_GENERATED=1445964676
 
 ###############################################################################
 #
@@ -53515,13 +53519,13 @@
 if test "${enable_sjavac+set}" = set; then :
   enableval=$enable_sjavac; ENABLE_SJAVAC="${enableval}"
 else
-  ENABLE_SJAVAC='no'
+  ENABLE_SJAVAC="no"
 fi
 
   if test "x$JVM_ARG_OK" = "xfalse"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling sjavac" >&5
 $as_echo "$as_me: WARNING: Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling sjavac" >&2;}
-    ENABLE_SJAVAC=no;
+    ENABLE_SJAVAC="no"
   fi
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use sjavac" >&5
 $as_echo_n "checking whether to use sjavac... " >&6; }
@@ -53529,6 +53533,24 @@
 $as_echo "$ENABLE_SJAVAC" >&6; }
 
 
+  # Check whether --enable-javac-server was given.
+if test "${enable_javac_server+set}" = set; then :
+  enableval=$enable_javac_server; ENABLE_JAVAC_SERVER="${enableval}"
+else
+  ENABLE_JAVAC_SERVER="no"
+fi
+
+  if test "x$JVM_ARG_OK" = "xfalse"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server" >&5
+$as_echo "$as_me: WARNING: Could not set -Xms${MS_VALUE}M -Xmx${MX_VALUE}M, disabling javac server" >&2;}
+    ENABLE_JAVAC_SERVER="no"
+  fi
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use javac server" >&5
+$as_echo_n "checking whether to use javac server... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_JAVAC_SERVER" >&5
+$as_echo "$ENABLE_JAVAC_SERVER" >&6; }
+
+
 
 # Can the C/C++ compiler use precompiled headers?
 
--- a/common/autoconf/spec.gmk.in	Thu Oct 22 16:25:34 2015 -0700
+++ b/common/autoconf/spec.gmk.in	Tue Oct 27 10:15:37 2015 -0700
@@ -245,6 +245,7 @@
 # Enable sjavac support = use a javac server,
 # multi core javac compilation and dependency tracking.
 ENABLE_SJAVAC:=@ENABLE_SJAVAC@
+ENABLE_JAVAC_SERVER:=@ENABLE_JAVAC_SERVER@
 # Store sjavac server synchronization files here, and
 # the sjavac server log files.
 SJAVAC_SERVER_DIR=$(MAKESUPPORT_OUTPUTDIR)/javacservers
--- a/make/common/JavaCompilation.gmk	Thu Oct 22 16:25:34 2015 -0700
+++ b/make/common/JavaCompilation.gmk	Tue Oct 27 10:15:37 2015 -0700
@@ -59,6 +59,7 @@
 #   FLAGS:=Flags to be supplied to javac
 #   SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here
 #   SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above.
+#   DISABLE_SJAVAC:=Set to true if this setup does not support sjavac
 SetupJavaCompiler = $(NamedParamsMacroTemplate)
 define SetupJavaCompilerBody
   # The port file contains the tcp/ip on which the server listens
@@ -439,6 +440,7 @@
   endif
   $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE)
   $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM)
+  $1_DISABLE_SJAVAC := $$($$($1_SETUP)_DISABLE_SJAVAC)
 
   # Handle addons and overrides.
   $1_SRC:=$$(call ADD_SRCS,$$($1_SRC))
@@ -552,6 +554,15 @@
   # and remove .java at the end.
   $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
 
+  # Create SJAVAC variable from JAVAC variable. Expects $1_JAVAC to be
+  # "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main"
+  # and javac is simply replaced with sjavac.
+  $1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC))
+
+  # Set the $1_REMOTE to spawn a background javac server.
+  $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst \
+      $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC))))
+
   ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes)
     ifneq (,$$($1_HEADERS))
       $1_HEADERS_ARG := -h $$($1_HEADERS)
@@ -560,15 +571,6 @@
     # Using sjavac to compile.
     $1_COMPILE_TARGETS := $$($1_BIN)/_the.$1_batch
 
-    # Create SJAVAC variable form JAVAC variable. Expects $1_JAVAC to be
-    # "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main"
-    # and javac is simply replaced with sjavac.
-    $1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC))
-
-    # Set the $1_REMOTE to spawn a background javac server.
-    $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst \
-        $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC))))
-
     $1_VARDEPS := $$($1_JVM) $$($1_SJAVAC) $$($1_SJAVAC_ARGS) $$($1_FLAGS) \
         $$($1_HEADERS_ARG) $$($1_BIN) $$($1_EXCLUDES) $$($1_INCLUDES) \
         $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
@@ -632,13 +634,19 @@
         $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps)
 
+    ifeq ($$($1_DISABLE_SJAVAC)x$(ENABLE_JAVAC_SERVER), xyes)
+      $1_JAVAC_CMD := $$($1_SJAVAC) $$($1_REMOTE)
+    else
+      $1_JAVAC_CMD := $$($1_JAVAC)
+    endif
+
     # When not using sjavac, pass along all sources to javac using an @file.
     $$($1_BIN)/_the.$1_batch: $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
 	$(MKDIR) -p $$(@D)
 	$$(eval $$(call ListPathsSafely,$1_SRCS, $$($1_BIN)/_the.$1_batch.tmp))
 	$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.$1_batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1
 	$(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \
-	    $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \
+	    $$($1_JVM) $$($1_JAVAC_CMD) $$($1_FLAGS) \
 	        -implicit:none \
 	        -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.$1_batch.tmp) && \
 	$(MV) $$($1_BIN)/_the.$1_batch.tmp $$($1_BIN)/_the.$1_batch
--- a/make/common/MakeBase.gmk	Thu Oct 22 16:25:34 2015 -0700
+++ b/make/common/MakeBase.gmk	Tue Oct 27 10:15:37 2015 -0700
@@ -640,7 +640,8 @@
           $(if $(findstring $(LOG_LEVEL), trace), \
               $(info NewVariable $1: >$(strip $($1))<) \
               $(info OldVariable $1: >$(strip $($1_old))<)) \
-          $(call WriteFile, $1_old:=$($1), $(call DependOnVariableFileName, $1, $2))) \
+          $(call WriteFile, $1_old:=$(call DoubleDollar,$($1)), \
+              $(call DependOnVariableFileName, $1, $2))) \
         $(call DependOnVariableFileName, $1, $2) \
     )
 
--- a/make/common/SetupJavaCompilers.gmk	Thu Oct 22 16:25:34 2015 -0700
+++ b/make/common/SetupJavaCompilers.gmk	Tue Oct 27 10:15:37 2015 -0700
@@ -38,7 +38,9 @@
 # and the interim javac, to be run by the boot jdk.
 $(eval $(call SetupJavaCompiler,BOOT_JAVAC, \
     JAVAC := $(JAVAC), \
-    FLAGS := -XDignore.symbol.file=true -g -Xlint:all$(COMMA)-deprecation -Werror))
+    FLAGS := -XDignore.symbol.file=true -g -Xlint:all$(COMMA)-deprecation -Werror, \
+    DISABLE_SJAVAC := true, \
+))
 
 # Any java code executed during a JDK build to build other parts of the JDK must be
 # executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this
--- a/make/test/BuildTestLib.gmk	Thu Oct 22 16:25:34 2015 -0700
+++ b/make/test/BuildTestLib.gmk	Tue Oct 27 10:15:37 2015 -0700
@@ -39,6 +39,7 @@
 $(eval $(call SetupJavaCompiler, BOOT_JAVAC_NOWARNINGS, \
     JAVAC := $(JAVAC), \
     FLAGS := -XDignore.symbol.file=true -g, \
+    DISABLE_SJAVAC := true, \
 ))
 
 $(eval $(call SetupJavaCompilation, BUILD_WB_JAR, \
--- a/test/make/TestMakeBase.gmk	Thu Oct 22 16:25:34 2015 -0700
+++ b/test/make/TestMakeBase.gmk	Tue Oct 27 10:15:37 2015 -0700
@@ -207,6 +207,12 @@
 	test ! -e $(VARDEP_FLAG_FILE)
 	$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR=" value3  foo" $(VARDEP_TARGET_FILE)
 	test ! -e $(VARDEP_FLAG_FILE)
+        #
+        # Test including some problematic characters
+	$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR='value4 \$$$$ORIGIN' $(VARDEP_TARGET_FILE)
+	$(RM) $(VARDEP_FLAG_FILE)
+	$(MAKE) -f $(THIS_FILE) VARDEP_TEST_VAR='value4 \$$$$ORIGIN' $(VARDEP_TARGET_FILE)
+	test ! -e $(VARDEP_FLAG_FILE)
 
 # Test specifying a specific value file to store variable in
 VARDEP_VALUE_FILE := $(VARDEP_DIR)/value-file
@@ -215,17 +221,15 @@
 VARDEP_RETURN_VALUE := $(call DependOnVariable, VARDEP_TEST_VAR2, $(VARDEP_VALUE_FILE))
 $(eval $(call assert-equals, $(VARDEP_RETURN_VALUE), $(VARDEP_VALUE_FILE), \
     Wrong filename returned))
-VARDEP_FILE_CONTENTS := $(shell $(CAT) $(VARDEP_VALUE_FILE))
-$(eval $(call assert-equals, $(VARDEP_FILE_CONTENTS), \
-    VARDEP_TEST_VAR2_old:=$(VARDEP_TEST_VAR2), \
+-include $(VARDEP_VALUE_FILE)
+$(eval $(call assert-equals, $(VARDEP_TEST_VAR2_old), $(VARDEP_TEST_VAR2), \
     Wrong contents in vardeps file))
 
 # Test with a variable value containing some problematic characters
-VARDEP_TEST_VAR3 := foo '""' "''" bar
+VARDEP_TEST_VAR3 := foo '""' "''" bar \$$ORIGIN
 VARDEP_VALUE_FILE := $(call DependOnVariable, VARDEP_TEST_VAR3)
-VARDEP_FILE_CONTENTS := $(shell $(CAT) $(VARDEP_VALUE_FILE))
-$(eval $(call assert-equals, $(VARDEP_FILE_CONTENTS), \
-    VARDEP_TEST_VAR3_old:=$(VARDEP_TEST_VAR3), \
+-include $(VARDEP_VALUE_FILE)
+$(eval $(call assert-equals, $(VARDEP_TEST_VAR3_old), $(VARDEP_TEST_VAR3), \
     Wrong contents in vardep file))
 
 TEST_TARGETS += test-vardep