RFR: 8347755: Support static library in jmod [v2]

Alan Bateman alanb at openjdk.org
Tue Mar 4 10:14:16 UTC 2025


On Tue, 4 Mar 2025 04:20:48 GMT, Henry Jen <henryjen at openjdk.org> wrote:

>> This PR add --static-libs option to the jmod tool, it's basically mirroring --libs option to support adding a new section of static archive into the jmod file under the new section `static-lib`.
>> 
>> The JMOD magic header contains a MAJOR and MINOR version, we bump up the MINOR version if the --static-libs option is specified; otherwise, keep the MINOR version as 1. This allow created JMOD file without the newly supported static-lib section to continue be consumed by earlier version of jmod tool.
>> 
>> Also fix the formatting for _hermetic_jdk_jimage_offset, which is a julong(uint64_t) as unsigned long long on MacOS, thus need to use %llu.
>
> Henry Jen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use JULONG_FORMAT_X to suit various platforms

The updates to the JMOD format and jmod tool looks good, as is bumping the version when the JMOD includes a static-libs section. 

Doesn't have to be this PR but jmod.md will need to be updated if the overall feature is eventually proposed for main line.

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

PR Review: https://git.openjdk.org/leyden/pull/46#pullrequestreview-2656793519


More information about the leyden-dev mailing list