<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Hi Peter,</p>
    <p>> the Solaris 64-bit library location isn't one that's in the
      default search list</p>
    <p>It might be worth it to enhance the make/autoconf/lib-ffi.m4
      script to look in the alternative library location as well. I
      recently added support for mac and windows as well [1], but prior
      to that, it really only seemed to be made for linux. So, there's
      probably still room for improvement.</p>
    <p>> I wonder if the correct approach might be to resolve what
      libffi.so points to rather than using the libffi.so.? pattern<br>
      <br>
      This might work, but libffi.so doesn't always seem to be a link. I
      suggest trying to work out some improvements to the lib-ffi.m4
      script, and then we can update the script. Perhaps we need a
      --with-libffi-libfile option that points to the exact library
      file.<br>
    </p>
    <p>Jorn<br>
    </p>
    <p>[1]: <a class="moz-txt-link-freetext" href="https://github.com/openjdk/jdk/pull/14446">https://github.com/openjdk/jdk/pull/14446</a><br>
    </p>
    <div class="moz-cite-prefix">On 23/06/2023 13:00, Peter Tribble
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CAEgYsbGYPyf96Gt5n3K2iRui3YvoZExi6Xavpj5xytm+5=fp9A@mail.gmail.com">
      
      <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" moz-do-not-send="true" class="moz-txt-link-freetext">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="https://urldefense.com/v3/__http://www.petertribble.co.uk/__;!!ACWV5N9M2RV99hQ!NiRy5Ij4KegR0sDzlN3kKFvBkuFBpB-9VnZ9hOLJFGdls5Woud_b_UF8RwCyGl0NDJL74dk7Ep0GUZPkPdl52F9T$" target="_blank" moz-do-not-send="true">http://www.petertribble.co.uk/</a>
          - <a href="https://urldefense.com/v3/__http://ptribble.blogspot.com/__;!!ACWV5N9M2RV99hQ!NiRy5Ij4KegR0sDzlN3kKFvBkuFBpB-9VnZ9hOLJFGdls5Woud_b_UF8RwCyGl0NDJL74dk7Ep0GUZPkPS1CLfGs$" target="_blank" moz-do-not-send="true">http://ptribble.blogspot.com/</a></div>
      </div>
    </blockquote>
  </body>
</html>