Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve FreeBSD support #3365

Merged
merged 2 commits into from
Nov 24, 2022
Merged

Improve FreeBSD support #3365

merged 2 commits into from
Nov 24, 2022

Conversation

MalloryA
Copy link
Contributor

Description

  • Update traphandlers.rs to use the same pc/sp values for amd64 as are used for x86
  • Ensure amd64 is treated the same as x86_64 in the Makefile
  • Add an IS_FREEBSD variable to the Makefile which is pretty much the same as IS_DARWIN
  • Update CHANGELOG.md

wasmer partially works on FreeBSD/amd64 with these few tiny changes. However, after printing the output of cowsay.wasm, it hangs for a long time (55 seconds in this example).

Using rust toolchain 1.63-x86_64-apple-darwin (correct behavior):

% time ./target/release/wasmer cowsay.wasm -- hello world
 _____________
< hello world >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
               ||----w |
                ||     ||
./target/release/wasmer cowsay.wasm -- hello world  0.01s user 0.01s system 41% cpu 0.061 total

Using rust toolchain 1.63-x86_64-unknown-freebsd (incorrect behavior):

% time ./target/release/wasmer cowsay.wasm -- hello world
 _____________
< hello world >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
               ||----w |
                ||     ||
./target/release/wasmer cowsay.wasm -- hello world  55.14s user 0.05s system 100% cpu 55.183 total

cowsay.wasm is https://registry-cdn.wapm.io/contents/syrusakbary/cowsay/0.2.0/target/wasm32-wasi/release/cowsay.wasm

Review

  • Add a short description of the change to the CHANGELOG.md file

- Update `traphandlers.rs` to use the same `pc`/`sp` values for amd64 as
  are used for x86
- Ensure amd64 is treated the same as x86_64 in the Makefile
- Add an `IS_FREEBSD` variable to the Makefile which is pretty much the
  same as `IS_DARWIN`
- Update CHANGELOG.md

wasmer partially works on FreeBSD/amd64 with these few tiny changes.
However, after printing the output of cowsay.wasm, it hangs for a long
time (55 seconds in this example).

Using rust toolchain `1.63-x86_64-apple-darwin` (correct behavior):

```
% time ./target/release/wasmer cowsay.wasm -- hello world
 _____________
< hello world >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
               ||----w |
                ||     ||
./target/release/wasmer cowsay.wasm -- hello world  0.01s user 0.01s system 41% cpu 0.061 total
```

Using rust toolchain `1.63-x86_64-unknown-freebsd` (incorrect behavior):

```
% time ./target/release/wasmer cowsay.wasm -- hello world
 _____________
< hello world >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
               ||----w |
                ||     ||
./target/release/wasmer cowsay.wasm -- hello world  55.14s user 0.05s system 100% cpu 55.183 total
```

cowsay.wasm is https://registry-cdn.wapm.io/contents/syrusakbary/cowsay/0.2.0/target/wasm32-wasi/release/cowsay.wasm
@MalloryA
Copy link
Contributor Author

To be clear there was already code to support FreeBSD/x86 in traphandlers.rs. But the Makefile did not handle FreeBSD at all.

@MalloryA MalloryA changed the title Add preliminary FreeBSD support Improve FreeBSD support Nov 24, 2022
@syrusakbary
Copy link
Member

bors r+

@syrusakbary
Copy link
Member

wasmer partially works on FreeBSD/amd64 with these few tiny changes. However, after printing the output of cowsay.wasm, it hangs for a long time (55 seconds in this example).

@MalloryA can you create an issue documenting the hang on FreeBSD? That way we will not forget about this after merging.
Thanks!

@bors
Copy link
Contributor

bors bot commented Nov 24, 2022

Build succeeded:

  • Code lint

@bors bors bot merged commit a7defaf into wasmerio:master Nov 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants