Question about supporting aot on other platforms (RISC-V)
Vladimir Kozlov
vladimir.kozlov at oracle.com
Fri Jul 18 00:06:22 UTC 2025
Thank you, Hamlin, for adding AOT support for new platform.
On 7/10/25 4:21 AM, Hamlin Li wrote:
> Hi,
>
> I'm trying to apply changes related to aot on riscv (first step is
> https://github.com/openjdk/jdk/pull/26101 <https://github.com/openjdk/
> jdk/pull/26101>, also plan to apply further changes in the future
> gradually).
This is good.
Please, make sure runtime/cds/appcds/aotCode and other aot* tests passed.
>
> As Andrew suggested in the pr, there will be more changes (especially
> related to code save/restore) from leyden premain to mainline.
> I went through the pr's and discussion of leyden, found out several
> changes might be platform related:
> 1. Store cpu features in AOTCodeCache header (https://github.com/
> openjdk/leyden/pull/84 <https://github.com/openjdk/leyden/pull/84> ) (Open)
> 2. AOT code generation should support UseCompactObjectHeaders (https://
> github.com/openjdk/leyden/pull/78 <https://github.com/openjdk/leyden/
> pull/78> ) (committed into premain)
These we may not push into mainline for sometime. Currently stubs
caching is disabled in mainline because of this
https://bugs.openjdk.org/browse/JDK-8357593
Adapters caching is not affected by the issue so they are still used in
mainline. But they gave minor improvement.
I agree with Andrew that you can apply your changes to leyden/premain
and run runtime/cds/appcds/aot to see what further changes you need to
do to support AOT code caching. For example, you need to make sure you
have declared relocations for runtime calls in code and also relocation
for card table base address if you embed it into code.
>
> I think in the short future, these above pr's are going to get into
> mainline. But I might overlook some pr's or discussions,
> Besides of these above pr's, are there any other potential changes or
> discussions I should pay attention to when I try to support aot on riscv?
> I asked the questions to make sure after I integratehttps://github.com/
> openjdk/jdk/pull/26101 <https://github.com/openjdk/jdk/pull/26101>, even
> if more leyden changes are merged (including the above ones) into
> mainline, I can still make aot work as expected on riscv quickly, rather
> than break aot things for a long time, i.e. hope no surprise in the
> progress.
For that you should start testing/working with leyden/premain branch
which is most up to date sources for AOT code.
Regards,
Vladimir K
>
> Thank you
> -Hamlin
More information about the leyden-dev
mailing list