RFR: 8307194: Add make target for optionally building a complete set of all JDK and hotspot libjvm static libraries [v11]
Jiangli Zhou
jiangli at openjdk.org
Wed May 10 16:23:06 UTC 2023
> 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 12 additional commits since the last revision:
- 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/StaticLibsImage.gmk
thanks
Co-authored-by: Erik Joelsson <37597443+erikj79 at users.noreply.github.com>
- Update make/StaticLibsImage.gmk
Thanks
Co-authored-by: Erik Joelsson <37597443+erikj79 at users.noreply.github.com>
- Update based on @erikj79 review comments and suggestions:
- Change to copy libjvm.a for $(JVM_VARIANT_MAIN) only in make/StaticLibsImage.gmk.
- Use $(OBJ_SUFFIX) instead of .o in make/modules/java.base/lib/CoreLibraries.gmk.
- ... and 2 more: https://git.openjdk.org/jdk/compare/84938550...36526d4f
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/13768/files
- new: https://git.openjdk.org/jdk/pull/13768/files/45dd2a00..36526d4f
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=13768&range=10
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=13768&range=09-10
Stats: 44134 lines in 1102 files changed: 31678 ins; 5168 del; 7288 mod
Patch: https://git.openjdk.org/jdk/pull/13768.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/13768/head:pull/13768
PR: https://git.openjdk.org/jdk/pull/13768
More information about the core-libs-dev
mailing list