RFR: 8339480: Build static-jdk image with a statically linked launcher [v7]

Johan Vos jvos at openjdk.org
Fri Oct 18 18:26:44 UTC 2024


On Tue, 15 Oct 2024 20:22:52 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

>> As a prerequisite for Hermetic Java, we need a statically linked `java` launcher. It should behave like the normal, dynamically linked `java` launcher, except that all JDK native libraries should be statically, not dynamically, linked.
>> 
>> This patch is the first step towards this goal. It will generate a `static-jdk` image with a statically linked launcher. This launcher is missing several native libs, however, and does therefore not behave like a proper dynamic java. One of the reasons for this is that local symbol hiding in static libraries are not implemented yet, which causes symbol clashes when linking all static libraries together. This will be addressed in an upcoming patch. 
>> 
>> All changes in the `src` directory are copied from, or inspired by, changes made in [the hermetic-java-runtime branch in Project Leyden](https://github.com/openjdk/leyden/tree/hermetic-java-runtime).
>
> Magnus Ihse Bursie has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Don't hardcode server variant

src/java.base/unix/native/libjli/java_md.c line 279:

> 277:                            char jvmpath[], jint so_jvmpath,
> 278:                            char jvmcfg[],  jint so_jvmcfg) {
> 279:     /* Compute/set the name of the executable. This is needed for macOS. */

But this file is not used when on macOS, is it? (cfr java_md_macosx.m) )

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20837#discussion_r1806868617


More information about the build-dev mailing list