diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 5721cfe5954..3ed54fadeac 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4839,7 +4839,7 @@ VS_SDK_PLATFORM_NAME_2013= #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 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" + diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4 index cb3cddd7f92..7bae405555e 100644 --- a/common/autoconf/libraries.m4 +++ b/common/autoconf/libraries.m4 @@ -144,6 +144,10 @@ AC_DEFUN_ONCE([LIB_SETUP_LLVM], 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) diff --git a/common/bin/compare.sh b/common/bin/compare.sh index 9e680f08b0a..b417e8ed819 100644 --- a/common/bin/compare.sh +++ b/common/bin/compare.sh @@ -306,7 +306,7 @@ compare_general_files() { ! -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 @@ compare_all_libs() { 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 diff --git a/make/Init.gmk b/make/Init.gmk index a231526db05..b0c2d881bf4 100644 --- a/make/Init.gmk +++ b/make/Init.gmk @@ -315,6 +315,7 @@ else # HAS_SPEC=true # Support targets for COMPARE_BUILD, used for makefile development pre-compare-build: + $(call WaitForSmartJavacFinish) $(call PrepareCompareBuild) post-compare-build: diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk index 6e10c7b59e3..2bf05d1eb29 100644 --- a/make/InitSupport.gmk +++ b/make/InitSupport.gmk @@ -440,7 +440,10 @@ else # $(HAS_SPEC)=true $(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 @@ else # $(HAS_SPEC)=true $(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) && \ diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk index b1c6d37c1a8..8b4eb594f83 100644 --- a/make/common/JavaCompilation.gmk +++ b/make/common/JavaCompilation.gmk @@ -345,7 +345,7 @@ define SetupJavaCompilationBody $$(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 @@ define SetupJavaCompilationBody $(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) && \ diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index 1f3bdb76650..363168d27a8 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -685,14 +685,15 @@ DependOnVariable = \ # 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 diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index b080beac1dc..e3fa6fd2100 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -241,15 +241,16 @@ define add_native_source $$($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 @@ define add_native_source # 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 @@ define SetupNativeCompilationBody # 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 @@ define SetupNativeCompilationBody # 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 @@ define SetupNativeCompilationBody $$($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) \