Re: RFR: 8307194: Enhance static-libs-image [v6]

2023-05-05 Thread Jiangli Zhou
ikj79's comment in > https://github.com/openjdk/jdk/pull/13709#discussion_r1180750185 for > LIBJLI_STATIC_EXCLUDE_OBJS; Jiangli Zhou has updated the pull request incrementally with one additional commit since the last revision: - Separate building libjvm.a from static-libs-image target, based on input fro

Re: RFR: 8307194: Enhance static-libs-image [v6]

2023-05-05 Thread Jiangli Zhou
ikj79's comment in > https://github.com/openjdk/jdk/pull/13709#discussion_r1180750185 for > LIBJLI_STATIC_EXCLUDE_OBJS; Jiangli Zhou has updated the pull request incrementally with one additional commit since the last revision: - Separate building libjvm.a from static-libs-image target, based on input fro

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

2023-05-04 Thread Jiangli Zhou
On Thu, 4 May 2023 19:12:14 GMT, Severin Gehwolf wrote: >> 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/f1c1d710625ac84559

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

2023-05-04 Thread Jiangli Zhou
On Thu, 4 May 2023 19:12:14 GMT, Severin Gehwolf wrote: >> 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/f1c1d710625ac84559

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

2023-05-03 Thread Jiangli Zhou
On Wed, 3 May 2023 18:51:54 GMT, Severin Gehwolf wrote: >>> Could we decouple `hotspot-static-libs` from `static-libs-image` somehow, >>> please? `static-libs-image` is used by the `graal-builder-image` target and >>> it would be good if it didn't include hotspot static libs as they are not >>

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

2023-05-03 Thread Jiangli Zhou
ikj79's comment in > https://github.com/openjdk/jdk/pull/13709#discussion_r1180750185 for > LIBJLI_STATIC_EXCLUDE_OBJS; Jiangli Zhou has updated the pull request incrementally with one additional commit since the last revision: Update to create and use only hotspot-$(JVM_VARIANT_MAIN)-static-libs, bas

Re: RFR: 8307194: Enhance static-libs-image [v2]

2023-05-03 Thread Jiangli Zhou
On Wed, 3 May 2023 18:31:56 GMT, Erik Joelsson wrote: >> Jiangli Zhou has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update based on @erikj79 review comments and suggestions: >> - Change to copy libjvm.

Re: RFR: 8307194: Enhance static-libs-image [v4]

2023-05-03 Thread Jiangli Zhou
ikj79's comment in > https://github.com/openjdk/jdk/pull/13709#discussion_r1180750185 for > LIBJLI_STATIC_EXCLUDE_OBJS; Jiangli Zhou has updated the pull request incrementally with one additional commit since the last revision: Update make/StaticLibsImage.gmk thanks Co-authored-by: Erik Joelsson

Re: RFR: 8307194: Enhance static-libs-image [v3]

2023-05-03 Thread Jiangli Zhou
ikj79's comment in > https://github.com/openjdk/jdk/pull/13709#discussion_r1180750185 for > LIBJLI_STATIC_EXCLUDE_OBJS; Jiangli Zhou has updated the pull request incrementally with one additional commit since the last revision: Update make/StaticLibsImage.gmk Thanks Co-authored-by: Erik Joelsson

Re: RFR: 8307194: Enhance static-libs-image [v2]

2023-05-03 Thread Jiangli Zhou
On Wed, 3 May 2023 18:33:56 GMT, Erik Joelsson wrote: >> make/Main.gmk line 1060: >> >>> 1058: symbols-image: $(LIBS_TARGETS) $(LAUNCHER_TARGETS) >>> 1059: >>> 1060: static-libs-image: hotspot-static-libs $(STATIC_LIBS_TARGETS) >> >> Could we decouple `hotspot-static-libs` from `static-lib

Re: RFR: 8307194: Enhance static-libs-image

2023-05-03 Thread Jiangli Zhou
On Wed, 3 May 2023 16:57:04 GMT, Severin Gehwolf 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

Re: RFR: 8307194: Enhance static-libs-image [v2]

2023-05-03 Thread Jiangli Zhou
On Wed, 3 May 2023 13:42:03 GMT, Erik Joelsson wrote: >> Jiangli Zhou has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update based on @erikj79 review comments and suggestions: >> - Change to copy libjvm.

Re: RFR: 8307194: Enhance static-libs-image [v2]

2023-05-03 Thread Jiangli Zhou
ikj79's comment in > https://github.com/openjdk/jdk/pull/13709#discussion_r1180750185 for > LIBJLI_STATIC_EXCLUDE_OBJS; Jiangli Zhou has updated the pull request incrementally with one additional commit since the last revision: Update based on @erikj79 review comments and suggestions: - Change to copy li

Re: RFR: 8303796: Optionally build fully statically linked JDK image [v2]

2023-05-02 Thread Jiangli Zhou
On Fri, 28 Apr 2023 19:34:40 GMT, Erik Joelsson wrote: >> Jiangli Zhou has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Use $(JVM_LIBS), which includes -lrt on Linux currently. > > make/modules/java.deskt

Re: RFR: 8303796: Optionally build fully statically linked JDK image [v2]

2023-05-02 Thread Jiangli Zhou
On Fri, 28 Apr 2023 19:32:40 GMT, Erik Joelsson wrote: > This is the same list as the LIBJLI_EXTRA_FILES above. Would be good to avoid > the duplication. @erikj79 Addressed in the extracted https://github.com/openjdk/jdk/pull/13768, which contains .a related changes only (without linking 'java

RFR: 8307194: Enhance static-libs-image

2023-05-02 Thread Jiangli Zhou
This PR is branched from the makefile changes for https://bugs.openjdk.org/browse/JDK-8303796 and contains the following for handling the JDK/VM static libraries: - Create libjvm.a together with other JDK static libraries when building 'static-libs-image' (or 'static-libs-bundles') target, incl

Re: RFR: 8303796: Optionally build fully statically linked JDK image [v2]

2023-05-01 Thread Jiangli Zhou
On Sat, 29 Apr 2023 03:57:53 GMT, Jiangli Zhou wrote: >> Initial implementation for supporting building a fully statically linked >> (with a desired set of JDK native libraries and libjvm) Java launcher >> executable, which is named as 'javastatic'. >> >&g

Re: RFR: 8303796: Optionally build fully statically linked JDK image

2023-05-01 Thread Jiangli Zhou
On Mon, 1 May 2023 14:03:10 GMT, Erik Joelsson wrote: > > Based on the above finding, I pushed a change to use $(JVM_LIBS) for the > > linking command. @erikj79 could you please see if that resolves the clock_* > > symbol issues in your environment? > > Yes, it built cleanly with that change.

Re: RFR: 8303796: Optionally build fully statically linked JDK image

2023-05-01 Thread Jiangli Zhou
On Sun, 30 Apr 2023 18:34:12 GMT, Alan Bateman wrote: > > The build is already capable of producing .a files and this patch is > > building on top of that build feature. The current .a file creation is used > > by the downstream graal build which needs it for nativeimage. > > Also builds on re

Re: RFR: 8303796: Optionally build fully statically linked JDK image

2023-04-28 Thread Jiangli Zhou
On Sat, 29 Apr 2023 01:44:07 GMT, Jiangli Zhou wrote: > > > Erik, could you please share your > > > `support/native/java.base/java/BUILD_LAUNCHER_javastatic_static_link.cmdline`? > > > This generated .cmdline file contains the static linking command. Here > >

Re: RFR: 8303796: Optionally build fully statically linked JDK image [v2]

2023-04-28 Thread Jiangli Zhou
lib/CoreLibraries.gmk and > make/modules/java.desktop/lib/Awt2dLibraries.gmk. > > - In make/common/NativeCompilation.gmk, move the code handling long arguments > so that it can be used for the static build support as well. > > - In make/hotspot/lib/CompileJvm.gmk, it specifies

Re: RFR: 8303796: Optionally build fully statically linked JDK image

2023-04-28 Thread Jiangli Zhou
On Fri, 28 Apr 2023 23:25:17 GMT, Erik Joelsson wrote: > > Erik, could you please share your > > `support/native/java.base/java/BUILD_LAUNCHER_javastatic_static_link.cmdline`? > > This generated .cmdline file contains the static linking command. Here is > > the linking command from my build: >

Re: RFR: 8303796: Optionally build fully statically linked JDK image

2023-04-28 Thread Jiangli Zhou
On Fri, 28 Apr 2023 18:28:51 GMT, Phil Race wrote: > Umm. Does this mean you are linking both headless and xawt into the same > image ? For the xawt case, we statically link with libawt.a and libawt_xawt.a in our early prototype. For headless case, we statically link with libawt.a and libawt_

Re: RFR: 8303796: Optionally build fully statically linked JDK image

2023-04-28 Thread Jiangli Zhou
On Fri, 28 Apr 2023 18:25:14 GMT, Phil Race wrote: > Why not ? Surely you aren't statically linking every library you find on the > platform that's referenced by JDK ? > I mean its fine to say that I'd prefer to statically link this library, but I > don't understand the claim that this is the o

Re: RFR: 8303796: Optionally build fully statically linked JDK image

2023-04-28 Thread Jiangli Zhou
On Sat, 29 Apr 2023 00:03:24 GMT, Jiangli Zhou wrote: > Based the initial feedback from you and other reviewers in the thread, I'll > repurpose this PR for handling the .a part only. I'll split the 'javastatic' > static linking part into a separate branch for

Re: RFR: 8303796: Optionally build fully statically linked JDK image

2023-04-28 Thread Jiangli Zhou
On Fri, 28 Apr 2023 19:40:34 GMT, Erik Joelsson wrote: > I think it would be rather beneficial if this linking step could be performed > by some variant of SetupNativeCompilation. We don't want to have to maintain > logic for dealing with different platforms and linkers outside of the common >

Re: RFR: 8303796: Optionally build fully statically linked JDK image

2023-04-28 Thread Jiangli Zhou
On Fri, 28 Apr 2023 18:14:48 GMT, Erik Joelsson wrote: > > If I understand the make file changes proposed here, it runs the native > linker to create "javastatic" with the launcher, libjvm and other JNI libs > linked into one executable, this is generated and copied into the run-time > image

Re: RFR: 8303796: Optionally build fully statically linked JDK image

2023-04-28 Thread Jiangli Zhou
On Fri, 28 Apr 2023 18:16:07 GMT, Erik Joelsson wrote: > I pulled this PR and had a go at building it. For me it failed with errors > like this: > > ``` > /home/erik/git/jdk/build/linux-x64/images/static-libs/lib/libjvm.a(os_linux.o):os_linux.cpp:function > os::Linux::fast_thread_clock_init():

