Skip to content

Commit a26b9f0

Browse files
authored
Merge pull request #359 from sharon-wang/mixedbuild
Add new configure option --with-mixedrefs for mixed pointer mode
2 parents 965af0b + 33c02cd commit a26b9f0

File tree

4 files changed

+54
-26
lines changed

4 files changed

+54
-26
lines changed

closed/OpenJ9.gmk

+1
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ ifeq (true,$(OPENJ9_ENABLE_CMAKE))
330330
-DJ9VM_OMR_DIR="$(OPENJ9OMR_TOPDIR)" \
331331
-DJAVA_SPEC_VERSION=$(VERSION_FEATURE) \
332332
-DOMR_DDR=$(OPENJ9_ENABLE_DDR) \
333+
-DOMR_MIXED_REFERENCES_MODE=$(OMR_MIXED_REFERENCES_MODE) \
333334
-DOPENJ9_BUILD=true \
334335
-DOPENJ9_SHA=$(OPENJ9_SHA) \
335336
-DOPENJDK_VERSION_NUMBER_FOUR_POSITIONS=$(VERSION_NUMBER_FOUR_POSITIONS) \

closed/autoconf/custom-hook.m4

+48-26
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ AC_DEFUN([OPENJ9_CONFIGURE_CMAKE],
5454
[
5555
AC_ARG_WITH(cmake, [AS_HELP_STRING([--with-cmake], [enable building openJ9 with CMake])],
5656
[
57-
if test "x$with_cmake" == xyes -o "x$with_cmake" == x ; then
57+
if test "x$with_cmake" = xyes -o "x$with_cmake" = x ; then
5858
with_cmake=cmake
5959
fi
6060
],
@@ -75,6 +75,11 @@ AC_DEFUN([OPENJ9_CONFIGURE_CMAKE],
7575
# at this point with_cmake should either be no, or the name of the cmake command
7676
if test "x$with_cmake" = xno ; then
7777
OPENJ9_ENABLE_CMAKE=false
78+
79+
# Currently, mixedrefs mode is only available with CMake enabled
80+
if test "x$OMR_MIXED_REFERENCES_MODE" != xoff ; then
81+
AC_MSG_ERROR([[--with-mixedrefs=[static|dynamic] requires --with-cmake]])
82+
fi
7883
else
7984
OPENJ9_ENABLE_CMAKE=true
8085
if AS_EXECUTABLE_P(["$with_cmake"]) ; then
@@ -342,70 +347,87 @@ AC_DEFUN([OPENJ9_PLATFORM_SETUP],
342347
AC_ARG_WITH(noncompressedrefs, [AS_HELP_STRING([--with-noncompressedrefs],
343348
[build non-compressedrefs vm (large heap)])])
344349
350+
AC_ARG_WITH(mixedrefs, [AS_HELP_STRING([--with-mixedrefs],
351+
[build mixedrefs vm (--with-mixedrefs=static or --with-mixedrefs=dynamic)])])
352+
345353
# When compiling natively host_cpu and build_cpu are the same. But when
346354
# cross compiling we need to work with the host_cpu (which is where the final
347355
# JVM will run).
348356
OPENJ9_PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu)
349357
350-
if test "x$with_noncompressedrefs" = x ; then
351-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_${OPENJ9_CPU}_cmprssptrs"
352-
OPENJ9_LIBS_SUBDIR=compressedrefs
353-
else
354-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_${OPENJ9_CPU}"
358+
# Default OPENJ9_BUILD_OS=OPENJDK_BUILD_OS, but override with OpenJ9 equivalent as appropriate
359+
OPENJ9_BUILD_OS="${OPENJDK_BUILD_OS}"
360+
361+
OMR_MIXED_REFERENCES_MODE=off
362+
if test "x$with_mixedrefs" != x -a "x$with_mixedrefs" != xno; then
363+
if test "x$with_mixedrefs" = xyes -o "x$with_mixedrefs" = xstatic; then
364+
OMR_MIXED_REFERENCES_MODE=static
365+
elif test "x$with_mixedrefs" = xdynamic; then
366+
OMR_MIXED_REFERENCES_MODE=dynamic
367+
else
368+
AC_MSG_ERROR([OpenJ9 supports --with-mixedrefs=static and --with-mixedrefs=dynamic])
369+
fi
370+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}_mxdptrs"
371+
OPENJ9_LIBS_SUBDIR=default
372+
elif test "x$with_noncompressedrefs" = xyes ; then
373+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}"
355374
OPENJ9_LIBS_SUBDIR=default
375+
else
376+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_CPU}_cmprssptrs"
377+
OPENJ9_LIBS_SUBDIR=compressedrefs
356378
fi
357379
358380
if test "x$OPENJ9_CPU" = xx86-64 ; then
359-
if test "x$OPENJDK_BUILD_OS" = xlinux ; then
381+
if test "x$OPENJ9_BUILD_OS" = xlinux ; then
360382
OPENJ9_PLATFORM_CODE=xa64
361-
elif test "x$OPENJDK_BUILD_OS" = xwindows ; then
383+
elif test "x$OPENJ9_BUILD_OS" = xwindows ; then
362384
OPENJ9_PLATFORM_CODE=wa64
363-
if test "x$OPENJ9_LIBS_SUBDIR" = xdefault ; then
364-
OPENJ9_BUILDSPEC=win_x86-64
365-
else
366-
OPENJ9_BUILDSPEC=win_x86-64_cmprssptrs
367-
fi
368-
elif test "x$OPENJDK_BUILD_OS" = xmacosx ; then
385+
OPENJ9_BUILD_OS=win
386+
elif test "x$OPENJ9_BUILD_OS" = xmacosx ; then
369387
OPENJ9_PLATFORM_CODE=oa64
370-
if test "x$OPENJ9_LIBS_SUBDIR" = xdefault ; then
371-
OPENJ9_BUILDSPEC=osx_x86-64
372-
else
373-
OPENJ9_BUILDSPEC=osx_x86-64_cmprssptrs
374-
fi
388+
OPENJ9_BUILD_OS=osx
375389
else
376-
AC_MSG_ERROR([Unsupported OpenJ9 platform ${OPENJDK_BUILD_OS}!])
390+
AC_MSG_ERROR([Unsupported OpenJ9 platform ${OPENJ9_BUILD_OS}!])
377391
fi
378392
elif test "x$OPENJ9_CPU" = xppc-64_le ; then
379393
OPENJ9_PLATFORM_CODE=xl64
380-
if test "x$OPENJ9_LIBS_SUBDIR" != xdefault ; then
381-
OPENJ9_BUILDSPEC="${OPENJDK_BUILD_OS}_ppc-64_cmprssptrs_le"
394+
if test "x$OMR_MIXED_REFERENCES_MODE" = xoff ; then
395+
if test "x$OPENJ9_LIBS_SUBDIR" != xdefault ; then
396+
OPENJ9_BUILD_MODE_ARCH="ppc-64_cmprssptrs_le"
397+
fi
398+
else
399+
OPENJ9_BUILD_MODE_ARCH="ppc-64_mxdptrs_le"
382400
fi
383401
elif test "x$OPENJ9_CPU" = x390-64 ; then
384402
OPENJ9_PLATFORM_CODE=xz64
385403
elif test "x$OPENJ9_CPU" = xppc-64 ; then
386404
OPENJ9_PLATFORM_CODE=ap64
387405
elif test "x$OPENJ9_CPU" = xarm ; then
388406
OPENJ9_PLATFORM_CODE=xr32
389-
OPENJ9_BUILDSPEC=linux_arm_linaro
407+
OPENJ9_BUILD_OS=linux
408+
OPENJ9_BUILD_MODE_ARCH=arm_linaro
390409
OPENJ9_LIBS_SUBDIR=default
391410
elif test "x$OPENJ9_CPU" = xaarch64 ; then
392411
OPENJ9_PLATFORM_CODE=xr64
393412
if test "x$COMPILE_TYPE" = xcross ; then
394-
OPENJ9_BUILDSPEC="${OPENJ9_BUILDSPEC}_cross"
413+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_BUILD_MODE_ARCH}_cross"
395414
fi
396415
elif test "x$OPENJ9_CPU" = xriscv64 ; then
397416
OPENJ9_PLATFORM_CODE=rv64
398417
if test "x$COMPILE_TYPE" = xcross ; then
399-
OPENJ9_BUILDSPEC="${OPENJ9_BUILDSPEC}_cross"
418+
OPENJ9_BUILD_MODE_ARCH="${OPENJ9_BUILD_MODE_ARCH}_cross"
400419
fi
401420
else
402421
AC_MSG_ERROR([Unsupported OpenJ9 cpu ${OPENJ9_CPU}!])
403422
fi
404423
424+
OPENJ9_BUILDSPEC="${OPENJ9_BUILD_OS}_${OPENJ9_BUILD_MODE_ARCH}"
425+
405426
AC_SUBST(OPENJ9_BUILDSPEC)
406427
AC_SUBST(OPENJ9_PLATFORM_CODE)
407428
AC_SUBST(COMPILER_VERSION_STRING)
408429
AC_SUBST(OPENJ9_LIBS_SUBDIR)
430+
AC_SUBST(OMR_MIXED_REFERENCES_MODE)
409431
])
410432

