Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3185: Fix `wasmer compile` command for non-x86 target r=syrusakbary a=flfymoss <!-- Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test: https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests --> # Description <!-- Provide details regarding the change including motivation, links to related issues, and the context of the PR. --> Currently, `wasmer compile` command with specifying non-x86 (e.g. `aarch64-apple-darwin`) target doesn't work. This change fixes the issue by not SSE2 to be force added for non-x86 targets. (Codes are ported from https://github.com/wasmerio/wasmer/blob/8a6c98702f1b8b63f5ab3d1b8c094959dd325afe/lib/cli/src/commands/create_obj.rs#L80 and https://github.com/wasmerio/wasmer/blob/d4a888abed6d877d46bf040a932e693ab39940b9/lib/cli/src/commands/create_exe.rs#L151 ) Possibly relates #2760 (comment) ## Demo ### Before ```sh $ wasmer compile hello.wasm -o hello.wasmu Compiler: cranelift Target: aarch64-apple-darwin ✔ File compiled successfully to `hello.wasmu`. $ wasmer run hello.wasmu Hello World! $ wasmer compile --target aarch64-apple-darwin -o hello.wasmu hello.wasm Compiler: cranelift Target: aarch64-apple-darwin ✔ File compiled successfully to `hello.wasmu`. $ wasmer run hello.wasmu error: failed to run `hello.wasmu` │ 1: failed to instantiate WASI module ╰─▶ 2: missing required CPU features: "EnumSet(SSE2)" ``` ### After ```sh $ wasmer compile --target aarch64-apple-darwin -o hello.wasmu hello.wasm Compiler: cranelift Target: aarch64-apple-darwin ✔ File compiled successfully to `hello.wasmu`. $ wasmer run hello.wasmu Hello World! ``` # Review - [ ] Add a short description of the change to the CHANGELOG.md file Co-authored-by: Go Murakami <[email protected]>
- Loading branch information