Skip to content

Commit a8263c3

Browse files
committed
Add new configure option --with-mixedrefs for mixed pointer mode
If --with-mixedrefs is specified in the configure command, the 'default' OPENJ9_LIBS_SUBDIR is used for the build. The mxdptrs CMake file corresponding to the build OS is used as the OPENJ9_BUILDSPEC. --with-mixedrefs=[static/dynamic] sets the reference determination mode. --with-mixedrefs without any value provided defaults to static mode. OMR_MIXED_REFERENCES_MODE is communicated to OpenJ9 and OMR through CMake args. Fail configure if --with-mixedrefs is used without CMake enabled. The new mxdptr build specs are defined in OpenJ9. The compressed and full GC libraries generated with the mixed build work are copied to the OPENJ9_LIBS_SUBDIR alongside the other existing libraries. j9gc29, j9gcchk29 are always copied j9gc_full29, j9gcchk_full29 are copied when running in mixedrefs static mode If an OpenJ9-equivalent OS has been specified in OPENJ9_BUILD_OS, use the specified OS string to override the provided OPENJDK_BUILD_OS. Use OPENJ9_BUILD_MODE_ARCH to capture the other half of the OPENJ9_BUILDSPEC, where the architecture and the pointer mode (or other additional modes/settings) are specified. Signed-off-by: Sharon Wang <[email protected]>
1 parent 04fa704 commit a8263c3

File tree

6 files changed

+110
-54
lines changed

6 files changed

+110
-54
lines changed

closed/CopyToBuildJdk.gmk

