<div dir="ltr"><div>Thanks Jorn,<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 9, 2023 at 11:28 PM Jorn Vernee <<a href="mailto:jorn.vernee@oracle.com">jorn.vernee@oracle.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><p>To incorporate the library (.dll/.so/.dylib) into the JDK, it is
      essentially just copied into the right folder of the built JDK
      image. Automatic copying can be turned on using the
      --enable-libffi-bundling configuration flag. In practice, I'm
      using `--with-libffi=<path to extracted bundle>
      --enable-libffi-bundling --enable-fallback-linker` to create a
      working JDK image.</p></div></blockquote><div><br></div><div>I've been trying this on illumos/Solaris, and simply adding<br><br></div><div>--enable-fallback-linker<br><br></div><div>gets me a clean build against the system libffi.<br><br></div><div>Bundling is a little trickier. I need to be explicit, because the Solaris 64-bit library location isn't<br></div><div>one that's in the default search list, so<br><br>--with-libffi-lib=/usr/lib/amd64<br><br></div><div>would be the correct way to specify where to look. However, in practice that fails because my system<br></div><div>has multiple versions of libffi.so installed for binary compatibility (I'm not sure how common this may<br>be on other platforms), and configure fails like so<br><br>checking for libffi lib file location... /var/tmp/ud/jdk21-jdk-21-28/build/.configure-support/generated-configure.sh: line 144232: test: too many arguments<br>configure: error: Could not locate libffi.so.? for bundling in /usr/lib/amd64<br><br></div><div>I think the way round this, for me, is to create a sacrificial bundle area and point the build at that,<br></div><div>but I wonder if the correct approach might be to resolve what libffi.so points to rather than using<br></div><div>the libffi.so.? pattern, which might match multiple things, and will break if the FFI shared library<br></div><div>version ever grows to double digits.<br><br></div><div>Thanks,<br></div></div><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">-Peter Tribble<br><a href="http://www.petertribble.co.uk/" target="_blank">http://www.petertribble.co.uk/</a> - <a href="http://ptribble.blogspot.com/" target="_blank">http://ptribble.blogspot.com/</a></div></div>