RFR: 8307194: Enhance static-libs-image

Jiangli Zhou jiangli at openjdk.org
Wed May 3 18:15:13 UTC 2023


On Wed, 3 May 2023 16:57:04 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

> @jianglizhou How does the produced image look like after this patch? I.e. what's the contents of `build/*/images/static-libs`?

With the changes in this patch, `build/*/images/static-libs` will contain the `libjvm.a` in addition to the JDK `.a` static libraries.

For the following JDK static libraries (`.a`), the duplicate `.o` files are excluded to avoid linking failures when the the JDK static libraries are linked with:

- For `libjli.a`: Not include `inflate.o inftrees.o inffast.o zadler32.o zcrc32.o zutil.o` (compiled from `zlib` sources) if `zlib` is built as JDK bundled. When `zlib` is built as bundled, the extra source files from it are compiled and the produced object files are linked into `libjli`. That's intended for the shared library, `libjli.so`, but that's problematic for `libjli.a`. It's not an issue when `zlib` is not bundled, as the extra sources are not included for `libjli` in that case.
- For `libawt_xawt.a` and `libawt_head.a`: Not include `systemScale.o`, since it's provided in `libawt.a`.

I'll add these details in the PR description as well.

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

PR Comment: https://git.openjdk.org/jdk/pull/13768#issuecomment-1533494769



More information about the build-dev mailing list