From 28d4eb194a354a936eeb9c4fdd3cadf6e9c7be66 Mon Sep 17 00:00:00 2001 From: Cheng Jin Date: Wed, 9 Oct 2019 16:58:48 -0400 Subject: [PATCH] Update configure scripts for RISC-V (closed) The changes are to modify the scripts intended for OpenJ9 to enable RISC-V from the configuration perspective. Issue: ibmruntimes#218 Signed-off-by: Cheng Jin --- closed/OpenJ9.gmk | 5 ++++- closed/autoconf/custom-hook.m4 | 26 +++++++++++++++++++++++++- closed/autoconf/custom-spec.gmk.in | 8 ++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/closed/OpenJ9.gmk b/closed/OpenJ9.gmk index 48fea7d1494..965eb3a2589 100644 --- a/closed/OpenJ9.gmk +++ b/closed/OpenJ9.gmk @@ -196,7 +196,6 @@ $(call openj9_add_jdk_shlibs, java.base, \ j9gc29 \ j9gcchk29 \ j9hookable29 \ - j9jit29 \ j9jnichk29 \ j9jvmti29 \ j9prt29 \ @@ -211,6 +210,10 @@ $(call openj9_add_jdk_shlibs, java.base, \ omrsig \ ) +ifneq (riscv64, $(OPENJDK_TARGET_CPU)) + $(call openj9_add_jdk_shlibs, java.base, j9jit29) +endif + ifeq (windows,$(OPENJDK_TARGET_OS)) $(call openj9_add_jdk_lib, java.base, lib/$(call STATIC_LIBRARY,jsig)) $(eval $(call openj9_add_jdk_rules, \ diff --git a/closed/autoconf/custom-hook.m4 b/closed/autoconf/custom-hook.m4 index a5dffe9d8ce..85ff27b4e82 100644 --- a/closed/autoconf/custom-hook.m4 +++ b/closed/autoconf/custom-hook.m4 @@ -226,7 +226,7 @@ AC_DEFUN([OPENJ9_CONFIGURE_DDR], OPENJ9_ENABLE_DDR=false elif test "x$enable_ddr" = x ; then case "$OPENJ9_PLATFORM_CODE" in - ap64|oa64|wa64|xa64|xl64|xz64) + ap64|oa64|rv64|wa64|xa64|xl64|xz64) AC_MSG_RESULT([yes (default for $OPENJ9_PLATFORM_CODE)]) OPENJ9_ENABLE_DDR=true ;; @@ -264,6 +264,9 @@ AC_DEFUN([OPENJ9_PLATFORM_EXTRACT_VARS_FROM_CPU], aarch64) OPENJ9_CPU=aarch64 ;; + riscv64) + OPENJ9_CPU=riscv64 + ;; *) AC_MSG_ERROR([unsupported OpenJ9 cpu $1]) ;; @@ -328,6 +331,11 @@ AC_DEFUN_ONCE([OPENJ9_PLATFORM_SETUP], if test "x$COMPILE_TYPE" = xcross ; then OPENJ9_BUILDSPEC="${OPENJ9_BUILDSPEC}_cross" fi + elif test "x$OPENJ9_CPU" = xriscv64 ; then + OPENJ9_PLATFORM_CODE=rv64 + if test "x$COMPILE_TYPE" = xcross ; then + OPENJ9_BUILDSPEC="${OPENJ9_BUILDSPEC}_cross" + fi else AC_MSG_ERROR([Unsupported OpenJ9 cpu ${OPENJ9_CPU}!]) fi @@ -551,6 +559,22 @@ AC_DEFUN([CONFIGURE_OPENSSL], OPENSSL_BUNDLE_LIB_PATH="${OPENSSL_DIR}/lib" fi fi + elif test -s "$OPENSSL_DIR/lib64/${LIBRARY_PREFIX}crypto${SHARED_LIBRARY_SUFFIX}" ; then + OPENSSL_CFLAGS="-I${OPENSSL_DIR}/include" + if test "x$BUNDLE_OPENSSL" = xyes ; then + # On Mac OSX, create local copy of the crypto library to update @rpath + # as the default is /usr/local/lib. + if test "x$OPENJDK_BUILD_OS" = xmacosx ; then + LOCAL_CRYPTO="$TOPDIR/openssl" + $MKDIR -p "${LOCAL_CRYPTO}" + $CP "${OPENSSL_DIR}/lib64/libcrypto.1.1.dylib" "${LOCAL_CRYPTO}" + $CP "${OPENSSL_DIR}/lib64/libcrypto.1.0.0.dylib" "${LOCAL_CRYPTO}" + $CP -a "${OPENSSL_DIR}/lib64/libcrypto.dylib" "${LOCAL_CRYPTO}" + OPENSSL_BUNDLE_LIB_PATH="${LOCAL_CRYPTO}" + else + OPENSSL_BUNDLE_LIB_PATH="${OPENSSL_DIR}/lib64" + fi + fi elif test -s "$OPENSSL_DIR/${LIBRARY_PREFIX}crypto${SHARED_LIBRARY_SUFFIX}" ; then OPENSSL_CFLAGS="-I${OPENSSL_DIR}/include" if test "x$BUNDLE_OPENSSL" = xyes ; then diff --git a/closed/autoconf/custom-spec.gmk.in b/closed/autoconf/custom-spec.gmk.in index 69ce006a0bc..73f90de9d16 100644 --- a/closed/autoconf/custom-spec.gmk.in +++ b/closed/autoconf/custom-spec.gmk.in @@ -121,3 +121,11 @@ ifeq (true,$(OPENJ9_ENABLE_CMAKE)) else OPENJ9_VM_BUILD_DIR := $(OUTPUTDIR)/vm endif + +ifeq (riscv64,$(OPENJDK_TARGET_CPU)) + ifeq (cross,$(COMPILE_TYPE)) + export SYSROOT_CFLAGS + else + JAVA_FLAGS += -DserverStartupTimeout=36000 + endif +endif