# 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`
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:
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 ;;
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
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)