8199138: Add RISC-V support to Zero#573
Conversation
|
👋 Welcome back dzhang! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This backport pull request has now been updated with issue from the original commit. |
Webrevs
|
|
Thanks to Gui Cao for the original patch. |
|
@DingliZhang |
|
/approval request allow Zero build on RISC-V |
|
@DingliZhang |
There was a problem hiding this comment.
Thanks for the update. I am not sure about the autoconf issue here. You need to ask for the maintainer's comments/suggestions (@gnu-andrew once mentioned the possibility of backporting https://bugs.openjdk.org/browse/JDK-8195689 on #413) to remove the generated configure at the start of the next release cycle). The rest of the change looks good to me (Not a 8u Reviewer).
|
@DingliZhang This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
Keep this open. I'll review after the upcoming release on the 15th. |
Yes, the in-tree auto-generated |
Thanks for the reply, I'm looking forward to it. |
|
@DingliZhang This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
bot, please keep it open |
|
@DingliZhang This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
bot, please keep it open |
|
@DingliZhang This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
bot, please keep it open |
|
@DingliZhang This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
bot, please keep it open |
|
@DingliZhang This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
bot, please keep it open |
|
@DingliZhang This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
|
bot, please keep it open |
|
@DingliZhang This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
|
bot, please keep it open |
|
@DingliZhang This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
|
@DingliZhang This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
|
@gnu-andrew @DingliZhang this PR one seems to have been forgotten I have done some testing of it. Cross-build:
Native build:
For reference, here is rebased branch with 2 additional changes, I ended up with: https://github.com/zzambers/jdk8u-dev/tree/riscv-rebase |
|
Configure error seems like: JDK-8285630, so separate issue. |
Thanks for testing this. should be sufficient here, since the updated config.guess recognizes that triplet correctly. |
|
/open |
|
/template append |
|
@DingliZhang This pull request is now open |
|
@DingliZhang this pull request can not be integrated into git checkout backport-8199138
git fetch https://git.openjdk.org/jdk8u-dev.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push |
|
@DingliZhang The pull request template has been appended to the pull request body |
I have tried this (with unmodified Otherwise configure picked un-prefixed variants of these tools and subsequent build failed. (Debian uses It then passed cross-build without |
gnu-andrew
left a comment
There was a problem hiding this comment.
Sorry for taking so long to get back to this and thanks @zzambers for the testing. I'm happy for this to go in once merged, assuming it still looks much the same. I've seen similar differences in the generated-configure.sh output and it's another reason to finally get rid of it. I'll look at doing that next week in time, hopefully in time to get it into 8u502.
gnu-andrew
left a comment
There was a problem hiding this comment.
To stay close to 11u, I would move the EM_RISCV lines above the EM_LOONGARCH ones. RISC-V was added before LoongArch in 11u which is why you are seeing a different context in 8u.
i.e. this is 11u:
#ifndef EM_AARCH64
#define EM_AARCH64 183 /* ARM AARCH64 */
#endif
#ifndef EM_RISCV
#define EM_RISCV 243 /* RISC-V */
#endif
#ifndef EM_LOONGARCH
#define EM_LOONGARCH 258 /* LoongArch */
#endif
and
{EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"},
{EM_RISCV, EM_RISCV, ELFCLASS64, ELFDATA2LSB, (char*)"RISC-V"},
{EM_LOONGARCH, EM_LOONGARCH, ELFCLASS64, ELFDATA2LSB, (char*)"LoongArch"},
We should keep the order the same in 8u to help with any future patches.
Other than that, I think this is ready to go in.
|
Hi @gnu-andrew Thanks for the review! |
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.guessandhotspot/src/os/linux/vm/os_linux.cppdo not apply cleanly due to context difference, but it is easy to resolve them manually.common/autoconf/platform.m4just changed file path and remove test ofx$OPENJDK_$1_CPU.common/autoconf/generated-configure.shregenerated bybash common/autoconf/autogen.sh. I used autoconf-2.69 and build from the source . 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 #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
run on qemu
native build on lp4a
boot jdk
run on lp4a
Thanks,
Dingli
Progress
Issue
Reviewers
Contributors
<gcao@openjdk.org>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/573/head:pull/573$ git checkout pull/573Update a local copy of the PR:
$ git checkout pull/573$ git pull https://git.openjdk.org/jdk8u-dev.git pull/573/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 573View PR using the GUI difftool:
$ git pr show -t 573Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/573.diff
Using Webrev
Link to Webrev Comment