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

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


On Sat, 11 Mar 2023 11:38:43 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:

>> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   undo unintentional copyright year change
>
> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java line 916:
> 
>> 914:             }
>> 915:             String archName = targetPlatform.substring(index + 1);
>> 916:             return switch (archName) {
> 
> Not that keen having this table buried in code. It's something that should be at the build level, maybe read from a resource?

Hello Jim, yes it feels odd to be listing it in the code here. Adding it as a runtime resource (like a properties file?) too seems a bit odd to me. Perhaps this should be written out during build to some templated Java file which can then be used in this code? Something like a `SupportedPlatforms.java.template` file under the `jdk.tools.jlink.internal` package which has a:
``` java
ByteOrder getByteOrder(String platform)

method which gets generated during  the build?

Either way, I think there would then need to be a build file of officially supported platforms which can be sourced into that template file. I'm not too familiar with the porting process, is there such a precendence for it? Do porters update such files to add to the list as a supported platform?

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

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


More information about the core-libs-dev mailing list