Skip to content

Commit 390b4f2

Browse files
keithc-caGitHub Enterprise
authored and
GitHub Enterprise
committed
Merge pull request ibmruntimes#359 from vsebe/ibm-jdk11-jcldev.jzos
JZOS Integration
2 parents 0ee64d8 + 0f6719a commit 390b4f2

9 files changed

+99
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
/closedj9
2828
/CMPIBMPKCS
2929
/CMPJAAS
30+
/CMPJZOS
3031
/CMPSAF
3132
/omr
3233
/openj9

closed/Components.gmk

+53-2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,29 @@ $(foreach module, $(CMP_MODULES), \
5757
$(eval $(call stage_module_rule,$(module))) \
5858
)
5959

60+
JZOS_NATIVES_DIR := $(call find_native_src_dir,ibm.jzos)
61+
JZOS_BUILD_VERSION_PROPERTIES := $(JZOS_NATIVES_DIR)/build_version.properties
62+
63+
# Copy build_version.properties file to ibm.jzos stage directory
64+
$(eval $(call SetupCopyFiles, COPY_JZOS_BUILD_VERSION_PROPERTIES, \
65+
DEST := $(SUPPORT_OUTPUTDIR)/j9jcl_sources/ibm.jzos/share/classes/com/ibm/jzos,\
66+
FILES := $(JZOS_BUILD_VERSION_PROPERTIES), \
67+
))
68+
69+
ibm.jzos-stage : $(COPY_JZOS_BUILD_VERSION_PROPERTIES)
70+
6071
ibm.os390.security_target := libSecurityServices.so
6172
ibm.security.auth_target := all_$(OPENJDK_BUILD_CPU_BITS)
73+
ibm.jzos_target := build_jzos
74+
ibm.zosrrs_target := build_rrs
75+
76+
JZOS_BUILD_VERSION := \
77+
$(shell $(SED) -n -e 's/^BUILD_VERSION=//p' < $(JZOS_BUILD_VERSION_PROPERTIES))
78+
79+
# set arch type: 16 for 64 bits or 10 for 31 bits
80+
JZOS_ARCH := 16
81+
JZOS_BUILD_ENV_VARS_FILE := $(JZOS_NATIVES_DIR)/build.rc
82+
JZOS_JDFSORT := $(JZOS_NATIVES_DIR)/jdfsort/jdfsort
6283

6384
# generate_lib_target
6485
# -------------------
@@ -67,10 +88,24 @@ ibm.security.auth_target := all_$(OPENJDK_BUILD_CPU_BITS)
6788
define generate_lib_target
6889
$1-libs :
6990
@$(ECHO) Compiling $1 native
91+
ifeq (,$(findstring $1,ibm.jzos ibm.zosrrs))
7092
$(MAKE) -C $(call find_native_src_dir,$1) \
71-
JAVA_HOME=$(BOOT_JDK) \
7293
HEADERS_DIR=$(SUPPORT_OUTPUTDIR)/headers/$1/ \
94+
JAVA_HOME=$(BOOT_JDK) \
7395
$$($1_target)
96+
else
97+
export _BPX_SHAREAS=NO HLQ_ZOS=BLD.ZOSR23.PIDPLUS \
98+
&& . $(JZOS_BUILD_ENV_VARS_FILE) \
99+
&& $(MAKE) -C $(call find_native_src_dir,$1) \
100+
BUILD_VERSION="$(JZOS_BUILD_VERSION)" \
101+
HEADERS_DIR=$(SUPPORT_OUTPUTDIR)/headers/$1/ \
102+
JAVA_HOME=$(BOOT_JDK) \
103+
JDFSORT=$(JZOS_JDFSORT) \
104+
JZOS_HOME=$(call find_native_src_dir,$1) \
105+
SDK=$(JZOS_ARCH) \
106+
$$($1_target)
107+
endif
108+
@$(ECHO) $1 native compile completed
74109
endef
75110

76111
# Targets to compile native code
@@ -101,7 +136,23 @@ $(call FindLibDirForModule,$1)/$(notdir $2) : $2
101136
endef
102137

