Skip to content

Commit 62bd407

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 62bd407

File tree

6 files changed

+112
-80
lines changed

6 files changed

+112
-80
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

+2-14
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,6 @@ infodir
10141014
docdir
10151015
oldincludedir
10161016
includedir
1017-
runstatedir
10181017
localstatedir
10191018
sharedstatedir
10201019
sysconfdir
@@ -1258,7 +1257,6 @@ datadir='${datarootdir}'
12581257
sysconfdir='${prefix}/etc'
12591258
sharedstatedir='${prefix}/com'
12601259
localstatedir='${prefix}/var'
1261-
runstatedir='${localstatedir}/run'
12621260
includedir='${prefix}/include'
12631261
oldincludedir='/usr/include'
12641262
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1511,15 +1509,6 @@ do
15111509
| -silent | --silent | --silen | --sile | --sil)
15121510
silent=yes ;;
15131511

1514-
-runstatedir | --runstatedir | --runstatedi | --runstated \
1515-
| --runstate | --runstat | --runsta | --runst | --runs \
1516-
| --run | --ru | --r)
1517-
ac_prev=runstatedir ;;
1518-
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1519-
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1520-
| --run=* | --ru=* | --r=*)
1521-
runstatedir=$ac_optarg ;;
1522-
15231512
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
15241513
ac_prev=sbindir ;;
15251514
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1657,7 +1646,7 @@ fi
16571646
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
16581647
datadir sysconfdir sharedstatedir localstatedir includedir \
16591648
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1660-
libdir localedir mandir runstatedir
1649+
libdir localedir mandir
16611650
do
16621651
eval ac_val=\$$ac_var
16631652
# Remove trailing slashes.
@@ -1810,7 +1799,6 @@ Fine tuning of the installation directories:
18101799
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
18111800
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
18121801
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1813-
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
18141802
--libdir=DIR object code libraries [EPREFIX/lib]
18151803
--includedir=DIR C header files [PREFIX/include]
18161804
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -4410,7 +4398,7 @@ VS_SDK_PLATFORM_NAME_2017=
44104398
#CUSTOM_AUTOCONF_INCLUDE
44114399

44124400
# Do not change or remove the following line, it is needed for consistency checks:
4413-
DATE_WHEN_GENERATED=1604507962
4401+
DATE_WHEN_GENERATED=1605224843
44144402

44154403
###############################################################################
44164404
#

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.

0 commit comments

Comments
 (0)