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

Magnus Ihse Bursie ihse at openjdk.org
Tue Oct 15 19:34:14 UTC 2024


On Tue, 15 Oct 2024 18:59:32 GMT, Jiangli Zhou <jiangli at openjdk.org> wrote:

>> After thinking a bit more on this, I concluded that we cannot automatically extract a proper set of ld flags from what's being passed to the individual libraries. The LDFLAGS needed by the monolithic static library needs to be explicitly defined. Unfortunately, most of it will be a copy of what is already duplicated across JVM_LDFLAGS, LDFLAGS_JDKLIB and LDFLAGS_JDKEXE. :-( But cleaning that mess upp requires a separate PR.
>
>> After thinking a bit more on this, I concluded that we cannot automatically extract a proper set of ld flags from what's being passed to the individual libraries. The LDFLAGS needed by the monolithic static library needs to be explicitly defined. Unfortunately, most of it will be a copy of what is already duplicated across JVM_LDFLAGS, LDFLAGS_JDKLIB and LDFLAGS_JDKEXE. :-( But cleaning that mess upp requires a separate PR.
> 
> @magicus, just to make it clear, do you plan to explicitly define the set of LDFLAGS for static linking as part of this PR? We need to make sure the JVM_LDFLAGS is properly included initially.

Yes, I just pushed a commit that does that. I have manually inspected the values and it looks sane, but I need to verify it on our CI system as well. The reasoning for us setting some of the ld flags are less than clear, so it is a bit hard to tell if they should be included or not.

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

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


More information about the build-dev mailing list