[jdk8u-dev] RFR: 8199138: Add RISC-V support to Zero
Fei Yang
fyang at openjdk.org
Tue Sep 3 07:33:25 UTC 2024
On Tue, 3 Sep 2024 04:42:37 GMT, Dingli Zhang <dzhang at openjdk.org> wrote:
> Hi all,
>
> I'd like to backport this patch to jdk8u. Since most linux distributions support riscv64 and provide zero version jdk8 for riscv64. However, we may need to do some workarounds each time we upgrade the version, so I think it is helpful to provide zero support for riscv64 here.
>
> `common/autoconf/build-aux/config.guess` and `hotspot/src/os/linux/vm/os_linux.cpp` do not apply cleanly due to context difference, but it is easy to resolve them manually. `common/autoconf/platform.m4` just changed file path and remove test of `x$OPENJDK_$1_CPU`.
>
> `common/autoconf/generated-configure.sh` regenerated by `bash common/autoconf/autogen.sh`. I used autoconf-2.69 and build from the [source](https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz) . But it looks a bit different from the one generated in the repo. I also tried autoconf-2.69 that comes with ubuntu 20.04 and the generated file is similar to the one in https://github.com/openjdk/jdk8u-dev/pull/413. I'm not quite sure which version of autoconf2.69 to use, if anyone has a better suggestion or is willing to help me generate a different one, I'd appreciate it!
>
> Both cross-compile build and native build on riscv64 hardware is tested.
>
> ### cross-compile on x86
> #### boot jdk
>
> openjdk version "1.8.0_43"
> OpenJDK Runtime Environment (build 1.8.0_43-b03)
> OpenJDK 64-Bit Server VM (build 25.40-b25, mixed mode)
>
> #### run on qemu
>
> openjdk version "1.8.0_432-internal"
> OpenJDK Runtime Environment (build 1.8.0_432-internal-zhangdingli_2024_09_02_21_37-b00)
> OpenJDK 64-Bit Zero VM (build 25.432-b00, interpreted mode)
>
> ### native build on lp4a
> #### boot jdk
>
> openjdk version "1.8.0_412"
> OpenJDK Runtime Environment Bisheng (build 1.8.0_412-b08)
> OpenJDK 64-Bit Zero VM Bisheng (build 25.412-b08, interpreted mode)
>
> #### run on lp4a
>
> openjdk version "1.8.0_432-internal"
> OpenJDK Runtime Environment (build 1.8.0_432-internal-openeuler_2024_09_02_21_38-b00)
> OpenJDK 64-Bit Zero VM (build 25.432-b00, interpreted mode)
>
>
> Thanks,
> Dingli
One minor comment.
hotspot/src/os/linux/vm/os_linux.cpp line 1954:
> 1952: #ifndef EM_RISCV
> 1953: #define EM_RISCV 243 /* RISC-V */
> 1954: #endif
It will be more consistent if you put this after definition of `EM_LOONGARCH` like you do for the other places.
-------------
Changes requested by fyang (Committer).
PR Review: https://git.openjdk.org/jdk8u-dev/pull/573#pullrequestreview-2276624022
PR Review Comment: https://git.openjdk.org/jdk8u-dev/pull/573#discussion_r1741567242
More information about the jdk8u-dev
mailing list