<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [WebAssembly] Fix custom import names for WASI"
   href="https://bugs.llvm.org/show_bug.cgi?id=40672">40672</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[WebAssembly] Fix custom import names for WASI
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: WebAssembly
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dan433584@gmail.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dan433584@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>40331
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=21455" name="attach_21455" title="lld 8.0 patch">attachment 21455</a> <a href="attachment.cgi?id=21455&action=edit" title="lld 8.0 patch">[details]</a></span>
lld 8.0 patch

WIth the 8.0 release branch and the latest WASI changes, LLVM's WebAssembly
support's handling of import module names doesn't support WASI exports. A
series of clang, llvm, and lld patches on trunk fixes the issue, so we'd like
to backport them to 8.0:

For clang: r352106, r352108, r352930, r352936
For lld: r352645, r352828, r353473
For LLVM: r352479, r352931, r353474, r353476

However, the trunk patches don't apply cleanly to 8.0 due to some unrelated
mass-rename/clang-tidy patches, so I've carefully backported and revised the
needed patches to avoid bringing in extra dependencies, tested them on the 8.0
release branch, and attached them to this bug.

This is admittedly a bigger and later change than one would like, and I'll
accept the judgment of the release manager. I propose it's worth considering.
The risk is relatively low: the patches only change WebAssembly-specific areas,
and most production WebAssembly users are currently using LLVM's WebAssembly
support through Emscripten, the Rust toolchain, Wasmception, or other
environments which aren't using the LLVM release branches anyway.

For people who want to use clang/LLVM directly, rather than through one of
those other environments, WASI support would provide standard headers and
libraries that can be compiled with to produce WebAssembly programs that don't
depend on any JS APIs.

Let me know if you have any questions, or if there's anything I can do to help
in this process. Thanks!</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [meta] 8.0.0 Release Blockers"
   href="https://bugs.llvm.org/show_bug.cgi?id=40331">Bug 40331</a>] [meta] 8.0.0 Release Blockers
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>