RFR: 8307194: Add make target for optionally building a complete set of all JDK and hotspot libjvm static libraries [v12]
Erik Joelsson
erikj at openjdk.org
Wed May 10 20:28:06 UTC 2023
On Wed, 10 May 2023 17:13:13 GMT, Jiangli Zhou <jiangli at openjdk.org> wrote:
>> This PR is branched from the makefile changes for https://bugs.openjdk.org/browse/JDK-8303796 and contains the following for handling the JDK/hotspot static libraries:
>>
>> - Build hotspot libjvm.a and JDK static libraries for static-libs-image/static-libs-bundles targets; This change does not affect the graal-builder-image target
>>
>> - For libjvm.a specifically, exclude operator_new.o
>>
>> - Filter out "external" .o files (those are the .o files included from a different JDK library and needed when creating the .so shared library only) from JDK .a libraries; That's to avoid linker failures caused by duplicate symbols
>> - 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
>>
>> - Handle long arguments case for static build in make/common/NativeCompilation.gmk
>>
>> - Address @erikj79's comment in https://github.com/openjdk/jdk/pull/13709#discussion_r1180750185 for LIBJLI_STATIC_EXCLUDE_OBJS
>
> Jiangli Zhou has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 13 additional commits since the last revision:
>
> - Merge branch 'master' into JDK-8307194
> - Merge branch 'master' into JDK-8307194
> - Address comments from @erikj79:
> - Fix to use $(STATIC_LIBS_GRAAL_IMAGE_DIR) in GraalBuilderImage.gmk.
> - Split the long line at 1281 in Main.gmk.
> - Fix whitspace errors.
> - Reflect on @erikj79 suggestions/input on static-libs-image/graal-builder-image and supporting libjvm.a for different JVM_VARIANTS:
>
> - Remove the new java-static-libs and java-static-libs-bundles targets. Delete the new make/StaticJvmLibsImage.gmk.
>
> - Restore HOTSPOT_VARIANT_STATIC_LIBS_TARGETS and related definitions from previous revision for different $(JVM_VARIANTS).
> - Change the existing static-libs-image target to build libjvm.a in addition to JDK static libraries. The libjvm.a is placed under images/static-libs/lib/<JVM_VARIANTS>. When building multiple JVM variants, each variant contains its own libjvm.a under images/static-libs/lib/<variant> directory.
>
> - Add a new static-libs-graal-image target, which is used by graal-builder-image. Hotspot libjvm.a is not created when building static-libs-graal-image and graal-builder-image targets.
> - Fix whitespace error in make/StaticJvmLibsImage.gmk.
> - - Separate building libjvm.a from static-libs-image target, based on input from @jerboaa and @olpaw:
> - Add a new java-static-libs-image target in Main.gmk for creating the JDK .a static libraries and libjvm.a super set. The static libraries are placed in images/static-libs/lib. The existing static-libs-image target is not affected and will not include hotspot libjvm.a.
> - Add java-static-libs-bundles target in Bundles.gmk. The created .tar.gz bundle contains JDK .a static libraries and hotspot libjvm.a.
> - Add StaticJvmLibsImage.gmk for placing libjvm.a into images/static-libs/lib.
> - Further cleanup after incorporating erikj79's suggestion to only build libjvm.a for $(JVM_VARIANT_MAIN) for now:
> - Change HOTSPOT_VARIANT_STATIC_LIBS_TARGETS to HOTSPOT_VARIANT_MAIN_STATIC_LIBS_TARGETS in Main.gmk.
> - Change hotspot-$v-static-libs to hotspot-$(JVM_VARIANT_MAIN)-static-libs in Main.gmk.
> - Update to create and use only hotspot-$(JVM_VARIANT_MAIN)-static-libs, based on @erikj79 input.
> - Update make/StaticLibsIm...
This change caused all our builds but Linux to fail. Did you verify on other platforms than Linux at all? I see you have GHA turned off.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/13768#issuecomment-1542764704
More information about the build-dev
mailing list