diff -r 9cbb97715f53 make/autoconf/build-aux/autoconf-config.guess --- a/make/autoconf/build-aux/autoconf-config.guess Tue Mar 06 10:31:14 2018 +0000 +++ b/make/autoconf/build-aux/autoconf-config.guess Tue Mar 06 16:50:13 2018 +0000 @@ -1000,6 +1000,9 @@ ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; + riscv64:Linux:*:*) + echo riscv64-unknown-linux-gnu + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; diff -r 9cbb97715f53 make/autoconf/build-aux/autoconf-config.sub --- a/make/autoconf/build-aux/autoconf-config.sub Tue Mar 06 10:31:14 2018 +0000 +++ b/make/autoconf/build-aux/autoconf-config.sub Tue Mar 06 16:50:13 2018 +0000 @@ -302,6 +302,7 @@ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ + | riscv64 \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ @@ -383,6 +384,7 @@ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ + | riscv64-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ diff -r 9cbb97715f53 make/autoconf/platform.m4 --- a/make/autoconf/platform.m4 Tue Mar 06 10:31:14 2018 +0000 +++ b/make/autoconf/platform.m4 Tue Mar 06 16:50:13 2018 +0000 @@ -108,6 +108,12 @@ VAR_CPU_BITS=64 VAR_CPU_ENDIAN=little ;; + riscv64) + VAR_CPU=riscv64 + VAR_CPU_ARCH=riscv64 + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=little + ;; s390) VAR_CPU=s390 VAR_CPU_ARCH=s390 @@ -460,6 +466,8 @@ HOTSPOT_$1_CPU_DEFINE=SPARC elif test "x$OPENJDK_$1_CPU" = xppc; then HOTSPOT_$1_CPU_DEFINE=PPC32 + elif test "x$OPENJDK_$1_CPU" = xriscv64; then + HOTSPOT_$1_CPU_DEFINE=RISCV64 elif test "x$OPENJDK_$1_CPU" = xs390; then HOTSPOT_$1_CPU_DEFINE=S390 elif test "x$OPENJDK_$1_CPU" = xs390x; then diff -r 9cbb97715f53 src/hotspot/os/linux/os_linux.cpp --- a/src/hotspot/os/linux/os_linux.cpp Tue Mar 06 10:31:14 2018 +0000 +++ b/src/hotspot/os/linux/os_linux.cpp Tue Mar 06 16:50:13 2018 +0000 @@ -1761,8 +1761,11 @@ {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, ELFCLASS64, ELFDATA2LSB, (char*)"RISCV"}, }; +#define riscv + #if (defined IA32) static Elf32_Half running_arch_code=EM_386; #elif (defined AMD64) @@ -1777,6 +1780,8 @@ static Elf32_Half running_arch_code=EM_PPC64; #elif (defined __powerpc__) static Elf32_Half running_arch_code=EM_PPC; +#elif (defined riscv) + static Elf32_Half running_arch_code=EM_RISCV; #elif (defined AARCH64) static Elf32_Half running_arch_code=EM_AARCH64; #elif (defined ARM) @@ -2321,6 +2326,8 @@ 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)