+2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,9 @@ $(call openj9_copy_shlibs, \
166166
j9dmp29 \
167167
j9jextract \
168168
j9gc29 \
169+
$(if $(filter static,$(OMR_MIXED_REFERENCES_MODE)),j9gc_full29) \
169170
j9gcchk29 \
171+
$(if $(filter static,$(OMR_MIXED_REFERENCES_MODE)),j9gcchk_full29) \
170172
j9hookable29 \
171173
j9jit29 \
172174
j9jnichk29 \

closed/OpenJ9.gmk

+1
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ CMAKE_ARGS := \
255255
-DJ9VM_OMR_DIR=$(OPENJ9OMR_TOPDIR) \
256256
-DBUILD_ID=$(BUILD_ID) \
257257
-DJAVA_SPEC_VERSION=8 \
258+
-DOMR_MIXED_REFERENCES_MODE=$(OMR_MIXED_REFERENCES_MODE) \
258259
-DOPENJ9_BUILD=true
259260

260261
ifeq (windows,$(OPENJDK_TARGET_OS))

common/autoconf/generated-configure.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4410,7 +4410,7 @@ VS_SDK_PLATFORM_NAME_2017=
44104410
#CUSTOM_AUTOCONF_INCLUDE
44114411

44124412
# Do not change or remove the following line, it is needed for consistency checks:
4413-
DATE_WHEN_GENERATED=1604507962
4413+
DATE_WHEN_GENERATED=1605236068
44144414

44154415
###############################################################################
44164416
#

jdk/make/closed/autoconf/custom-hook.m4

+47-26
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ AC_DEFUN([OPENJ9_CONFIGURE_CMAKE],
6161
[
6262
AC_ARG_WITH(cmake, [AS_HELP_STRING([--with-cmake], [enable building openJ9 with CMake])],
6363
[
64-
if test "x$with_cmake" == xyes -o "x$with_cmake" == x ; then
64+
if test "x$with_cmake" = xyes -o "x$with_cmake" = x ; then
6565
with_cmake=cmake
6666
fi
6767
if test "x$with_cmake" != xno ; then
@@ -74,10 +74,15 @@ AC_DEFUN([OPENJ9_CONFIGURE_CMAKE],
7474
fi
7575
],
7676
[with_cmake=no])
77-
if test "$with_cmake" == yes ; then
77+
if test "$with_cmake" = yes ; then
7878
OPENJ9_ENABLE_CMAKE=true
7979
else
8080
OPENJ9_ENABLE_CMAKE=false
81+
82+
# Currently, mixedrefs mode is only available with CMake enabled
83+
if test "x$OMR_MIXED_REFERENCES_MODE" != xoff ; then
84+
AC_MSG_ERROR([[--with-mixedrefs=[static|dynamic] requires --with-cmake]])
85+
fi
8186
fi
8287
AC_SUBST(OPENJ9_ENABLE_CMAKE)
8388
])
@@ -270,44 +275,57 @@ AC_DEFUN([OPENJ9_PLATFORM_SETUP],
270275
AC_ARG_WITH(noncompressedrefs, [AS_HELP_STRING([--with-noncompressedrefs],
271276
[build non-compressedrefs vm (large heap)])])
272277
278+
AC_ARG_WITH(mixedrefs, [AS_HELP_STRING([--with-mixedrefs],
279+
[build mixedrefs vm (--with-mixedrefs=static or --with-mixedrefs=dynamic)])])
280+
273281
OPENJ9_PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu)
274-
if test "x$with_noncompressedrefs" != x -o "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
275-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_${OPENJ9_CPU}"
282+
283+
# Default OPENJ9_BUILD_OS=OPENJDK_BUILD_OS, but override with OpenJ9 equivalent as appropriate
284+
OPENJ9_BUILD_OS="${OPENJDK_BUILD_OS}"
285+
286+
OMR_MIXED_REFERENCES_MODE=off
287+
if test "x$with_mixedrefs" != x -a "x$with_mixedrefs" != xno; then
288+
if test "x$with_mixedrefs" = xyes -o "x$with_mixedrefs" = xstatic; then
289+
OMR_MIXED_REFERENCES_MODE=static
290+
elif test "x$with_mixedrefs" = xdynamic; then
291+
OMR_MIXED_REFERENCES_MODE=dynamic
292+
else
293+
AC_MSG_ERROR([OpenJ9 supports --with-mixedrefs=static and --with-mixedrefs=dynamic])
294+
fi
295+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}_mxdptrs"
296+
OPENJ9_LIBS_SUBDIR=default
297+
elif test "x$with_noncompressedrefs" = xyes ; then
298+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}"
276299
OPENJ9_LIBS_SUBDIR=default
277300
else
278-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_${OPENJ9_CPU}_cmprssptrs"
301+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}_cmprssptrs"
279302
OPENJ9_LIBS_SUBDIR=compressedrefs
280303
fi
281304
282305
if test "x$OPENJ9_CPU" = xx86-64 ; then
283-
if test "x$OPENJDK_BUILD_OS" = xlinux ; then
306+
if test "x$OPENJ9_BUILD_OS" = xlinux ; then
284307
OPENJ9_PLATFORM_CODE=xa64
285-
elif test "x$OPENJDK_BUILD_OS" = xwindows ; then
308+
elif test "x$OPENJ9_BUILD_OS" = xwindows ; then
286309
OPENJ9_PLATFORM_CODE=wa64
287-
if test "x$OPENJ9_LIBS_SUBDIR" = xdefault ; then
288-
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
289-
OPENJ9_PLATFORM_CODE=wi32
290-
OPENJ9_BUILDSPEC="win_x86"
291-
else
292-
OPENJ9_BUILDSPEC="win_x86-64"
293-
fi
294-
else
295-
OPENJ9_BUILDSPEC="win_x86-64_cmprssptrs"
310+
OPENJ9_BUILD_OS=win
311+
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
312+
OPENJ9_PLATFORM_CODE=wi32
313+
OPENJ9_BUILD_MODE_ARCH="x86"
296314
fi
297-
elif test "x$OPENJDK_BUILD_OS" = xmacosx ; then
315+
elif test "x$OPENJ9_BUILD_OS" = xmacosx ; then
298316
OPENJ9_PLATFORM_CODE=oa64
299-
if test "x$OPENJ9_LIBS_SUBDIR" = xdefault ; then
300-
OPENJ9_BUILDSPEC="osx_x86-64"
301-
else
302-
OPENJ9_BUILDSPEC="osx_x86-64_cmprssptrs"
303-
fi
317+
OPENJ9_BUILD_OS=osx
304318
else
305-
AC_MSG_ERROR([Unsupported OpenJ9 platform ${OPENJDK_BUILD_OS}!])
319+
AC_MSG_ERROR([Unsupported OpenJ9 platform ${OPENJ9_BUILD_OS}!])
306320
fi
307321
elif test "x$OPENJ9_CPU" = xppc-64_le ; then
308322
OPENJ9_PLATFORM_CODE=xl64
309-
if test "x$OPENJ9_LIBS_SUBDIR" != xdefault ; then
310-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_ppc-64_cmprssptrs_le"
323+
if test "x$OMR_MIXED_REFERENCES_MODE" = xoff ; then
324+
if test "x$OPENJ9_LIBS_SUBDIR" != xdefault ; then
325+
OPENJ9_BUILD_MODE_ARCH="ppc-64_cmprssptrs_le"
326+
fi
327+
else
328+
OPENJ9_BUILD_MODE_ARCH="ppc-64_mxdptrs_le"
311329
fi
312330
elif test "x$OPENJ9_CPU" = x390-64 ; then
313331
OPENJ9_PLATFORM_CODE=xz64
@@ -319,9 +337,12 @@ AC_DEFUN([OPENJ9_PLATFORM_SETUP],
319337
AC_MSG_ERROR([Unsupported OpenJ9 cpu ${OPENJ9_CPU}!])
320338
fi
321339
340+
OPENJ9_BUILDSPEC="${OPENJ9_BUILD_OS}_${OPENJ9_BUILD_MODE_ARCH}"
341+
322342
AC_SUBST(OPENJ9_BUILDSPEC)
323343
AC_SUBST(OPENJ9_PLATFORM_CODE)
324344
AC_SUBST(OPENJ9_LIBS_SUBDIR)
345+
AC_SUBST(OMR_MIXED_REFERENCES_MODE)
325346
])
326347

