From fb2bca07ddc497b6d38f92cd9e5e712a0f2ffef7 Mon Sep 17 00:00:00 2001 From: Nathan Henderson Date: Thu, 31 Oct 2024 13:38:46 -0400 Subject: [PATCH] Add configure support to enable RAM class persistence Related: https://github.ibm.com/runtimes/openj9/issues/755 Related: https://github.com/eclipse-openj9/openj9/pull/20387 Signed-off-by: Nathan Henderson --- closed/OpenJ9.gmk | 13 +++++++++++++ closed/autoconf/custom-hook.m4 | 20 ++++++++++++++++++++ closed/autoconf/custom-spec.gmk.in | 1 + 3 files changed, 34 insertions(+) diff --git a/closed/OpenJ9.gmk b/closed/OpenJ9.gmk index 22a5b982e0..4687395ede 100644 --- a/closed/OpenJ9.gmk +++ b/closed/OpenJ9.gmk @@ -305,6 +305,13 @@ else # OPENJ9_ENABLE_OPENJDK_METHODHANDLES FEATURE_SED_SCRIPT += $(call SedDisable,opt_openjdkMethodhandle) endif # OPENJ9_ENABLE_OPENJDK_METHODHANDLES +# Adjust snapshots enablement flags. +ifeq (true,$(OPENJ9_ENABLE_SNAPSHOTS)) + FEATURE_SED_SCRIPT += $(call SedEnable,opt_snapshots) +else # OPENJ9_ENABLE_SNAPSHOTS + FEATURE_SED_SCRIPT += $(call SedDisable,opt_snapshots) +endif # OPENJ9_ENABLE_SNAPSHOTS + # Disable windows rebase. SPEC_SED_SCRIPT += $(call SedDisable,uma_windowsRebase) @@ -477,6 +484,12 @@ ifeq (true,$(OPENJ9_ENABLE_CMAKE)) CMAKE_ARGS += -DJ9VM_OPT_OPENJDK_METHODHANDLE=OFF endif # OPENJ9_ENABLE_OPENJDK_METHODHANDLES + ifeq (true,$(OPENJ9_ENABLE_SNAPSHOTS)) + CMAKE_ARGS += -DJ9VM_OPT_SNAPSHOTS=ON + else # OPENJ9_ENABLE_SNAPSHOTS + CMAKE_ARGS += -DJ9VM_OPT_SNAPSHOTS=OFF + endif # OPENJ9_ENABLE_SNAPSHOTS + # Propagate configure option '--disable-warnings-as-errors-omr' to OMR. ifeq (false,$(WARNINGS_AS_ERRORS_OMR)) CMAKE_ARGS += -DOMR_WARNINGS_AS_ERRORS=OFF diff --git a/closed/autoconf/custom-hook.m4 b/closed/autoconf/custom-hook.m4 index deb337a38b..d01cb1d6e2 100644 --- a/closed/autoconf/custom-hook.m4 +++ b/closed/autoconf/custom-hook.m4 @@ -49,6 +49,7 @@ AC_DEFUN_ONCE([CUSTOM_EARLY_HOOK], OPENJ9_CONFIGURE_JITSERVER OPENJ9_CONFIGURE_NUMA OPENJ9_CONFIGURE_OPENJDK_METHODHANDLES + OPENJ9_CONFIGURE_SNAPSHOTS OPENJ9_CONFIGURE_WARNINGS OPENJ9_THIRD_PARTY_REQUIREMENTS OPENJ9_CHECK_NASM_VERSION @@ -521,6 +522,25 @@ AC_DEFUN([OPENJ9_CONFIGURE_OPENJDK_METHODHANDLES], AC_SUBST(OPENJ9_ENABLE_OPENJDK_METHODHANDLES) ]) +AC_DEFUN([OPENJ9_CONFIGURE_SNAPSHOTS], +[ + AC_MSG_CHECKING([for snapshot support]) + AC_ARG_ENABLE([snapshots], [AS_HELP_STRING([--enable-snapshots], + [enable RAM persistence snapshots @<:@disabled@:>@])]) + OPENJ9_ENABLE_SNAPSHOTS=false + if test "x$enable_snapshots" = xyes ; then + AC_MSG_RESULT([yes (explicitly enabled)]) + OPENJ9_ENABLE_SNAPSHOTS=true + elif test "x$enable_snapshots" = xno ; then + AC_MSG_RESULT([no (explicitly disabled)]) + elif test "x$enable_snapshots" = x ; then + AC_MSG_RESULT([no (default)]) + else + AC_MSG_ERROR([--enable-snapshots accepts no argument]) + fi + AC_SUBST(OPENJ9_ENABLE_SNAPSHOTS) +]) + AC_DEFUN([OPENJ9_PLATFORM_SETUP], [ AC_ARG_WITH(noncompressedrefs, [AS_HELP_STRING([--with-noncompressedrefs], diff --git a/closed/autoconf/custom-spec.gmk.in b/closed/autoconf/custom-spec.gmk.in index 2ea6623745..fd4bd3bb47 100644 --- a/closed/autoconf/custom-spec.gmk.in +++ b/closed/autoconf/custom-spec.gmk.in @@ -62,6 +62,7 @@ OPENJ9_ENABLE_DEMOS := @OPENJ9_ENABLE_DEMOS@ OPENJ9_ENABLE_JFR := @OPENJ9_ENABLE_JFR@ OPENJ9_ENABLE_JITSERVER := @OPENJ9_ENABLE_JITSERVER@ OPENJ9_ENABLE_OPENJDK_METHODHANDLES := @OPENJ9_ENABLE_OPENJDK_METHODHANDLES@ +OPENJ9_ENABLE_SNAPSHOTS := @OPENJ9_ENABLE_SNAPSHOTS@ # for constructing version output COMPILER_VERSION_STRING := @COMPILER_VERSION_STRING@