103138
# Targets to copy native libs
104-
$(foreach module, $(CMP_MODULES), \
139+
$(foreach module, $(filter-out ibm.jzos ibm.zosrrs,$(CMP_MODULES)), \
105140
$(foreach file, \
106141
$(wildcard $(call find_native_src_dir,$(module))/*$(SHARED_LIBRARY_SUFFIX)), \
107142
$(eval $(call add_component_natives_libs,$(module),$(file)))))
143+
144+
# Target to copy ibm.zosrrs native libs
145+
$(eval $(call add_component_natives_libs,ibm.zosrrs,$(call find_native_src_dir,ibm.zosrrs)/libzosrrs$(SHARED_LIBRARY_SUFFIX)))
146+
147+
# Target to copy ibm.jzos native libs
148+
$(foreach file, \
149+
$(wildcard $(addprefix $(JZOS_NATIVES_DIR)/,JVMLDM16 libjzos$(SHARED_LIBRARY_SUFFIX) libjzos.x)), \
150+
$(eval $(call add_component_natives_libs,ibm.jzos,$(file))))
151+
152+
# Copy jdfsort to $(SUPPORT_OUTPUTDIR)/modules_cmds/ibm.jzos/
153+
$(eval $(call SetupCopyFiles, COPY_JDFSORT, \
154+
DEST := $(call FindExecutableDirForModule,ibm.jzos),\
155+
FILES := $(JZOS_JDFSORT), \
156+
))
157+
158+
ibm.jzos-copy : $(COPY_JDFSORT)

closed/DDR.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ $(eval $(call SetupJavaCompilation,BUILD_DDR_STUBS, \
168168
SETUP := GENERATE_USINGJDKBYTECODE, \
169169
BIN := $(DDR_STUBS_BIN), \
170170
CLASSPATH := $(JDK_OUTPUTDIR)/modules/java.base, \
171-
SRC := $(OPENJ9_TOPDIR)/jcl/src/ibm.jzos/share/classes \
171+
SRC := $(OPENJ9_TOPDIR)/jcl/stubs/ibm.jzos/share/classes \
172172
))
173173

174174
# Finally, we depend upon the stub classes.

closed/custom/CompileJavaModules.gmk

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# 2 along with this work; if not, see <http://www.gnu.org/licenses/>.
1919
# ===========================================================================
2020

21+
ibm.jzos_COPY += .properties
2122
java.base_COPY += ExternalMessages.properties
2223
openj9.gpu_COPY += ibm_gpu_thresholds.properties
2324
jdk.jcmd_EXCLUDES += sun

closed/custom/Images-pre.gmk

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# ===========================================================================
2+
# (c) Copyright IBM Corp. 2020, 2020 All Rights Reserved
3+
# ===========================================================================
4+
# This code is free software; you can redistribute it and/or modify it
5+
# under the terms of the GNU General Public License version 2 only, as
6+
# published by the Free Software Foundation.
7+
#
8+
# IBM designates this particular file as subject to the "Classpath" exception
9+
# as provided by IBM in the LICENSE file that accompanied this code.
10+
#
11+
# This code is distributed in the hope that it will be useful, but WITHOUT
12+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
# version 2 for more details (a copy is included in the LICENSE file that
15+
# accompanied this code).
16+
#
17+
# You should have received a copy of the GNU General Public License version
18+
# 2 along with this work; if not, see <http://www.gnu.org/licenses/>.
19+
# ===========================================================================
20+
21+
ifeq ($(OPENJDK_TARGET_OS), zos)
22+
MVSTOOLS_DIR := $(TOPDIR)/CMPJZOS/mvstools
23+
24+
ifneq ($(wildcard $(MVSTOOLS_DIR)/*), )
25+
$(eval $(call SetupCopyFiles, JDK_COPY_MVSTOOLS, \
26+
SRC := $(MVSTOOLS_DIR), \
27+
DEST := $(JDK_IMAGE_DIR)/mvstools, \
28+
FILES := $(call FindFiles, $(MVSTOOLS_DIR)/), \
29+
))
30+
31+
JDK_TARGETS += $(JDK_COPY_MVSTOOLS)
32+
endif
33+
endif

closed/custom/Main-post.gmk closed/custom/Main-pre.gmk

+2
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ CMP_COPY_TARGETS := $(addsuffix -copy, $(CMP_LIBS_MODULES))
4848
ALL_TARGETS += $(CMP_LIBS_TARGETS) $(CMP_COPY_TARGETS)
4949

5050
$(foreach module, $(CMP_LIBS_MODULES), $(eval $(module)_JMOD_DEPS += $(module)-copy))
51+
52+
clean : $(addprefix clean-, $(CMP_LIBS_MODULES))

closed/custom/Main.gmk

+3
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,6 @@ clean-openj9-only-docs :
111111
@$(PRINTF) " done\n"
112112

113113
ALL_TARGETS += clean-openj9-only-docs
114+
115+
# include Main-pre.gmk
116+
$(eval $(call IncludeCustomExtension, Main-pre.gmk))

closed/custom/common/ComponentsCommon.gmk

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ COMPONENTS :=
2222

2323
ifeq ($(OPENJDK_TARGET_OS), zos)
2424
COMPONENTS += \
25-
$(notdir $(wildcard $(addprefix $(TOPDIR)/,CMPIBMPKCS CMPJAAS CMPSAF)))
25+
$(notdir $(wildcard $(addprefix $(TOPDIR)/,CMPIBMPKCS CMPJAAS CMPJZOS CMPSAF)))
2626
endif
2727

2828
CMP_MODULES := \
@@ -38,7 +38,8 @@ PLATFORM_MODULES += $(CMP_MODULES)
3838
# $1 = module name
3939
find_native_src_dir = \
4040
$(wildcard $(addsuffix build/mvs/$(OPENJDK_BUILD_CPU_BITS)-bit, \
41-
$(patsubst %/src/$1, %/, $(wildcard $(TOPDIR)/*/src/$1))))
41+
$(patsubst %/src/$1, %/, $(wildcard $(TOPDIR)/*/src/$1))) \
42+
$(patsubst %/$1, %/$(OPENJDK_TARGET_OS)/share, $(wildcard $(TOPDIR)/*/src/$1)))
4243

4344
CMP_LIBS_MODULES := \
4445
$(foreach module, $(CMP_MODULES), \

closed/custom/common/SetupJavaCompilers.gmk

+2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020

2121
# OpenJ9 requires more lenient javac warnings for these modules.
2222
WARNING_MODULES := \
23+
ibm.jzos \
2324
ibm.security.auth \
2425
ibm.security.pkcs \
26+
ibm.zosrrs \
2527
java.base \
2628
jdk.management \
2729
openj9.dataaccess \

0 commit comments

Comments
 (0)