<div dir="ltr"><div dir="ltr">+ <a href="mailto:henry.jen@oracle.com">henry.jen@oracle.com</a><br></div><div dir="ltr"><br></div><div dir="ltr">On Thu, Apr 17, 2025 at 9:38 AM Magnus Ihse Bursie <<a href="mailto:magnus.ihse.bursie@oracle.com">magnus.ihse.bursie@oracle.com</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2025-04-09 03:21, duke wrote:<br>
<br>
> - `link-command=<link_cmd>`: Specify the complete native linking command<br>
><br>
> - `pre-linked-exe=<pre_linked_launcher_executable>`: Specify the prelinked launcher executable, no native linking is performed in this case<br>
><br>
> If the native linking command is specified via the `link-command=<link_cmd>` option (see below example), jlink invokes the native linker and performs the linking step. It finds the output file name/path from the native linking command and the output file is used to create the final hermetic Java image.<br>
> ```<br>
> jlink --hermetic --link-hermetic-image link-command="/usr/bin/g++ ..." ...<br>
<br>
Is the plan here to generate this link command line in the build system? <br>
The example you give seem to use our standard flags...<br></blockquote><div><br></div><div>The native linking plugin (<a href="https://github.com/openjdk/leyden/blob/hermetic-java-runtime/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/LinkHermeticImagePlugin.java">https://github.com/openjdk/leyden/blob/hermetic-java-runtime/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/LinkHermeticImagePlugin.java</a>, plan to rename) can construct the linking command with the collected JDK static libraries and their associated linker flags that the static .jmods (<a href="https://github.com/openjdk/leyden/pull/46">https://github.com/openjdk/leyden/pull/46</a> from henry.jen@ will provide static .jmod) provide, in addition to user provided flags/objects/etc. Each JDK static library associated jlinker flags would be coming from the JDK build system. I see you mentioned using <font color="#000000" style="background-color:rgb(255,255,255)">"<span style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:11.9px">pkg-config"</span></font> for linking flags with JDK static libraries in <a href="https://github.com/openjdk/leyden/pull/46#issuecomment-2725408153">https://github.com/openjdk/leyden/pull/46#issuecomment-2725408153</a>. <font face="arial, sans-serif">Would that be one <span style="color:rgb(0,0,0)">"</span><span style="color:rgb(0,0,0)">pkg-config" for each static .jmod</span><span style="color:rgb(0,0,0)">?</span></font></div><div><font face="arial, sans-serif"><span style="color:rgb(0,0,0)"><br></span></font></div><div><font face="arial, sans-serif"><span style="color:rgb(0,0,0)">Thanks,</span></font></div><div><font face="arial, sans-serif"><span style="color:rgb(0,0,0)">Jiangli</span></font></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
/Magnus<br>
<br>
</blockquote></div></div>