Open axiangyushanhaijing opened 9 months ago
3、
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index a89cb30f373..96e6a442bda 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -13918,6 +13918,12 @@ test -n "$target_alias" &&
VAR_CPU_BITS=64
VAR_CPU_ENDIAN=big
;;
+ riscv64|riscv64)
+ VAR_CPU=riscv64
+ VAR_CPU_ARCH=riscv64
+ VAR_CPU_BITS=64
+ VAR_CPU_ENDIAN=little
+ ;;
*)
as_fn_error $? "unsupported cpu $build_cpu" "$LINENO" 5
;;
@@ -14056,6 +14062,12 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; }
VAR_CPU_BITS=64
VAR_CPU_ENDIAN=big
;;
+ riscv64|riscv64)
+ VAR_CPU=riscv64
+ VAR_CPU_ARCH=riscv64
+ VAR_CPU_BITS=64
+ VAR_CPU_ENDIAN=little
+ ;;
*)
as_fn_error $? "unsupported cpu $host_cpu" "$LINENO" 5
;;
diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4
index 51df988f619..9290bbf5abe 100644
--- a/common/autoconf/platform.m4
+++ b/common/autoconf/platform.m4
@@ -96,6 +96,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
VAR_CPU_BITS=64
VAR_CPU_ENDIAN=big
;;
+ riscv64)
+ VAR_CPU=riscv64
+ VAR_CPU_ARCH=riscv64
+ VAR_CPU_BITS=64
+ VAR_CPU_ENDIAN=little
+ ;;
*)
AC_MSG_ERROR([unsupported cpu $1])
;;
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
index ba1bce4239a..4fd8c423679 100644
--- a/hotspot/src/os/linux/vm/os_linux.cpp
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
@@ -1949,6 +1949,9 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
#ifndef EM_AARCH64
#define EM_AARCH64 183 /* ARM AARCH64 */
#endif
+ #ifndef EM_RISCV
+ #define EM_RISCV 243 /* RISC-V */
+ #endif
static const arch_t arch_array[]={
{EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"},
@@ -1972,6 +1975,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
{EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"},
{EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"},
{EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"},
+ {EM_RISCV, EM_RISCV, ELFCLASSNONE, ELFDATA2MSB, (char*)"RISCV"},
};
#if (defined IA32)
@@ -2004,9 +2008,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen)
static Elf32_Half running_arch_code=EM_68K;
#elif (defined AARCH64)
static Elf32_Half running_arch_code=EM_AARCH64;
+ #elif (defined RISCV64)
+ static Elf32_Half running_arch_code=EM_RISCV;
#else
#error Method os::dll_load requires that one of following is defined:\
- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64
+ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, RISCV64
#endif
// Identify compatability class for VM's architecture and library's architecture
4、构建命令:
CC=/home/zhangxiang/riscv64/bin/riscv64-unknown-linux-gnu-gcc \
CXX=/home/zhangxiang/riscv64/bin/riscv64-unknown-linux-gnu-g++ \
bash configure \
--with-sysroot=/home/zhangxiang/riscv64/sysroot \
--openjdk-target=riscv64-unknown-linux-gnu \
--with-boot-jdk=/home/zhangxiang/zx_temp/jdk8u392-b08 \
--with-jvm-variants=zero \
--with-jvm-interpreter=cpp \
--with-native-debug-symbols=internal \
--x-includes=/home/zhangxiang/riscv64/sysroot/usr/include/X11/extension \
--x-libraries=/home/zhangxiang/riscv64/sysroot/usr/lib \
--with-cups=/home/zhangxiang/riscv64/sysroot/usr/include/cups \
--with-freetype-include=/home/zhangxiang/riscv64/sysroot/usr/include/freetype2 \
--with-freetype-lib=/home/zhangxiang/riscv64/sysroot/usr/lib \
--with-extra-cflags="-Wno-error"
1、更新master 到 9c9d6b267c41e4c713cacc41befb66007cdb2601 2、新建本地zero分支