Re: RFR: 8303796: Optionally build fully statically linked JDK image

2023-04-28 Thread Jiangli Zhou
On Fri, 28 Apr 2023 04:57:45 GMT, David Holmes wrote: > @jianglizhou I thought this work was proposed to be done under the Project > Leyden umbrella? The other static-build tweaks have been fine but this seems > to be part of a bigger, yet unspecified, project that may need to be covered > by

RFR: 8303796: Optionally build fully statically linked JDK image

2023-04-27 Thread Jiangli Zhou
Initial implementation for supporting building a fully statically linked (with a desired set of JDK native libraries and libjvm) Java launcher executable, which is named as 'javastatic'. In this PR, the support is only added for the linux platform. Both gcc and clang can be supported. For curre

Re: Hermetic Java (static image packaging/formatting) investigation and proposal

2023-03-07 Thread Jiangli Zhou
rowse/JDK-8303796 Best, Jiangli On Tue, Feb 14, 2023 at 12:55 AM Magnus Ihse Bursie < magnus.ihse.bur...@oracle.com> wrote: > On 2023-02-14 00:52, Jiangli Zhou wrote: > > Hi Magnus, > > Thanks for the thoughts! Please see comments inlined below. > > On Mon, Feb 13, 20

Re: Hermetic Java (static image packaging/formatting) investigation and proposal

2023-02-13 Thread Jiangli Zhou
Hi Magnus, Thanks for the thoughts! Please see comments inlined below. On Mon, Feb 13, 2023 at 5:43 AM Magnus Ihse Bursie < magnus.ihse.bur...@oracle.com> wrote: > Hi Jiangli, > > On 2023-02-08 03:08, Jiangli Zhou wrote: > > Hi Brian, > > > > Here are the main

<    1   2