riscv64
authorOpenJDK Team <openjdk-17@packages.debian.org>
Wed, 20 Jul 2022 16:04:41 +0000 (17:04 +0100)
committerMatthias Klose <doko@ubuntu.com>
Wed, 20 Jul 2022 16:04:41 +0000 (17:04 +0100)
# HG changeset patch
# User enevill
# Date 1521985117 -3600
#      Sun Mar 25 14:38:37 2018 +0100
# Node ID 7d1ae835ef5194e7ae5b56b51f944029fe602d11
# Parent  1b1de4b263c81853719f6bb0385fe23bc4e35f6c
8199138: Add RISC-V support to Zero
Reviewed-by: aph, erikj, ehelin, ihse
Gbp-Pq: Name riscv64.diff

make/autoconf/build-aux/config.guess
make/autoconf/build-aux/config.sub
src/hotspot/os/linux/os_linux.cpp

index d589529f35aad914aac30789012a5beb3b47a8bb..ebd69dd53e6702db38b646c019faf059cfd239b4 100644 (file)
 # autoconf system (which might easily get lost in a future update), we wrap it
 # and fix the broken property, if needed.
 
+machine=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+if test $machine = riscv64; then
+  # This is all we need to know for riscv64
+  echo riscv64-unknown-linux-gnu
+  exit
+fi
+
 DIR=`dirname $0`
 OUT=`. $DIR/autoconf-config.guess`
 
index 8f5a5cf524492514992565fb1679d5c06c937aa3..99de9f08c957885b38aca99ced058539eb206766 100644 (file)
@@ -46,8 +46,8 @@ if echo $* | grep pc-msys >/dev/null ; then
     exit
 fi
 
-# Filter out everything that doesn't begin with "aarch64-"
-if ! echo $* | grep '^aarch64-' >/dev/null ; then
+# First, filter out everything that doesn't begin with "aarch64-" or "riscv64-"
+if ! echo $* | grep '^aarch64-\|^riscv64-' >/dev/null ; then
     . $DIR/autoconf-config.sub "$@"
     # autoconf-config.sub exits, so we never reach here, but just in
     # case we do:
@@ -62,6 +62,10 @@ while test $# -gt 0 ; do
             config=`echo $1 | sed 's/^aarch64-/arm-/'`
             sub_args="$sub_args $config"
             shift; ;;
+        riscv64-* )
+            config=`echo $1 | sed 's/^riscv64-/x86-/'`
+            sub_args="$sub_args $config"
+            shift; ;;
         - )    # Use stdin as input.
             sub_args="$sub_args $1"
             shift; break ;;
@@ -74,7 +78,7 @@ done
 result=`. $DIR/autoconf-config.sub $sub_args "$@"`
 exitcode=$?
 
-result=`echo $result | sed "s/^arm-/aarch64-/"`
+result=`echo $result | sed "s/^arm-/aarch64-/" | sed "s/^x86-/riscv64-/"`
 
 echo $result
 exit $exitcode
index 815fa3ffd00f43b080124a9d60676260f895611f..79e5bc73886ccc44504f664f30717e586b461eb3 100644 (file)
@@ -2563,6 +2563,8 @@ void os::get_summary_cpu_info(char* cpuinfo, size_t length) {
   strncpy(cpuinfo, "IA64", length);
 #elif defined(PPC)
   strncpy(cpuinfo, "PPC64", length);
+#elif defined(RISCV)
+  strncpy(cpuinfo, "RISCV", length);
 #elif defined(S390)
   strncpy(cpuinfo, "S390", length);
 #elif defined(SPARC)