RFR: 8304006: jlink should create the jimage file in the native endian for the target platform [v4]

Jaikiran Pai jpai at openjdk.org
Mon Mar 13 10:32:13 UTC 2023


On Sun, 12 Mar 2023 08:55:19 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   missed ppc64 from the arch mapping
>
> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java line 827:
> 
>> 825:                     if (ref instanceof ModuleReferenceImpl modRefImpl
>> 826:                             && modRefImpl.moduleTarget() != null) {
>> 827:                         targetPlatform = modRefImpl.moduleTarget().targetPlatform();
> 
> It might be better to only look for the ModuleTarget attribute when cross linking. modsPaths.get("java.base") will give you the path to the packaged module for java.base, getDefaultModulePath() will give you the location of the packaged modules in the current execution environment. If getDefaultModulePath() is the parent of the location containing java.base then it can use the current endianness.
> 
> Also just to say that if it would be an error if java.base is not in the Configuration, same thing if there is no packaged module for java.base.

Hello Alan,

>  If getDefaultModulePath() is the parent of the location containing java.base then it can use the current endianness.

I've now updated this PR to implement this suggestion. The `ModuleTarget` attribute in java.base's `module-info.class` will only be checked if the java.base isn't from the current execution environment's default jmods location.

-------------

PR: https://git.openjdk.org/jdk/pull/11943


More information about the core-libs-dev mailing list