<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Hi Gavin,<br>
      thanks for the question - actually this might trip up others as
      well, so it's always good to ask here.<br>
    </p>
    <p>I believe this has been fixed recently:</p>
    <p><a class="moz-txt-link-freetext" href="https://github.com/openjdk/jextract/pull/70">https://github.com/openjdk/jextract/pull/70</a></p>
    <p>But the binary snapshots do not contain this fix.</p>
    <p>In general inline functions (and function-like macros) are not
      true library symbols, so there's not much the Linker can do for
      them.</p>
    <p>If you need to access these, you would need a native library
      wrapper which exposes them as regular symbols.</p>
    <p>(we'd like, at some point, to automate the wrapper generation in
      jextract).</p>
    <p>Maurizio<br>
    </p>
    <div class="moz-cite-prefix">On 21/09/2022 20:35, Gavin Ray wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:CAFtvWZO47iczS1u+nxXYCc2XB+eZcj0cqu2aji0Vas3_4_fvKg@mail.gmail.com">
      
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">I'm not super familiar with how linking and
            symbols work
            <div><br>
            </div>
            <div>The liburing header is weird, it contains a mix of
              definitions:</div>
            <div><a href="https://github.com/axboe/liburing/blob/master/src/include/liburing.h" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/axboe/liburing/blob/master/src/include/liburing.h</a><br>
            </div>
            <div><br>
            </div>
            <div>Some of them are traditional header defs, like:</div>
            <div><br>
            </div>
          </div>
          <blockquote style="margin:0px 0px 0px
            40px;border:none;padding:0px">
            <div dir="ltr">
              <div>
                <div>int io_uring_queue_init(unsigned entries, struct
                  io_uring *ring, unsigned flags);</div>
              </div>
              <div><br>
              </div>
            </div>
          </blockquote>
          But there are a lot of them which are defined like this:
          <div>
            <blockquote style="margin:0px 0px 0px
              40px;border:none;padding:0px">
              <div>
                <div><br>
                </div>
                <div>static inline int io_uring_wait_cqe(struct io_uring
                  *ring, struct io_uring_cqe **cqe_ptr)</div>
              </div>
              <div><br>
              </div>
            </blockquote>
            Using "objdump" on the ".so", I can see that none of these
            "static inline" functions appear</div>
          <div><br>
          </div>
          <div>I have an almost-working test of using io_uring purely
            through Panama here, but it fails due to the above:</div>
          <div><a href="https://github.com/GavinRay97/panama-liburing/blob/82f83a247bb78c26d787992fca28ea1b951dfd3c/lib/src/test/java/panama/liburing/LibraryTest.java#L25-L59" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/GavinRay97/panama-liburing/blob/82f83a247bb78c26d787992fca28ea1b951dfd3c/lib/src/test/java/panama/liburing/LibraryTest.java#L25-L59</a><br>
          </div>
          <div><br>
          </div>
          <div>How are you meant to be able to use these from the
            Foreign Memory API?</div>
          <div>Do I need to write a second library and built it, that
            re-exports these?</div>
          <div><br>
          </div>
          <div>Thanks, and sorry for so many newbie questions</div>
          <div><br>
          </div>
          <div><br>
          </div>
        </div>
      </div>
    </blockquote>
  </body>
</html>