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

    <tr>
        <th>Summary</th>
        <td>
            Provide clang flag to opt out of `wasm-opt` when linking wasm?
        </td>
    </tr>

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

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

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

<pre>
    Currently, when linking wasm, `clang` attempts to detect `wasm-opt` in the environment, and invokes it with certain flags based on current optimization level. [source](https://github.com/llvm/llvm-project/blob/940e290860894d274c986c88bea2dcc17f1e93c3/clang/lib/Driver/ToolChains/WebAssembly.cpp#L133)

This behavior is undesirable when user wants to customize when or how `wasm-opt` is run. It would be nice if a `clang` command line flag can be provided to opt-out of this behavior.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVUk2PnDAM_TVwsRaFMAxw4LCd1UqteuhhpZ5DYiCdkIzywWj762tgq37saSVEnNh-fn724NRrf0neo43mNeMXuM9owWh71XaCuwjL9pidmTTCTnSCiBGXWwwQHSiMKOPm3iIf3C1uEdpCnBHQrto7uxD0hiGsIs_qrhhAR7jrOINEHwWFj0ZMAQYRUIGzIA9CQHh60T9F1PRocEVTQFZ_Ci55iVn9lPF2jvEWsuox48_0TQSahkI6Yv1szPr7eLh594OY0nUwbqCjOzHkHWvPrO1Oijcn2bVn2bYDCq6kLJuxxK6SFYUenROQ3hKfvF7Rk_HinLnMxD7Q5TsOjyHgMpjXQt5uGa--lhUldxl7ytjj8X-ZNTWJs1i180B2sgqD9mIweOieAnoS3R7qyhSio_7fnJQzu_s7sQP4ZAv4TJK6ZBQVAKslgh5B_DM4UmXZhkDDxV1xkMJu4STOqhVJTzUJ9cElkn6kGf5Ft8hVX6mu6kQedTTYfzuSYIc_4I50eEv_j-f7vaqe8-RN_-EJ6hASbqLXddOW-dw3HTuVqhwlntSomqZshaiZ7MaGj3WJLDdiQBN6Wp2Mc4t32CHIph3Kdc8Z56yuWNmV5_JUjKIdB1Y1XdsSZokZrcoitCk2HoXzU-77ndKQpkBOo0MMf5wiBD1ZxL0c4YsUZ-f7F_Te-S9CXvO9er-z_wXU0CmX">