Skip to content

Commit

Permalink
Update configure scripts for RISC-V (closed)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Cheng Jin committed Oct 9, 2019
1 parent 642d340 commit 3fe8b1c
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 2 deletions.
5 changes: 4 additions & 1 deletion closed/OpenJ9.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ $(call openj9_add_jdk_shlibs, java.base, \
j9gc29 \
j9gcchk29 \
j9hookable29 \
j9jit29 \
j9jnichk29 \
j9jvmti29 \
j9prt29 \
Expand All @@ -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, \
Expand Down
10 changes: 9 additions & 1 deletion closed/autoconf/custom-hook.m4
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,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
;;
Expand Down Expand Up @@ -240,6 +240,9 @@ AC_DEFUN([OPENJ9_PLATFORM_EXTRACT_VARS_FROM_CPU],
aarch64)
OPENJ9_CPU=aarch64
;;
riscv64)
OPENJ9_CPU=riscv64
;;
*)
AC_MSG_ERROR([unsupported OpenJ9 cpu $1])
;;
Expand Down Expand Up @@ -304,6 +307,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
Expand Down
6 changes: 6 additions & 0 deletions closed/autoconf/custom-spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ 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 := @SYSROOT_CFLAGS@
endif
endif
39 changes: 39 additions & 0 deletions closed/make/lib/Awt2dLibraries-pre.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ===========================================================================
# (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved
# ===========================================================================
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# IBM designates this particular file as subject to the "Classpath" exception
# as provided by IBM in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, see <http://www.gnu.org/licenses/>.
#
# ===========================================================================

################################################################################
# Enable the headless mode to avoid compiling X11 related headers
# in generating the native awt library during the cross-compilation
# as these headers are not offered in the cross-toolchain.

ifeq ($(OPENJDK_TARGET_CPU)_$(COMPILE_TYPE), riscv64_cross)
LIBAWT_CFLAGS += -DHEADLESS=true -DRISCV64_CROSS=true

LIBAWT_HEADLESS_EXFILES += \
CUPSfuncs.c \
fontpath.c \
#

LIBAWT_HEADLESS_EXCLUDES += \
$(TOPDIR)/src/java.desktop/unix/native/common/java2d \
#
endif
30 changes: 30 additions & 0 deletions closed/make/lib/Lib-java.desktop-post.gmk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# ===========================================================================
# (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved
# ===========================================================================
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# IBM designates this particular file as subject to the "Classpath" exception
# as provided by IBM in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, see <http://www.gnu.org/licenses/>.
#
# ===========================================================================

################################################################################
# Enable the headless mode to avoid compiling X11 related headers
# in generating the native awt library during the cross-compilation
# as these headers are not offered in the cross-toolchain.

ifeq ($(OPENJDK_TARGET_CPU)_$(COMPILE_TYPE), riscv64_cross)
TARGETS := $(filter-out $(BUILD_LIBFREETYPE) $(BUILD_LIBFONTMANAGER) $(BUILD_LIBJSOUND), $(TARGETS))
endif

0 comments on commit 3fe8b1c

Please sign in to comment.