327348
AC_DEFUN([OPENJ9_CHECK_NASM_VERSION],
@@ -381,7 +402,7 @@ AC_DEFUN([OPENJ9_THIRD_PARTY_REQUIREMENTS],
381402
382403
FREEMARKER_JAR=
383404
if test "x$OPENJ9_ENABLE_CMAKE" != xtrue ; then
384-
if test "x$with_freemarker_jar" == x -o "x$with_freemarker_jar" == xno ; then
405+
if test "x$with_freemarker_jar" = x -o "x$with_freemarker_jar" = xno ; then
385406
printf "\n"
386407
printf "The FreeMarker library is required to build the OpenJ9 build tools\n"
387408
printf "and has to be provided during configure process.\n"

jdk/make/closed/autoconf/custom-spec.gmk.in

+3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ OPENJ9_PLATFORM_CODE := @OPENJ9_PLATFORM_CODE@
8080

8181
OPENJ9_LIBS_SUBDIR := @OPENJ9_LIBS_SUBDIR@
8282

83+
# Mixed References Mode
84+
OMR_MIXED_REFERENCES_MODE := @OMR_MIXED_REFERENCES_MODE@
85+
8386
# Export autoconf cache variables for CC/CXX.
8487
# This is for the case where ccache is enabled.
8588
# It ensures that OMR autoconf uses the compiler, not ccache.

jdk/make/closed/autoconf/generated-configure.sh

+56-27
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,7 @@ CMAKE
905905
USERNAME
906906
JDK_FIX_VERSION
907907
JDK_MOD_VERSION
908+
OMR_MIXED_REFERENCES_MODE
908909
OPENJ9_LIBS_SUBDIR
909910
OPENJ9_PLATFORM_CODE
910911
OPENJ9_BUILDSPEC
@@ -1076,6 +1077,7 @@ with_jvm_variants
10761077
enable_debug
10771078
with_debug_level
10781079
with_noncompressedrefs
1080+
with_mixedrefs
10791081
with_cmake
10801082
with_openj9_cc
10811083
with_openj9_cxx
@@ -1949,6 +1951,8 @@ Optional Packages:
19491951
[release]
19501952
--with-noncompressedrefs
19511953
build non-compressedrefs vm (large heap)
1954+
--with-mixedrefs build mixedrefs vm (--with-mixedrefs=static or
1955+
--with-mixedrefs=dynamic)
19521956
--with-cmake enable building openJ9 with CMake
19531957
--with-openj9-cc build OpenJ9 with a specific C compiler
19541958
--with-openj9-cxx build OpenJ9 with a specific C++ compiler
@@ -4546,7 +4550,7 @@ VS_SDK_PLATFORM_NAME_2017=
45464550

45474551

45484552
# Do not change or remove the following line, it is needed for consistency checks:
4549-
DATE_WHEN_GENERATED=1604507962
4553+
DATE_WHEN_GENERATED=1605236068
45504554

45514555
###############################################################################
45524556
#
@@ -15187,6 +15191,13 @@ fi
1518715191

1518815192

1518915193

15194+
# Check whether --with-mixedrefs was given.
15195+
if test "${with_mixedrefs+set}" = set; then :
15196+
withval=$with_mixedrefs;
15197+
fi
15198+
15199+
15200+
1519015201
# Convert openjdk cpu names to openj9 names
1519115202
case "$build_cpu" in
1519215203
x86_64)
@@ -15209,43 +15220,53 @@ fi
1520915220
;;
1521015221
esac
1521115222

15212-
if test "x$with_noncompressedrefs" != x -o "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
15213-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_${OPENJ9_CPU}"
15223+
15224+
# Default OPENJ9_BUILD_OS=OPENJDK_BUILD_OS, but override with OpenJ9 equivalent as appropriate
15225+
OPENJ9_BUILD_OS="${OPENJDK_BUILD_OS}"
15226+
15227+
OMR_MIXED_REFERENCES_MODE=off
15228+
if test "x$with_mixedrefs" != x -a "x$with_mixedrefs" != xno; then
15229+
if test "x$with_mixedrefs" = xyes -o "x$with_mixedrefs" = xstatic; then
15230+
OMR_MIXED_REFERENCES_MODE=static
15231+
elif test "x$with_mixedrefs" = xdynamic; then
15232+
OMR_MIXED_REFERENCES_MODE=dynamic
15233+
else
15234+
as_fn_error $? "OpenJ9 supports --with-mixedrefs=static and --with-mixedrefs=dynamic" "$LINENO" 5
15235+
fi
15236+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}_mxdptrs"
15237+
OPENJ9_LIBS_SUBDIR=default
15238+
elif test "x$with_noncompressedrefs" = xyes ; then
15239+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}"
1521415240
OPENJ9_LIBS_SUBDIR=default
1521515241
else
15216-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_${OPENJ9_CPU}_cmprssptrs"
15242+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}_cmprssptrs"
1521715243
OPENJ9_LIBS_SUBDIR=compressedrefs
1521815244
fi
1521915245

