Skip to content

Add support for FreeBSD. #27

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add support for FreeBSD. #27

wants to merge 1 commit into from

Conversation

osokin
Copy link

@osokin osokin commented Nov 3, 2023

With this patch it's possible to run `CC=clang13 gmake examples' and get wasm files. However,

CC=clang13 gmake all

requires a bit more work.

With this patch it's possible to run `CC=clang13 gmake examples'
and get wasm files.  However, `CC=clang13 gmake all' requires
a bit more work.
@ac000
Copy link
Member

ac000 commented Nov 3, 2023

Hi Sergey,

Thanks, let me take a look because I thought I did have it building under FreeBSD...

@ac000
Copy link
Member

ac000 commented Nov 4, 2023

Hmm, does

$ gmake CC=clang13 rust

work for you?

I get an error about not finding stddef.h, which I can hack around with

diff --git a/src/rust/unit-wasm-sys/build.rs b/src/rust/unit-wasm-sys/build.rs
index 1f41afa..0e65f58 100644
--- a/src/rust/unit-wasm-sys/build.rs
+++ b/src/rust/unit-wasm-sys/build.rs
@@ -39,6 +39,7 @@ fn generate_bindings() {
         .default_enum_style(bindgen::EnumVariation::Rust {
             non_exhaustive: false,
         })
+       .clang_arg("-I/usr/local/share/wasi-sysroot/include")
         .generate()
         .expect("Unable to generate bindings");
 

But then I get a bunch of other errors starting with

   Compiling unit-wasm-sys v0.3.0 (/usr/home/andrew/src/unit-wasm/src/rust/unit-wasm-sys)
error[E0463]: can't find crate for `std`
  |
  = note: the `wasm32-wasi` target may not be installed
  = help: consider downloading the target with `rustup target add wasm32-wasi`

Perhaps some other package needs to be installed to provide the wasm32-wasi target?

Although

$ rustc --print target-list | grep wasm
wasm32-unknown-emscripten
wasm32-unknown-unknown
wasm32-wasi
wasm64-unknown-unknown

So maybe my FreeBSD install is just messed up as I'm sure this used to work...

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