On Wed, 15 Sep 2021 06:28:25 GMT, Remilia Scarlet
<[email protected]> wrote:
> Currently, the Platform.is64Bit() hard coded for judging whether the target
> arch is 64-bit.
> The `classes_nocoops.jsa not found` issue can be found while testing
> CDSPluginTest.java on 64-bit platform, excluding x64 and AARCH64, like mips64.
>
> For solving this issue, we assume that the bits of target UNKNOWN arch is
> same as the runtime platform.
> This patch adds the following lines in the Platform.is64Bit() method.
>
> ``` java
> if (arch() == Platform.Architecture.UNKNOWN) {
> return (System.getProperty("os.arch").indexOf("64") != -1);
> }
>
>
> Please review this change. Thanks!
The test assumes that it always runs on 64-bit platform and
`classes_nocoops.jsa` is always created. It's a test bug. The test should
only expect `classes_nocoops.jsa` exists if it's running on a supported 64-bit
platform.
Platform::is64Bit can do better for runtime platform (i.e. `Platform::runtime`)
that can determine if it's 64-bit from the `sun.arch.data.model` system
property. However, for unknown target platform, it's unknown if it's 64-bit
or not. So I think fixing the test to check if `classes_nocoops.jsa` exists
only on one of the JDK supported platforms (x64 or aarch64) is a better way to
resolve your issue.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5519