[clang] Add wasm-opt warning (PR #100321)

Quentin Michaud via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 24 08:09:15 PDT 2024


mh4ck-Thales wrote:

`wasm-opt` is enabled by default for WASIp1, but can be disabled with the `--no-wasm-opt` flag. Indeed if it is explicitly enabled then an error instead of a warning would make more sense. 

I'm not sure what is the problem with

> most developers I know of on wasm32-wasip1 don't have wasm-opt in their path meaning that this would create many un-suppressable warnings by default for these projects.

The solution to this is just to add `--no-wasm-opt` to the compilation command and no warning will be displayed.

I agree that `wasm-opt` should have been opt-in when it have been introduced into LLVM, it has already been debated in https://github.com/llvm/llvm-project/issues/55781 and the consensus is that we cannot go back on the default behavior as this would be a breaking change. A warning when `wasm-opt` is supposed to be used but is not present seems a reasonable solution to me in this situation.

In the longer term, it would be nice to see if we can package and distribute `wasm-opt` alongside LLVM. Maybe it cannot be done in LLVM directly, but it could be a nice addition to wasi-sdk.

https://github.com/llvm/llvm-project/pull/100321


More information about the cfe-commits mailing list