diff --git a/closed/OpenJ9.gmk b/closed/OpenJ9.gmk index 86c6a839ff0..5d0441b37d5 100644 --- a/closed/OpenJ9.gmk +++ b/closed/OpenJ9.gmk @@ -278,8 +278,14 @@ endif # Adjust .spec files replacing references to gcc-4.6. Openjdk requires 4.8.2 or newer. SPEC_SED_SCRIPT := -e 's/gcc-4.6/gcc/g' -# As DDR is not enabled we use sed to filter .spec files. -SPEC_SED_SCRIPT += $(call SedDisable,module_ddr) +# Adjust DDR enablement flags. +ifeq (true,$(OPENJ9_ENABLE_DDR)) + FEATURE_SED_SCRIPT += $(call SedEnable,opt_useOmrDdr) + SPEC_SED_SCRIPT += $(call SedEnable,module_ddr) +else + FEATURE_SED_SCRIPT += $(call SedDisable,opt_useOmrDdr) + SPEC_SED_SCRIPT += $(call SedDisable,module_ddr) +endif # Disable windows rebase. SPEC_SED_SCRIPT += $(call SedDisable,uma_windowsRebase) @@ -374,6 +380,7 @@ run-preprocessors-j9 : stage-j9 \ && cd $(OUTPUTDIR)/vm \ && $(MAKE) $(MAKEFLAGS) -f buildtools.mk \ BUILD_ID=$(BUILD_ID) \ + CMAKE=$(CMAKE) $(if $(findstring true,$(OPENJ9_ENABLE_CMAKE)),ENABLE_CMAKE=true CALLED_BY_SOURCE_ZIP=yes) \ EXTRA_CONFIGURE_ARGS=$(OMR_EXTRA_CONFIGURE_ARGS) \ FREEMARKER_JAR="$(FREEMARKER_JAR)" \ J9VM_SHA=$(OPENJ9_SHA) \ @@ -388,19 +395,18 @@ run-preprocessors-j9 : stage-j9 \ ) build-j9 : run-preprocessors-j9 - @$(ECHO) Compiling OpenJ9 in $(OUTPUT_ROOT)/vm - ifeq ($(OPENJ9_ENABLE_CMAKE),true) - (export OPENJ9_BUILD=true $(EXPORT_NO_USE_MINGW) \ - && cd $(OUTPUTDIR)/vm \ - && $(MAKE) $(MAKEFLAGS) all \ - ) - else - (export OPENJ9_BUILD=true $(EXPORT_NO_USE_MINGW) $(EXPORT_MSVS_ENV_VARS) \ - && cd $(OUTPUT_ROOT)/vm \ - && $(MAKE) $(MAKEFLAGS) all \ - ) - endif - + @$(ECHO) Compiling OpenJ9 in $(OUTPUTDIR)/vm +ifeq (true,$(OPENJ9_ENABLE_CMAKE)) + (export OPENJ9_BUILD=true $(EXPORT_MSVS_ENV_VARS) \ + && cd $(OUTPUTDIR)/vm/build \ + && $(MAKE) $(MAKEFLAGS) install \ + ) +else + (export OPENJ9_BUILD=true $(EXPORT_NO_USE_MINGW) $(EXPORT_MSVS_ENV_VARS) \ + && cd $(OUTPUTDIR)/vm \ + && $(MAKE) $(MAKEFLAGS) all \ + ) +endif @$(ECHO) OpenJ9 compile complete @$(MKDIR) -p $(MODULES_LIBS_DIR)/java.base @@ -419,6 +425,12 @@ build-j9 : run-preprocessors-j9 @$(MKDIR) -p $(MODULES_LIBS_DIR)/java.base/server @$(CP) -p $(OUTPUTDIR)/vm/redirector/$(LIBRARY_PREFIX)jvm_jdk11$(SHARED_LIBRARY_SUFFIX) $(MODULES_LIBS_DIR)/java.base/server/$(LIBRARY_PREFIX)jvm$(SHARED_LIBRARY_SUFFIX) +ifeq (true,$(OPENJ9_ENABLE_DDR)) + @$(ECHO) Copying j9ddr.dat + @$(MKDIR) -p $(MODULES_LIBS_DIR)/java.base/$(OPENJ9_LIBS_SUBDIR) + @$(CP) -p $(OUTPUTDIR)/vm/j9ddr.dat $(MODULES_LIBS_DIR)/java.base/$(OPENJ9_LIBS_SUBDIR)/ +endif + J9JCL_SOURCES_DONEFILE := $(MAKESUPPORT_OUTPUTDIR)/j9jcl_sources.done recur_wildcard = $(foreach dir,$(wildcard $1/*),$(call recur_wildcard,$(dir),$2) $(filter $(subst *,%,$2),$(dir))) diff --git a/closed/autoconf/custom-hook.m4 b/closed/autoconf/custom-hook.m4 index 2f9ed96707d..910d4149dd0 100644 --- a/closed/autoconf/custom-hook.m4 +++ b/closed/autoconf/custom-hook.m4 @@ -42,11 +42,35 @@ AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK], OPENJ9_BASIC_SETUP_FUNDAMENTAL_TOOLS OPENJ9_PLATFORM_SETUP OPENJDK_VERSION_DETAILS + OPENJ9_CONFIGURE_CMAKE OPENJ9_CONFIGURE_CUDA + OPENJ9_CONFIGURE_DDR OPENJ9_CONFIGURE_NUMA OPENJ9_THIRD_PARTY_REQUIREMENTS ]) +AC_DEFUN([OPENJ9_CONFIGURE_CMAKE], +[ + AC_ARG_WITH(cmake, [AS_HELP_STRING([--with-cmake], [enable building openJ9 with CMake])], + [ + if test "x$with_cmake" != "x"; then + CMAKE=$with_cmake + fi + with_cmake=yes + ], + [with_cmake=no]) + if test "$with_cmake" == "yes"; then + AC_PATH_PROG([CMAKE], [cmake]) + if test "x$CMAKE" == x; then + AC_MSG_ERROR([Could not find CMake]) + fi + OPENJ9_ENABLE_CMAKE=true + else + OPENJ9_ENABLE_CMAKE=false + fi + AC_SUBST(OPENJ9_ENABLE_CMAKE) +]) + AC_DEFUN([OPENJ9_BASIC_SETUP_FUNDAMENTAL_TOOLS], [ BASIC_REQUIRE_PROGS(M4, m4) @@ -110,6 +134,34 @@ AC_DEFUN([OPENJ9_CONFIGURE_CUDA], AC_SUBST(OPENJ9_GDK_HOME) ]) +AC_DEFUN([OPENJ9_CONFIGURE_DDR], +[ + AC_MSG_CHECKING([for ddr]) + AC_ARG_ENABLE([ddr], [AS_HELP_STRING([--enable-ddr], [enable DDR support @<:@disabled@:>@])]) + if test "x$enable_ddr" = xyes ; then + AC_MSG_RESULT([yes (explicitly enabled)]) + OPENJ9_ENABLE_DDR=true + elif test "x$enable_ddr" = xno ; then + AC_MSG_RESULT([no (explicitly disabled)]) + OPENJ9_ENABLE_DDR=false + elif test "x$enable_ddr" = x ; then + case "$OPENJ9_PLATFORM_CODE" in + xa64|xl64|xz64) + AC_MSG_RESULT([yes (default for $OPENJ9_PLATFORM_CODE)]) + OPENJ9_ENABLE_DDR=true + ;; + *) + AC_MSG_RESULT([no (default for $OPENJ9_PLATFORM_CODE)]) + OPENJ9_ENABLE_DDR=false + ;; + esac + else + AC_MSG_ERROR([--enable-ddr accepts no argument]) + fi + + AC_SUBST(OPENJ9_ENABLE_DDR) +]) + AC_DEFUN([OPENJ9_PLATFORM_EXTRACT_VARS_FROM_CPU], [ # Convert openjdk cpu names to openj9 names @@ -129,6 +181,9 @@ AC_DEFUN([OPENJ9_PLATFORM_EXTRACT_VARS_FROM_CPU], i370) OPENJ9_CPU=i370 ;; + arm) + OPENJ9_CPU=arm + ;; *) AC_MSG_ERROR([unsupported OpenJ9 cpu $1]) ;; @@ -137,6 +192,9 @@ AC_DEFUN([OPENJ9_PLATFORM_EXTRACT_VARS_FROM_CPU], AC_DEFUN_ONCE([OPENJ9_PLATFORM_SETUP], [ + # When compiling natively host_cpu and build_cpu are the same. But when + # cross compiling we need to work with the host_cpu (which is where the final + # JVM will run). OPENJ9_PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_${OPENJ9_CPU}_cmprssptrs" OPENJ9_LIBS_SUBDIR=compressedrefs @@ -147,6 +205,9 @@ AC_DEFUN_ONCE([OPENJ9_PLATFORM_SETUP], elif test "x$OPENJDK_BUILD_OS" = xwindows; then OPENJ9_PLATFORM_CODE=wa64 OPENJ9_BUILDSPEC="win_x86-64_cmprssptrs" + elif test "x$OPENJDK_BUILD_OS" = xmacosx; then + OPENJ9_PLATFORM_CODE=oa64 + OPENJ9_BUILDSPEC="osx_x86-64" else AC_MSG_ERROR([Unsupported OpenJ9 platform ${OPENJDK_BUILD_OS}, contact support team!]) fi @@ -160,6 +221,10 @@ AC_DEFUN_ONCE([OPENJ9_PLATFORM_SETUP], elif test "x$OPENJ9_CPU" = xi370; then OPENJ9_BUILDSPEC="zos_390-64_cmprssptrs" OPENJ9_PLATFORM_CODE=mz64 + elif test "x$OPENJ9_CPU" = xarm; then + OPENJ9_PLATFORM_CODE=xr32 + OPENJ9_BUILDSPEC=linux_arm_linaro + OPENJ9_LIBS_SUBDIR=default else AC_MSG_ERROR([Unsupported OpenJ9 cpu ${OPENJ9_CPU}, contact support team!]) fi @@ -173,7 +238,12 @@ AC_DEFUN_ONCE([OPENJ9_PLATFORM_SETUP], AC_DEFUN_ONCE([OPENJDK_VERSION_DETAILS], [ OPENJDK_SHA=`git -C $TOPDIR rev-parse --short HEAD` - OPENJDK_TAG=`git -C $TOPDIR describe --abbrev=0 --tags --match "jdk-11*" "${OPENJDK_SHA}"` + LAST_TAGGED_SHA=`git -C $TOPDIR rev-list --tags="jdk-11*" --max-count=1 2>/dev/null` + if test "x$LAST_TAGGED_SHA" != x; then + OPENJDK_TAG=`git -C $TOPDIR describe --tags "$LAST_TAGGED_SHA"` + else + OPENJDK_TAG= + fi AC_SUBST(OPENJDK_SHA) AC_SUBST(OPENJDK_TAG) diff --git a/closed/autoconf/custom-spec.gmk.in b/closed/autoconf/custom-spec.gmk.in index 2028fcde163..2800a4e1b88 100644 --- a/closed/autoconf/custom-spec.gmk.in +++ b/closed/autoconf/custom-spec.gmk.in @@ -42,6 +42,9 @@ ifneq (,@OPENJ9_GDK_HOME@) export GDK_HOME := @OPENJ9_GDK_HOME@ endif +# DDR +OPENJ9_ENABLE_DDR := @OPENJ9_ENABLE_DDR@ + # for constructing version output COMPILER_VERSION_STRING := @COMPILER_VERSION_STRING@ USERNAME := @USERNAME@ @@ -51,6 +54,10 @@ OPENJDK_TAG := @OPENJDK_TAG@ J9JDK_EXT_VERSION := ${VERSION_NUMBER_FOUR_POSITIONS} J9JDK_EXT_NAME := Extensions for OpenJDK for Eclipse OpenJ9 +# required by CMake +CMAKE := @CMAKE@ +OPENJ9_ENABLE_CMAKE := @OPENJ9_ENABLE_CMAKE@ + # required by UMA FREEMARKER_JAR := @FREEMARKER_JAR@ OPENJ9_BUILDSPEC := @OPENJ9_BUILDSPEC@ diff --git a/closed/make/DDR-gensrc.gmk b/closed/make/DDR-gensrc.gmk new file mode 100644 index 00000000000..7c4e393dad7 --- /dev/null +++ b/closed/make/DDR-gensrc.gmk @@ -0,0 +1,90 @@ +# =========================================================================== +# (c) Copyright IBM Corp. 2018, 2018 All Rights Reserved +# =========================================================================== +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, see . +# =========================================================================== + +# The main target. +all : + +ifeq (,$(wildcard $(SPEC))) + $(error BuildDDR.gmk needs SPEC set to a proper spec.gmk) +endif + +include $(SPEC) +include $(TOPDIR)/make/common/MakeBase.gmk +include $(TOPDIR)/make/common/JavaCompilation.gmk +include $(TOPDIR)/make/common/SetupJavaCompilers.gmk + +# Supporting definitions. +DDR_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/ddr +DDR_VM_SRC_ROOT := $(OPENJ9_TOPDIR)/debugtools/DDR_VM/src + +############################################################################# + +# Build a jar containing the code generators. +$(eval $(call SetupJavaCompilation,BUILD_DDR_TOOLS, \ + SETUP := GENERATE_OLDBYTECODE, \ + BIN := $(DDR_SUPPORT_DIR)/tools, \ + CLASSPATH := $(addprefix $(JDK_OUTPUTDIR)/modules/, java.base openj9.dtfj), \ + SRC := $(DDR_VM_SRC_ROOT), \ + INCLUDE_FILES := $(addsuffix .java,$(subst .,/, \ + com.ibm.j9ddr.BytecodeGenerator \ + com.ibm.j9ddr.CTypeParser \ + com.ibm.j9ddr.StructureHeader \ + com.ibm.j9ddr.StructureReader \ + com.ibm.j9ddr.StructureTypeManager \ + com.ibm.j9ddr.logging.LoggerNames \ + com.ibm.j9ddr.tools.FlagStructureList \ + com.ibm.j9ddr.tools.PointerGenerator \ + com.ibm.j9ddr.tools.StructureStubGenerator \ + com.ibm.j9ddr.tools.store.J9DDRStructureStore \ + com.ibm.j9ddr.tools.store.StructureKey \ + com.ibm.j9ddr.tools.store.StructureMismatchError \ + )), \ + )) + +############################################################################# + +# The superset file is built with the VM. +DDR_SUPERSET_FILE := $(OUTPUTDIR)/vm/superset.dat + +# Generate Java pointer classes. +DDR_POINTERS_MARKER := $(DDR_SUPPORT_DIR)/pointers.done + +$(DDR_POINTERS_MARKER) : $(DDR_SUPERSET_FILE) $(BUILD_DDR_TOOLS) + @$(ECHO) Generating DDR pointer classes + @$(RM) -rf $(DDR_VM_SRC_ROOT)/com/ibm/j9ddr/vm29/pointer/generated/ + @$(JAVA) -cp $(BUILD_DDR_TOOLS_BIN) com.ibm.j9ddr.tools.PointerGenerator \ + -f $(dir $(DDR_SUPERSET_FILE)) \ + -s $(notdir $(DDR_SUPERSET_FILE)) \ + -p com.ibm.j9ddr.vm29.pointer.generated \ + -v 29 \ + -o $(DDR_VM_SRC_ROOT) + @$(TOUCH) $@ + +# Generate Java structure stub classes. +DDR_STRUCTURES_MARKER := $(DDR_SUPPORT_DIR)/structures.done + +$(DDR_STRUCTURES_MARKER) : $(DDR_SUPERSET_FILE) $(BUILD_DDR_TOOLS) + @$(ECHO) Generating DDR structure stubs + @$(RM) -rf $(DDR_VM_SRC_ROOT)/com/ibm/j9ddr/vm29/structure/ + @$(JAVA) -cp $(BUILD_DDR_TOOLS_BIN) com.ibm.j9ddr.tools.StructureStubGenerator \ + -f $(dir $(DDR_SUPERSET_FILE)) \ + -s $(notdir $(DDR_SUPERSET_FILE)) \ + -p com.ibm.j9ddr.vm29.structure \ + -o $(DDR_VM_SRC_ROOT) + @$(TOUCH) $@ + +all : $(DDR_POINTERS_MARKER) $(DDR_STRUCTURES_MARKER) diff --git a/closed/make/DDR-jar.gmk b/closed/make/DDR-jar.gmk new file mode 100644 index 00000000000..d5535b8a06d --- /dev/null +++ b/closed/make/DDR-jar.gmk @@ -0,0 +1,64 @@ +# =========================================================================== +# (c) Copyright IBM Corp. 2018, 2018 All Rights Reserved +# =========================================================================== +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, see . +# =========================================================================== + +# The main target. +all : + +ifeq (,$(wildcard $(SPEC))) + $(error BuildDDR.gmk needs SPEC set to a proper spec.gmk) +endif + +include $(SPEC) +include $(TOPDIR)/make/common/MakeBase.gmk +include $(TOPDIR)/make/common/JavaCompilation.gmk +include $(TOPDIR)/make/common/SetupJavaCompilers.gmk + +# Supporting definitions. +DDR_CLASSES_BIN := $(SUPPORT_OUTPUTDIR)/ddr/classes + +# We depend upon class files from these modules. +DDR_CLASSPATH := $(addprefix $(JDK_OUTPUTDIR)/modules/, \ + java.base \ + java.desktop \ + openj9.dtfj \ + openj9.traceformat \ + ) + +DDR_SRC_EXCLUDES := com/ibm/j9ddr/tools/ant + +ifeq (,$(filter mz31 mz64,$(OPENJ9_PLATFORM_CODE))) +DDR_SRC_EXCLUDES += com/ibm/j9ddr/corereaders/tdump +endif + +$(eval $(call SetupJavaCompilation,BUILD_DDR_CLASSES, \ + SETUP := GENERATE_USINGJDKBYTECODE, \ + BIN := $(DDR_CLASSES_BIN), \ + CLASSPATH := $(DDR_CLASSPATH), \ + SRC := $(OPENJ9_TOPDIR)/debugtools/DDR_VM/src, \ + EXCLUDES := $(DDR_SRC_EXCLUDES), \ + COPY := com/ibm/j9ddr/StructureAliases29.dat, \ + )) + +$(eval $(call SetupJarArchive,BUILD_DDR_JAR, \ + DEPENDENCIES := $(BUILD_DDR_CLASSES), \ + SRCS := $(DDR_CLASSES_BIN), \ + SUFFIXES := .class .dat .properties, \ + EXCLUDES := com/ibm/j9ddr/vm29/structure, \ + JAR := $(call FindLibDirForModule, openj9.dtfj)/ddr/j9ddr.jar, \ + )) + +all : $(BUILD_DDR_JAR) diff --git a/closed/make/Main.gmk b/closed/make/Main.gmk index 14103415a70..b277ee4dc69 100644 --- a/closed/make/Main.gmk +++ b/closed/make/Main.gmk @@ -1,10 +1,9 @@ # =========================================================================== # (c) Copyright IBM Corp. 2017, 2018 All Rights Reserved # =========================================================================== -# # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. +# published by the Free Software Foundation. # # This code is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or @@ -14,7 +13,6 @@ # # You should have received a copy of the GNU General Public License version # 2 along with this work; if not, see . -# # =========================================================================== CLEAN_DIRS += vm @@ -33,10 +31,9 @@ JVM_TOOLS_TARGETS := JVM_DOCS_TARGETS := JVM_TEST_IMAGE_TARGETS := DEFAULT_JMOD_DEPS := j9vm-compose-buildjvm - -java.base-libs : j9vm-build +PHASE_MAKEDIRS += $(TOPDIR)/closed/make/closed_make -PHASE_MAKEDIRS += $(TOPDIR)/closed/closed_make +java.base-libs : j9vm-build j9vm-build : buildtools-langtools +($(CD) $(TOPDIR)/closed && $(MAKE) -f OpenJ9.gmk SPEC=$(SPEC) VERSION_MAJOR=$(VERSION_FEATURE) build-j9) @@ -52,4 +49,18 @@ openj9-jdk-image : jdk-image j9vm-build openj9-jre-image : jre-image j9vm-build +($(CD) $(TOPDIR)/closed && $(MAKE) -f OpenJ9.gmk SPEC=$(SPEC) stage_openj9_jre_image) +ifeq (true,$(OPENJ9_ENABLE_DDR)) + +.PHONY : openj9.dtfj-ddr-gensrc openj9.dtfj-ddr-jar + +openj9.dtfj-ddr-gensrc : j9vm-build $(addsuffix -java, java.base java.desktop openj9.dtfj openj9.traceformat) + +$(MAKE) -f $(TOPDIR)/closed/make/DDR-gensrc.gmk SPEC=$(SPEC) + +openj9.dtfj-ddr-jar : openj9.dtfj-ddr-gensrc + +$(MAKE) -f $(TOPDIR)/closed/make/DDR-jar.gmk SPEC=$(SPEC) + +openj9.dtfj-jmod : openj9.dtfj-ddr-jar + +endif # OPENJ9_ENABLE_DDR + ALL_TARGETS += openj9-jdk-image openj9-jre-image diff --git a/make/CreateJmods.gmk b/make/CreateJmods.gmk index 0b530bb8b6b..b1392711484 100644 --- a/make/CreateJmods.gmk +++ b/make/CreateJmods.gmk @@ -80,10 +80,15 @@ ifneq ($(MAN_DIR), ) DEPS += $(call CacheFind, $(MAN_DIR)) endif +# If a specific modules_legal dir exists for this module, only pick up files +# from there. These files were explicitly filtered or modified in -copy +# targets. For the rest, just pick up everything from the source legal dirs. LEGAL_NOTICES := \ - $(call uniq, $(SUPPORT_OUTPUTDIR)/modules_legal/java.base \ - $(call FindModuleLegalDirs, $(MODULE))) \ - # + $(SUPPORT_OUTPUTDIR)/modules_legal/common \ + $(if $(wildcard $(SUPPORT_OUTPUTDIR)/modules_legal/$(MODULE)), \ + $(wildcard $(SUPPORT_OUTPUTDIR)/modules_legal/$(MODULE)), \ + $(call FindModuleLegalSrcDirs, $(MODULE)) \ + ) LEGAL_NOTICES_PATH := $(call PathList, $(LEGAL_NOTICES)) DEPS += $(call CacheFind, $(LEGAL_NOTICES)) @@ -112,6 +117,17 @@ ifeq ($(MODULE), java.base) --hash-modules '^(?!$(EXCLUDE_PATTERN)$$)' endif endif +else # not java.base + ifeq ($(OPENJDK_TARGET_OS), windows) + # Only java.base needs to include the MSVC*_DLLs. Make sure no other module + # tries to include them (typically imported ones). + ifneq ($(wildcard $(LIBS_DIR)/$(notdir $(MSVCR_DLL))), ) + JMOD_FLAGS += --exclude '$(notdir $(MSVCR_DLL))' + endif + ifneq ($(wildcard $(LIBS_DIR)/$(notdir $(MSVCP_DLL))), ) + JMOD_FLAGS += --exclude '$(notdir $(MSVCP_DLL))' + endif + endif endif # Changes to the jmod tool itself should also trigger a rebuild of all jmods. @@ -128,18 +144,21 @@ ifeq ($(INTERIM_JMOD), true) DEPS := $(filter-out $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist, $(DEPS)) endif +JMOD_FLAGS += --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' + # Create jmods in a temp dir and then move them into place to keep the # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times. $(JMODS_DIR)/$(MODULE).jmod: $(DEPS) $(call LogWarn, Creating $(patsubst $(OUTPUTDIR)/%, %, $@)) $(call MakeDir, $(JMODS_DIR) $(JMODS_TEMPDIR)) $(RM) $@ $(JMODS_TEMPDIR)/$(notdir $@) - $(JMOD) create \ - --module-version $(VERSION_SHORT) \ - --target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \ - --module-path $(JMODS_DIR) \ - --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' \ - $(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@) + $(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/jmods/$(MODULE).jmod, \ + $(JMOD) create \ + --module-version $(VERSION_SHORT) \ + --target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \ + --module-path $(JMODS_DIR) \ + $(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@) \ + ) $(MV) $(JMODS_TEMPDIR)/$(notdir $@) $@ TARGETS += $(JMODS_DIR)/$(MODULE).jmod diff --git a/make/Init.gmk b/make/Init.gmk index 5027dd68af9..fa1c5e6fdaf 100644 --- a/make/Init.gmk +++ b/make/Init.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -226,6 +226,15 @@ else # HAS_SPEC=true # Parse COMPARE_BUILD (for makefile development) $(eval $(call ParseCompareBuild)) + # If no LOG= was given on command line, but we have a non-standard default + # value, use that instead and re-parse log level. + ifeq ($(LOG), ) + ifneq ($(DEFAULT_LOG), ) + override LOG := $(DEFAULT_LOG) + $(eval $(call ParseLogLevel)) + endif + endif + ifeq ($(LOG_NOFILE), true) # Disable build log if LOG=[level,]nofile was given override BUILD_LOG_PIPE := @@ -301,9 +310,13 @@ else # HAS_SPEC=true ifneq ($(PARALLEL_TARGETS), ) $(call StartGlobalTimer) $(call PrepareSmartJavac) + # JOBS will only be empty for a bootcycle-images recursive call + # or if specified via a make argument directly. In those cases + # treat it as NOT using jobs at all. ( cd $(TOPDIR) && \ $(NICE) $(MAKE) $(MAKE_ARGS) $(OUTPUT_SYNC_FLAG) \ - -j $(JOBS) -f make/Main.gmk $(USER_MAKE_VARS) \ + $(if $(JOBS), -j $(JOBS)) \ + -f make/Main.gmk $(USER_MAKE_VARS) \ $(PARALLEL_TARGETS) $(COMPARE_BUILD_MAKE) $(BUILD_LOG_PIPE) || \ ( exitcode=$$? && \ $(PRINTF) "\nERROR: Build failed for $(TARGET_DESCRIPTION) (exit code $$exitcode) \n" \ diff --git a/make/InitSupport.gmk b/make/InitSupport.gmk index c63941f47ca..37bb7ebdd2f 100644 --- a/make/InitSupport.gmk +++ b/make/InitSupport.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -131,73 +131,6 @@ ifeq ($(HAS_SPEC),) endif endef - # Look for a given option in the LOG variable, and if found, set a variable - # and remove the option from the LOG variable - # $1: The option to look for - # $2: The option to set to "true" if the option is found - define ParseLogOption - ifneq ($$(findstring $1, $$(LOG)),) - $2 := true - # COMMA is defined in spec.gmk, but that is not included yet - COMMA := , - # First try to remove ",