1522015246
if test "x$OPENJ9_CPU" = xx86-64 ; then
15221-
if test "x$OPENJDK_BUILD_OS" = xlinux ; then
15247+
if test "x$OPENJ9_BUILD_OS" = xlinux ; then
1522215248
OPENJ9_PLATFORM_CODE=xa64
15223-
elif test "x$OPENJDK_BUILD_OS" = xwindows ; then
15249+
elif test "x$OPENJ9_BUILD_OS" = xwindows ; then
1522415250
OPENJ9_PLATFORM_CODE=wa64
15225-
if test "x$OPENJ9_LIBS_SUBDIR" = xdefault ; then
15226-
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
15227-
OPENJ9_PLATFORM_CODE=wi32
15228-
OPENJ9_BUILDSPEC="win_x86"
15229-
else
15230-
OPENJ9_BUILDSPEC="win_x86-64"
15231-
fi
15232-
else
15233-
OPENJ9_BUILDSPEC="win_x86-64_cmprssptrs"
15251+
OPENJ9_BUILD_OS=win
15252+
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 ; then
15253+
OPENJ9_PLATFORM_CODE=wi32
15254+
OPENJ9_BUILD_MODE_ARCH="x86"
1523415255
fi
15235-
elif test "x$OPENJDK_BUILD_OS" = xmacosx ; then
15256+
elif test "x$OPENJ9_BUILD_OS" = xmacosx ; then
1523615257
OPENJ9_PLATFORM_CODE=oa64
15237-
if test "x$OPENJ9_LIBS_SUBDIR" = xdefault ; then
15238-
OPENJ9_BUILDSPEC="osx_x86-64"
15239-
else
15240-
OPENJ9_BUILDSPEC="osx_x86-64_cmprssptrs"
15241-
fi
15258+
OPENJ9_BUILD_OS=osx
1524215259
else
15243-
as_fn_error $? "Unsupported OpenJ9 platform ${OPENJDK_BUILD_OS}!" "$LINENO" 5
15260+
as_fn_error $? "Unsupported OpenJ9 platform ${OPENJ9_BUILD_OS}!" "$LINENO" 5
1524415261
fi
1524515262
elif test "x$OPENJ9_CPU" = xppc-64_le ; then
1524615263
OPENJ9_PLATFORM_CODE=xl64
15247-
if test "x$OPENJ9_LIBS_SUBDIR" != xdefault ; then
15248-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_ppc-64_cmprssptrs_le"
15264+
if test "x$OMR_MIXED_REFERENCES_MODE" = xoff ; then
15265+
if test "x$OPENJ9_LIBS_SUBDIR" != xdefault ; then
15266+
OPENJ9_BUILD_MODE_ARCH="ppc-64_cmprssptrs_le"
15267+
fi
15268+
else
15269+
OPENJ9_BUILD_MODE_ARCH="ppc-64_mxdptrs_le"
1524915270
fi
1525015271
elif test "x$OPENJ9_CPU" = x390-64 ; then
1525115272
OPENJ9_PLATFORM_CODE=xz64
@@ -15257,6 +15278,9 @@ fi
1525715278
as_fn_error $? "Unsupported OpenJ9 cpu ${OPENJ9_CPU}!" "$LINENO" 5
1525815279
fi
1525915280

