<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>That probably was the wrong link to send.  According to this:</p>
    <p><a class="moz-txt-link-freetext" href="https://learn.microsoft.com/en-us/cpp/build/reference/dot-lib-files-as-linker-input?view=msvc-170">https://learn.microsoft.com/en-us/cpp/build/reference/dot-lib-files-as-linker-input?view=msvc-170</a></p>
    <p>LIB can be used to create a standard library containing object
      files, which sounds like a Unix .a library.  But without an
      intermediate linking step, using .lib files from different modules
      to link the final .exe would be problematic, unless there was a
      way to tell the linker to perform <i>intra</i>-LIB symbol
      resolution first, before <i>inter</i>-LIB resolution.</p>
    <p>dl<br>
    </p>
    <div class="moz-cite-prefix">On 4/19/24 3:48 AM, Magnus Ihse Bursie
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:1a085d1a-226f-4b44-a249-4184f409d41e@oracle.com">On
      2024-04-19 00:35, <a class="moz-txt-link-abbreviated" href="mailto:dean.long@oracle.com">dean.long@oracle.com</a> wrote:
      <br>
      <br>
      <blockquote type="cite">There is also the LIB command, which
        creates the equivalent of a .a library, but with an explicit
        export list:
        <br>
        <br>
<a class="moz-txt-link-freetext" href="https://learn.microsoft.com/en-us/cpp/build/reference/building-an-import-library-and-export-file?view=msvc-170">https://learn.microsoft.com/en-us/cpp/build/reference/building-an-import-library-and-export-file?view=msvc-170</a>
        <br>
      </blockquote>
      <br>
      This is where the Microsoft toolchain gets confusing. This will
      only create an *import* library. An import library does not have a
      corresponding concept in the clang/gcc toolchain. It is a static
      library, yes, but it is a shim library with the single trivial
      purpose to load and initialize the corresponding dll. So this does
      not help us in building a "proper" static library.
      <br>
      <br>
      Unfortunately, this distinction was not entirely clear to me or
      the other initial authors of the JDK build system, so things are
      confusing there as well with regard to this. (I plan to address
      this.)
      <br>
      <br>
      /Magnus
      <br>
      <br>
      <blockquote type="cite">
        <br>
        dl
        <br>
        <br>
        On 4/18/24 3:28 AM, Magnus Ihse Bursie wrote:
        <br>
        <blockquote type="cite">What needs to be done then is:
          <br>
          <br>
          1) Combine multiple .obj (COFF object files) into one.
          <br>
          <br>
          2) Change the visibility of symbols that are not marked as
          dll_export:ed to they appear like they were declared static.
          <br>
          <br>
          In the clang/gcc world, the first step is done by "partial
          linking" by ld. That is our first blocker -- link.exe cannot
          do that. So the first question is really, is there a Windows
          build of ld that can work on COFF files to achieve this?
          <br>
          <br>
          The second step is done by objcopy using the
          "--localize-hidden" argument. The second question is, could
          this work on a COFF object file? </blockquote>
      </blockquote>
    </blockquote>
  </body>
</html>