Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants