RFR: 8347755: Support static library in jmod [v6]
Henry Jen
henryjen at openjdk.org
Fri Mar 14 18:35:31 UTC 2025
On Fri, 14 Mar 2025 18:00:26 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> make/CreateJmods.gmk line 104:
>>
>>> 102: endif
>>> 103:
>>> 104: # Copy hotspot libs, currently only libjvm.a
>>
>> I just realized that we also need the launcher's `main.o` in the static `java.base.jmod`. Creating a `liblauncher.a` with the `main.o` and including the `liblauncher.a` in `java.base.jmod` seems to be cleaner than including `main.o` directly in the jmod.
>>
>> When jlinking the final image for the application, if user doesn't provide customized launcher, `liblauncher.a` is used with other needed JDK/VM static libraries for linking the executable using the native linker (e.g. `ld`). If customized launcher is used, the object file(s) or the static library for the customized launcher is then used when linking the executable. `liblauncher.a` is not used in that case.
>
> Should we really, though? That includes a `main` function. If the user wants to use the static libs from the jmod to create their own application, that will cause a symbol conflict.
I think that worth a discussion, IIRC, the most needed processing should be in libjli already.
-------------
PR Review Comment: https://git.openjdk.org/leyden/pull/46#discussion_r1996036735
More information about the leyden-dev
mailing list