<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/124988>124988</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [WebAssembly] --no-wasm-opt skips linker step
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Photosounder
      </td>
    </tr>
</table>

<pre>
    By default if clang detects wasm-opt then wasm-opt is called after calling wasm-ld. But regardless of wasm-opt's presence, when `--no-wasm-opt` is given to clang then the linker is skipped.

Compiled with this command:

```
clang --target=wasm64 -nostdlib -mexec-model=reactor -Oz \
        -Wl,--initial-memory=$((10*1024*1024)),--max-memory=$((2*1024*1024*1024)) -z stack-size=$((16*1024)) \
        -Wl,--stack-first -Wl,--export=__heap_base,--export=__data_end,--export=__stack_pointer \
        *.c -o spiral.wasm -flto --no-wasm-opt
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsU01vozAQ_TXmYhkZ8xE4cEgT5bp76zEyeABvDUaeoWn661eQ9CPdlSxZY7_35tkzoxFtPwHULH9i-THSCw0-1L8HTx79MhkIUePNtX66cgOdXhxx2_HW6annBghaQn7ROAo_E6cBpq_IIm-1c2C47gjCFtipvwGcifnTQjxAr4NxgMh998llaod8DoAwtcDUgV9WZVZIISYvPlGFXJP09hUmTv7uajNBA3BnpxcIKwJf7DyDiZncM7k_-HG2q62LpYHTsPr046gnw9L9DcIKeV9yf1MVgnTogVh6XNMXGReTRzLONlyM8AatGL0Bx9JjAN2SD1z8eucsP2yKlXh2TB2EsJMlq50YYfThytIjUxlTJVNlIpnaJ3IN71u1rYMQo377D0H9xH-jcfHOkXT7ItC-w0Oa4hH4j8MbrbMBiX-cwdvsw_r283kAPZ8bjfDzwmjSZ5jMz_NN7zx7O61N8JmOqX3ccuE5zjZoF6-_ykXnyPPHIn-rRmTq1FRppSOok11aJmWe7rJoqNtCtyaX0iSy2yUy26XVrtMyqUyZGKnayNZKqlwmqlJJUiRZXMlCNbJM86TrTKFzlkkYtXWxc69j7EMfWcQF6kRlVVlGTjfgcJsSpSa48O2WKbUOTahXkmiWHlkmnUXCLxmy5LbxeoZmjwhj464sPz4-cutQ_OhYJJijJbh6IJpxbUp1YurUWxqWJm79yNRp1b9vYg7-D7TE1GlzhUyd7rZfa_U3AAD__6zdNNs">