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

Magnus Ihse Bursie ihse at openjdk.org
Fri Mar 14 18:35:30 UTC 2025


On Fri, 14 Mar 2025 04:42:49 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:
> 
>   Add hotspot static libs to java.base-static-jmod

However, regarding manifests, there *is* one thing that really should be included with the static libs, and that is a `pkg-config` file, that tells the end users what linker flags to use to be able to properly use the static libraries. 

I have been planning to add this to the static-jdk-image but never gotten around to it. (Can't find the JBS number now either.) But I guess that there is no real conflict between that and this PR; if I just plop the file down alongside the .a files, it will be automatically picked up by jmod.

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

PR Comment: https://git.openjdk.org/leyden/pull/46#issuecomment-2725408153


More information about the leyden-dev mailing list