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

Jaikiran Pai jpai at openjdk.org
Thu Mar 23 01:53:34 UTC 2023


On Tue, 21 Mar 2023 19:02:21 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Alan's suggestions - don't parse arch out of osname-arch for determining endianness and reduce the number of supported/known target platforms for cross linking
>
> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java line 856:
> 
>> 854:                         // unsupported target platform
>> 855:                         throw new IOException(
>> 856:                                 taskHelper.getMessage("err.unsupported.target.platform",
> 
> IIUC, the current jlink implementation does not fail if the target platform is unknown as long as `--endian` option is specified.   So I think `--endian` may be useful to keep (rather than taking it out).   This error key should be `err.unknown.target.endianness` and the message can suggest to use `--endian` option to specify.

I've updated the key to match what you suggest here.

> src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties line 151:
> 
>> 149: err.signing=signed modular JAR {0} is currently not supported,\
>> 150: \ use --ignore-signing-information to suppress error
>> 151: err.cannot.determine.target.platform=cannot determine target platform for image generation
> 
> Suggestion:
> 
> err.cannot.determine.target.platform=cannot determine target platform from {0}
> 
> 
> `{0}` can be the path to `java.base.jmod`  (i.e. `ModuleReference::location`)

Done. Additionally, if the `ModuleReference::location` is unknown (it's an `Optional`) then we will print `cannot determine target platform from java.base module`

> src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties line 152:
> 
>> 150: \ use --ignore-signing-information to suppress error
>> 151: err.cannot.determine.target.platform=cannot determine target platform for image generation
>> 152: err.unsupported.target.platform=image generation for target platform {0} is not supported
> 
> Suggestion:
> 
> err.unsupported.target.endianness=Unknown native byte order for target platform {0}`
> 
> 
> `{0}` is `targetPlatformVal`

Done

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

PR Review Comment: https://git.openjdk.org/jdk/pull/11943#discussion_r1145583060
PR Review Comment: https://git.openjdk.org/jdk/pull/11943#discussion_r1145583531
PR Review Comment: https://git.openjdk.org/jdk/pull/11943#discussion_r1145583598


More information about the core-libs-dev mailing list