Skip to content

Commit

Permalink
Merge pull request ibmruntimes#2 from Jason-Yong/openj9-jdk-zos
Browse files Browse the repository at this point in the history
Merge jdk11+10
  • Loading branch information
yongja79 authored and GitHub Enterprise committed May 3, 2018
2 parents 92ac6f7 + b90a3a7 commit 724acb5
Show file tree
Hide file tree
Showing 1,160 changed files with 59,134 additions and 26,410 deletions.
42 changes: 27 additions & 15 deletions closed/OpenJ9.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) \
Expand All @@ -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
Expand All @@ -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)))
Expand Down
72 changes: 71 additions & 1 deletion closed/autoconf/custom-hook.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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])
;;
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions closed/autoconf/custom-spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -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@
Expand All @@ -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@
Expand Down
90 changes: 90 additions & 0 deletions closed/make/DDR-gensrc.gmk
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
# ===========================================================================

# 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)
64 changes: 64 additions & 0 deletions closed/make/DDR-jar.gmk
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
# ===========================================================================

# 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)
Loading

0 comments on commit 724acb5

Please sign in to comment.