411433
AC_DEFUN([OPENJ9_CHECK_NASM_VERSION],
@@ -452,7 +474,7 @@ AC_DEFUN([OPENJ9_THIRD_PARTY_REQUIREMENTS],
452474
FREEMARKER_JAR=
453475
if test "x$OPENJ9_ENABLE_CMAKE" != xtrue ; then
454476
AC_MSG_CHECKING([that freemarker location is set])
455-
if test "x$with_freemarker_jar" == x -o "x$with_freemarker_jar" == xno ; then
477+
if test "x$with_freemarker_jar" = x -o "x$with_freemarker_jar" = xno ; then
456478
AC_MSG_RESULT([no])
457479
printf "\n"
458480
printf "The FreeMarker library is required to build the OpenJ9 build tools\n"

closed/autoconf/custom-spec.gmk.in

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ OPENJ9_PLATFORM_CODE := @OPENJ9_PLATFORM_CODE@
8585

8686
OPENJ9_LIBS_SUBDIR := @OPENJ9_LIBS_SUBDIR@
8787

88+
# Mixed References Mode
89+
OMR_MIXED_REFERENCES_MODE := @OMR_MIXED_REFERENCES_MODE@
90+
8891
# Export autoconf cache variables for CC/CXX.
8992
# This is for the case where ccache is enabled.
9093
# It ensures that OMR autoconf uses the compiler, not ccache.

closed/custom/copy/Copy-java.base.gmk

+2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ $(call openj9_copy_shlibs, \
6363
$(if $(filter zos,$(OPENJDK_TARGET_OS)),j9a2e) \
6464
j9dmp29 \
6565
j9gc29 \
66+
$(if $(filter static,$(OMR_MIXED_REFERENCES_MODE)),j9gc_full29) \
6667
j9gcchk29 \
68+
$(if $(filter static,$(OMR_MIXED_REFERENCES_MODE)),j9gcchk_full29) \
6769
j9hookable29 \
6870
$(if $(filter zos,$(OPENJDK_TARGET_OS)),j9ifa29) \
6971
$(if $(filter $(NO_JIT_CPUS),$(OPENJDK_TARGET_CPU)),,j9jit29) \

0 commit comments

Comments
 (0)