RFR: 8307194: Enhance static-libs-image [v5]

Alan Bateman alanb at openjdk.org
Fri May 5 14:04:23 UTC 2023


On Thu, 4 May 2023 19:32:45 GMT, Jiangli Zhou <jiangli at openjdk.org> wrote:

>>> [...] I'll see if I can test this on a mandrel build tomorrow...
>> 
>> @jianglizhou So I've tested this with a mandrel build and it doesn't break terribly, but a graalvm build after this patch has *two* `libjvm.a` which a) doesn't make sense, b) the hotspot version is **very** large (> 1 GB on my system), so unnecessarily bloats the install. I remain of the opinion that the hotspot `libjvm.a` should only get generated for a new make target (not change the old `static-libs-image` target). Do you think that would be a workable solution for you?
>
>> As @jerboaa mentioned, for GraalVM native-image we produce our own `libjvm.a` as part of building GraalVM (every native image gets statically linked to that library). See https://github.com/oracle/graal/blob/f1c1d710625ac84559a6ef69c4068c9d8c2c9f8b/substratevm/mx.substratevm/mx_substratevm.py#L1378 and `com.oracle.svm.native.jvm.{posix,windows}` in https://github.com/oracle/graal/blob/f1c1d710625ac84559a6ef69c4068c9d8c2c9f8b/substratevm/mx.substratevm/suite.py#L736.
>> 
>> Having a hot-spot variant of `libjvm.a` next to the other static libraries might complicate things for us. Ideally the output files produced by target `static-libs-image` should remain the same.
> 
> @olpaw Thanks for the input. Could you also please take a look of the changes that excludes the object files from the following static libraries from Graal native image usage perspective?
> 
> - 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. 
> - For libawt_xawt.a and libawt_head.a: Not include systemScale.o, since it's provided in libawt.a.

At first glance, static-libs-image create libjvm.a in the same directory as the other lib .a files make sense but I don't know how that works if --with-jvm-variants is used to create more more than one libjvm. Might have to think whether this combination make sense or not.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13768#discussion_r1186134127


More information about the core-libs-dev mailing list