15281+
OPENJ9_BUILDSPEC="${OPENJ9_BUILD_OS}_${OPENJ9_BUILD_MODE_ARCH}"
15282+
15283+
1526015284

1526115285

1526215286

@@ -15277,7 +15301,7 @@ fi
1527715301
# Check whether --with-cmake was given.
1527815302
if test "${with_cmake+set}" = set; then :
1527915303
withval=$with_cmake;
15280-
if test "x$with_cmake" == xyes -o "x$with_cmake" == x ; then
15304+
if test "x$with_cmake" = xyes -o "x$with_cmake" = x ; then
1528115305
with_cmake=cmake
1528215306
fi
1528315307
if test "x$with_cmake" != xno ; then
@@ -15485,10 +15509,15 @@ else
1548515509
with_cmake=no
1548615510
fi
1548715511

15488-
if test "$with_cmake" == yes ; then
15512+
if test "$with_cmake" = yes ; then
1548915513
OPENJ9_ENABLE_CMAKE=true
1549015514
else
1549115515
OPENJ9_ENABLE_CMAKE=false
15516+
15517+
# Currently, mixedrefs mode is only available with CMake enabled
15518+
if test "x$OMR_MIXED_REFERENCES_MODE" != xoff ; then
15519+
as_fn_error $? "--with-mixedrefs=[static|dynamic] requires --with-cmake" "$LINENO" 5
15520+
fi
1549215521
fi
1549315522

1549415523

@@ -17648,7 +17677,7 @@ fi
1764817677

1764917678
FREEMARKER_JAR=
1765017679
if test "x$OPENJ9_ENABLE_CMAKE" != xtrue ; then
17651-
if test "x$with_freemarker_jar" == x -o "x$with_freemarker_jar" == xno ; then
17680+
if test "x$with_freemarker_jar" = x -o "x$with_freemarker_jar" = xno ; then
1765217681
printf "\n"
1765317682
printf "The FreeMarker library is required to build the OpenJ9 build tools\n"
1765417683
printf "and has to be provided during configure process.\n"

0 commit comments

Comments
 (0)