Skip to content

Commit 1cf8538

Browse files
author
Cheng Jin
committed
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 <[email protected]>
1 parent 642d340 commit 1cf8538

File tree

5 files changed

+88
-2
lines changed

5 files changed

+88
-2
lines changed

closed/OpenJ9.gmk

+4-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ $(call openj9_add_jdk_shlibs, java.base, \
196196
j9gc29 \
197197
j9gcchk29 \
198198
j9hookable29 \
199-
j9jit29 \
200199
j9jnichk29 \
201200
j9jvmti29 \
202201
j9prt29 \
@@ -211,6 +210,10 @@ $(call openj9_add_jdk_shlibs, java.base, \
211210
omrsig \
212211
)
213212

213+
ifneq (riscv64, $(OPENJDK_TARGET_CPU))
214+
$(call openj9_add_jdk_shlibs, java.base, j9jit29)
215+
endif
216+
214217
ifeq (windows,$(OPENJDK_TARGET_OS))
215218
$(call openj9_add_jdk_lib, java.base, lib/$(call STATIC_LIBRARY,jsig))
216219
$(eval $(call openj9_add_jdk_rules, \

closed/autoconf/custom-hook.m4

+9-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ AC_DEFUN([OPENJ9_CONFIGURE_DDR],
202202
OPENJ9_ENABLE_DDR=false
203203
elif test "x$enable_ddr" = x ; then
204204
case "$OPENJ9_PLATFORM_CODE" in
205-
ap64|oa64|wa64|xa64|xl64|xz64)
205+
ap64|oa64|rv64|wa64|xa64|xl64|xz64)
206206
AC_MSG_RESULT([yes (default for $OPENJ9_PLATFORM_CODE)])
207207
OPENJ9_ENABLE_DDR=true
208208
;;
@@ -240,6 +240,9 @@ AC_DEFUN([OPENJ9_PLATFORM_EXTRACT_VARS_FROM_CPU],
240240
aarch64)
241241
OPENJ9_CPU=aarch64
242242
;;
243+
riscv64)
244+
OPENJ9_CPU=riscv64
245+
;;
243246
*)
244247
AC_MSG_ERROR([unsupported OpenJ9 cpu $1])
245248
;;
@@ -304,6 +307,11 @@ AC_DEFUN_ONCE([OPENJ9_PLATFORM_SETUP],
304307
if test "x$COMPILE_TYPE" = xcross ; then
305308
OPENJ9_BUILDSPEC="${OPENJ9_BUILDSPEC}_cross"
306309
fi
310+
elif test "x$OPENJ9_CPU" = xriscv64 ; then
311+
OPENJ9_PLATFORM_CODE=rv64
312+
if test "x$COMPILE_TYPE" = xcross ; then
313+
OPENJ9_BUILDSPEC="${OPENJ9_BUILDSPEC}_cross"
314+
fi
307315
else
308316
AC_MSG_ERROR([Unsupported OpenJ9 cpu ${OPENJ9_CPU}!])
309317
fi

closed/autoconf/custom-spec.gmk.in

+6
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,9 @@ ifeq (true,$(OPENJ9_ENABLE_CMAKE))
121121
else
122122
OPENJ9_VM_BUILD_DIR := $(OUTPUTDIR)/vm
123123
endif
124+
125+
ifeq (riscv64,$(OPENJDK_TARGET_CPU))
126+
ifeq (cross,$(COMPILE_TYPE))
127+
export SYSROOT_CFLAGS := @SYSROOT_CFLAGS@
128+
endif
129+
endif
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# ===========================================================================
2+
# (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved
3+
# ===========================================================================
4+
#
5+
# This code is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 2 only, as
7+
# published by the Free Software Foundation.
8+
#
9+
# IBM designates this particular file as subject to the "Classpath" exception
10+
# as provided by IBM in the LICENSE file that accompanied this code.
11+
#
12+
# This code is distributed in the hope that it will be useful, but WITHOUT
13+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15+
# version 2 for more details (a copy is included in the LICENSE file that
16+
# accompanied this code).
17+
#
18+
# You should have received a copy of the GNU General Public License version
19+
# 2 along with this work; if not, see <http://www.gnu.org/licenses/>.
20+
#
21+
# ===========================================================================
22+
23+
################################################################################
24+
# Enable the headless mode to avoid compiling X11 related headers
25+
# in generating the native awt library during the cross-compilation
26+
# as these headers are not offered in the cross-toolchain.
27+
28+
ifeq ($(OPENJDK_TARGET_CPU)_$(COMPILE_TYPE), riscv64_cross)
29+
LIBAWT_CFLAGS += -DHEADLESS=true -DRISCV64_CROSS=true
30+
31+
LIBAWT_HEADLESS_EXFILES += \
32+
CUPSfuncs.c \
33+
fontpath.c \
34+
#
35+
36+
LIBAWT_HEADLESS_EXCLUDES += \
37+
$(TOPDIR)/src/java.desktop/unix/native/common/java2d \
38+
#
39+
endif
+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# ===========================================================================
2+
# (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved
3+
# ===========================================================================
4+
#
5+
# This code is free software; you can redistribute it and/or modify it
6+
# under the terms of the GNU General Public License version 2 only, as
7+
# published by the Free Software Foundation.
8+
#
9+
# IBM designates this particular file as subject to the "Classpath" exception
10+
# as provided by IBM in the LICENSE file that accompanied this code.
11+
#
12+
# This code is distributed in the hope that it will be useful, but WITHOUT
13+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14+
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15+
# version 2 for more details (a copy is included in the LICENSE file that
16+
# accompanied this code).
17+
#
18+
# You should have received a copy of the GNU General Public License version
19+
# 2 along with this work; if not, see <http://www.gnu.org/licenses/>.
20+
#
21+
# ===========================================================================
22+
23+
################################################################################
24+
# Enable the headless mode to avoid compiling X11 related headers
25+
# in generating the native awt library during the cross-compilation
26+
# as these headers are not offered in the cross-toolchain.
27+
28+
ifeq ($(OPENJDK_TARGET_CPU)_$(COMPILE_TYPE), riscv64_cross)
29+
TARGETS := $(filter-out $(BUILD_LIBFREETYPE) $(BUILD_LIBFONTMANAGER) $(BUILD_LIBJSOUND), $(TARGETS))
30+
endif

0 commit comments

Comments
 (0)