8148120: Incremental update from build-infra project
authorihse
Sat, 30 Jan 2016 10:25:15 +0100
changeset 35370 f9b430645a18
parent 35369 a68e46d94261
child 35371 7deccee1f94e
8148120: Incremental update from build-infra project Reviewed-by: erikj
common/autoconf/generated-configure.sh
common/autoconf/libraries.m4
common/bin/compare.sh
make/Init.gmk
make/InitSupport.gmk
make/common/JavaCompilation.gmk
make/common/MakeBase.gmk
make/common/NativeCompilation.gmk
--- a/common/autoconf/generated-configure.sh	Sat Jan 30 00:25:53 2016 +0530
+++ b/common/autoconf/generated-configure.sh	Sat Jan 30 10:25:15 2016 +0100
@@ -4839,7 +4839,7 @@
 #CUSTOM_AUTOCONF_INCLUDE
 
 # Do not change or remove the following line, it is needed for consistency checks:
-DATE_WHEN_GENERATED=1453964370
+DATE_WHEN_GENERATED=1454145906
 
 ###############################################################################
 #
@@ -58548,6 +58548,10 @@
       fi
     done
 
+    # Due to https://llvm.org/bugs/show_bug.cgi?id=16902, llvm does not
+    # always properly detect -ltinfo
+    LLVM_LIBS="${LLVM_LIBS} -ltinfo"
+
 
 
 
--- a/common/autoconf/libraries.m4	Sat Jan 30 00:25:53 2016 +0530
+++ b/common/autoconf/libraries.m4	Sat Jan 30 10:25:15 2016 +0100
@@ -144,6 +144,10 @@
       fi
     done
 
+    # Due to https://llvm.org/bugs/show_bug.cgi?id=16902, llvm does not
+    # always properly detect -ltinfo
+    LLVM_LIBS="${LLVM_LIBS} -ltinfo"
+
     AC_SUBST(LLVM_CFLAGS)
     AC_SUBST(LLVM_LDFLAGS)
     AC_SUBST(LLVM_LIBS)
--- a/common/bin/compare.sh	Sat Jan 30 00:25:53 2016 +0530
+++ b/common/bin/compare.sh	Sat Jan 30 10:25:15 2016 +0100
@@ -306,7 +306,7 @@
         ! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" \
         ! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" \
         ! -name "JavaUpdater" ! -name "JavaWSApplicationStub" \
-        ! -name "jspawnhelper" \
+        ! -name "jspawnhelper" ! -name "*.a" \
         | $GREP -v "./bin/"  | $SORT | $FILTER)
 
     echo Other files with binary differences...
@@ -939,7 +939,7 @@
     WORK_DIR=$3
 
     LIBS=$(cd $THIS_DIR && $FIND . -type f \( -name 'lib*.so' -o -name '*.dylib' \
-        -o -name '*.dll' -o -name '*.obj' -o -name '*.o' \
+        -o -name '*.dll' -o -name '*.obj' -o -name '*.o' -o -name '*.a' \
         -o -name '*.cpl' \) | $SORT | $FILTER)
 
     if [ -n "$LIBS" ]; then
--- a/make/Init.gmk	Sat Jan 30 00:25:53 2016 +0530
+++ b/make/Init.gmk	Sat Jan 30 10:25:15 2016 +0100
@@ -315,6 +315,7 @@
 
     # Support targets for COMPARE_BUILD, used for makefile development
     pre-compare-build:
+	$(call WaitForSmartJavacFinish)
 	$(call PrepareCompareBuild)
 
     post-compare-build:
--- a/make/InitSupport.gmk	Sat Jan 30 00:25:53 2016 +0530
+++ b/make/InitSupport.gmk	Sat Jan 30 10:25:15 2016 +0100
@@ -440,7 +440,10 @@
 	  $(PRINTF) "=== Output from failing command(s) repeated here ===\n" $(NEWLINE) \
 	  $(foreach logfile, $(sort $(wildcard $(MAKESUPPORT_OUTPUTDIR)/failure-logs/*)), \
 	      $(PRINTF) "* For target $(notdir $(basename $(logfile))):\n" $(NEWLINE) \
-	      $(CAT) $(logfile) | $(GREP) -v -e "^Note: including file:" $(NEWLINE) \
+	      ($(GREP) -v -e "^Note: including file:" <  $(logfile) || true) | $(HEAD) -n 12 $(NEWLINE) \
+	      if test `$(WC) -l < $(logfile)` -gt 12; then \
+	        $(ECHO) "   ... (rest of output omitted)" ; \
+	      fi $(NEWLINE) \
 	  ) \
 	  $(PRINTF) "=== End of repeated output ===\n" \
 	)
@@ -486,6 +489,21 @@
 	    $(TOUCH) $(SJAVAC_SERVER_DIR)/server.port.stop; true
   endef
 
+  ifeq ($(OPENJDK_BUILD_OS), windows)
+    # On windows we need to synchronize with the javac server to be able to
+    # move or remove the build output directory. Since we have no proper
+    # synchronization process, wait for a while and hope it helps. This is only
+    # used by build comparisons.
+    define WaitForSmartJavacFinish
+	$(if $(SJAVAC_SERVER_DIR), \
+	  sleep 5\
+	)
+    endef
+  else
+    define WaitForSmartJavacFinish
+    endef
+  endif
+
   define StartGlobalTimer
 	$(RM) -r $(BUILDTIMESDIR) 2> /dev/null && \
 	$(MKDIR) -p $(BUILDTIMESDIR) && \
--- a/make/common/JavaCompilation.gmk	Sat Jan 30 00:25:53 2016 +0530
+++ b/make/common/JavaCompilation.gmk	Sat Jan 30 10:25:15 2016 +0100
@@ -345,7 +345,7 @@
 	  $$(eval $$(call ListPathsSafely,$1_SJAVAC_ARGS_STRING, $$($1_SJAVAC_ARGS_FILE)))
         endif
 	$(ECHO) Compiling $1
-	$(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \
+	$(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch, $$($1_SAFE_NAME), \
 	    $$($1_JVM) $$($1_SJAVAC) \
 	        $$($1_REMOTE) \
 	        -j 1 \
@@ -409,7 +409,7 @@
 	$(MKDIR) -p $$(@D)
 	$$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
 	$(ECHO) Compiling `$(WC) $$@.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1
-	$(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \
+	$(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch, $$($1_SAFE_NAME), \
 	    $$($1_JVM) $$($1_JAVAC_CMD) $$($1_FLAGS) \
 	        -implicit:none \
 		-d $$($1_BIN) $$($1_HEADERS_ARG) @$$@.tmp) && \
--- a/make/common/MakeBase.gmk	Sat Jan 30 00:25:53 2016 +0530
+++ b/make/common/MakeBase.gmk	Sat Jan 30 10:25:15 2016 +0100
@@ -685,14 +685,15 @@
 # LogFailures will run a command and store a copy of output in a specified file.
 # If the command succeeds, the file is deleted, otherwise it is moved to the
 # failure-logs directory.
-# Param 1 - The log file of the failed command
+# Param 1 - The base name of the log file / command line file
 # Param 2 - A compact but representative name to describe this command
 # Param 3 - Command to run
 LogFailures = \
-  ( $3 > >($(TEE) $1) 2> >($(TEE) $1 >&2) || \
+  ( $(ECHO) '$3' > $1.cmdline  && \
+      ( $3 > >($(TEE) $1.log) 2> >($(TEE) $1.log >&2) || \
       (exitcode=$(DOLLAR)$(DOLLAR)? && \
-      $(CP) $1 $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(strip $2).log && \
-      exit $(DOLLAR)$(DOLLAR)exitcode) )
+      $(CP) $1.log $(MAKESUPPORT_OUTPUTDIR)/failure-logs/$(strip $2).log && \
+      exit $(DOLLAR)$(DOLLAR)exitcode) ) )
 
 ################################################################################
 # Find lib dir for module
--- a/make/common/NativeCompilation.gmk	Sat Jan 30 00:25:53 2016 +0530
+++ b/make/common/NativeCompilation.gmk	Sat Jan 30 10:25:15 2016 +0100
@@ -241,15 +241,16 @@
 
     $$($1_$2_OBJ) : $2 $$($1_COMPILE_VARDEPS_FILE) $$($1_$2_VARDEPS_FILE) | $$($1_BUILD_INFO)
 	$$(call LogInfo, Compiling $$(notdir $2) (for $$(notdir $$($1_TARGET))))
+	$$(call MakeDir, $$(@D))
         ifneq ($(TOOLCHAIN_TYPE), microsoft)
           ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s,$2), solstudio)
             # The Solaris studio compiler doesn't output the full path to the object file in the
             # generated deps files. Fixing it with sed. If compiling assembly, don't try this.
-	    $(call LogFailures, $$($1_$2_OBJ).log, $$($1_SAFE_NAME)_$$(notdir $2), \
+	    $(call LogFailures, $$($1_$2_OBJ), $$($1_SAFE_NAME)_$$(notdir $2), \
 	        $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP).tmp $(CC_OUT_OPTION)$$($1_$2_OBJ) $2)
 	    $(SED) 's|^$$(@F):|$$@:|' $$($1_$2_DEP).tmp > $$($1_$2_DEP)
           else
-	    $(call LogFailures, $$($1_$2_OBJ).log, $$($1_SAFE_NAME)_$$(notdir $2), \
+	    $(call LogFailures, $$($1_$2_OBJ), $$($1_SAFE_NAME)_$$(notdir $2), \
 	        $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2)
           endif
           # Create a dependency target file from the dependency file.
@@ -264,7 +265,7 @@
           # Keep as much as possible on one execution line for best performance on Windows.
           # No need to save exit code from compilation since pipefail is always active on
           # Windows.
-	  $(call LogFailures, $$($1_$2_OBJ).log, $$($1_SAFE_NAME)_$$(notdir $2), \
+	  $(call LogFailures, $$($1_$2_OBJ), $$($1_SAFE_NAME)_$$(notdir $2), \
 	      $$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \
 	          $(CC_OUT_OPTION)$$($1_$2_OBJ) $2) \
 	      | $(GREP) -v -e "^Note: including file:" \
@@ -784,13 +785,23 @@
                 # Keep as much as possible on one execution line for best performance
                 # on Windows
 		$$(call LogInfo, Linking $$($1_BASENAME))
-		$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \
-		    $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
-		    $(LD_OUT_OPTION)$$@ \
-		    $$($1_LD_OBJ_ARG) $$($1_RES) \
-		    $$($1_LIBS) $$($1_EXTRA_LIBS)) ; \
-		$$($1_CREATE_DEBUGINFO_CMDS)
-		$$($1_STRIP_CMD)
+                ifeq ($(OPENJDK_TARGET_OS), windows)
+		  $(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, $$($1_SAFE_NAME)_link, \
+		      $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
+		      $(LD_OUT_OPTION)$$@ $$($1_LD_OBJ_ARG) $$($1_RES) $$($1_LIBS) \
+		      $$($1_EXTRA_LIBS)) \
+		      | $(GREP) -v "^   Creating library .*\.lib and object .*\.exp" || \
+		      test "$$$$?" = "1" ; \
+		  $$($1_CREATE_DEBUGINFO_CMDS)
+		  $$($1_STRIP_CMD)
+                else
+		  $(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, $$($1_SAFE_NAME)_link, \
+		      $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
+		      $(LD_OUT_OPTION)$$@ $$($1_LD_OBJ_ARG) $$($1_RES) $$($1_LIBS) \
+		      $$($1_EXTRA_LIBS)) ; \
+		  $$($1_CREATE_DEBUGINFO_CMDS)
+		  $$($1_STRIP_CMD)
+                endif
 
   endif
 
@@ -803,7 +814,7 @@
     # Generating a static library, ie object file archive.
     $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_VARDEPS_FILE)
 	$$(call LogInfo, Archiving $$($1_STATIC_LIBRARY))
-	$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \
+	$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, $$($1_SAFE_NAME)_link, \
 	    $$($1_AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_ALL_OBJS) \
 	        $$($1_RES))
         ifeq ($(STATIC_BUILD), true)
@@ -825,7 +836,7 @@
     $$($1_TARGET): $$($1_ALL_OBJS) $$($1_RES) $$($1_MANIFEST) \
         $$($1_VARDEPS_FILE)
 		$$(call LogInfo, Linking executable $$($1_BASENAME))
-		$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link.log, $$($1_SAFE_NAME)_link, \
+		$(call LogFailures, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_link, $$($1_SAFE_NAME)_link, \
 		    $$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
 		        $(EXE_OUT_OPTION)$$($1_TARGET) \
 		        $$($1_ALL_OBJS) $$($1_RES) \