Stream: wasi

Topic: ring and aws-lc-rs


view this post on Zulip Ludea (Sep 23 2026 at 09:23):

Hi, I try to build rustls with either ring feature or aws-lc-rs feature with nightly and wasip3 target but both failed on Windows 11.
On Ubuntu, building with ring feature work as expected
I guess I have to setup something else on Windows?

view this post on Zulip bjorn3 (Sep 23 2026 at 11:26):

Both ring and aws-lc-rs need a C compiler (in the case of wasi it needs a C compiler that can compile to wasm, so you must make sure it uses clang (preferably from wasi-sdk), not msvc or gcc). I'm not sure to what extent either of them supports compiling for wasm. They tend to use crypto routines written in assembly by default, which isn't portable across architectures.

view this post on Zulip Ludea (Sep 23 2026 at 15:32):

Will use ring with Ubuntu.

view this post on Zulip Ludea (Sep 23 2026 at 15:36):

And during linking, I get

  = note: some arguments are omitted. use `--verbose` to show all linker arguments                = note: rust-lld: error: unknown argument: --cooperative-threading                                      error: failed to invoke LLD: exit status: 1

I don't enable this feature, I just run cargo build --target wasm32-wasip3

view this post on Zulip Ludea (Sep 25 2026 at 10:46):

I update to llvm 23 on Ubuntu.
I get

 tyle-b53b335f40cc0b2b.rlib" "<sysroot>/lib/rustlib/wasm32-wasip3/lib/{libstd-*,libpanic_abort-*,libwasip3-*,libwit_bindgen-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*}.rlib" "-l" "c" "<sysroot>/lib/rustlib/wasm32-wasip3/lib/{librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-L" "/home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/ring/ca85592467a45e9b/out" "-L" "/home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/wit-bindgen/cafdc108c1e1d468/out" "-L" "<sysroot>/lib/rustlib/wasm32-wasip3/lib/self-contained" "-o" "/home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/tauri-plugin-cascette/a76593da1954f6d4/out/cascette.wasm" "--gc-sections" "--no-entry" "-O0"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: rust-lld: error: 25ac62e5b3c53843-curve25519.o: object file uses globals for thread context, but --cooperative-threading was specified
          rust-lld: error: 0bbbd18bda93c05b-aes_nohw.o: object file uses globals for thread context, but --cooperative-threading was specified
          rust-lld: error: 00c879ee3285a50d-montgomery.o: object file uses globals for thread context, but --cooperative-threading was specified
          rust-lld: error: 00c879ee3285a50d-montgomery_inv.o: object file uses globals for thread context, but --cooperative-threading was specified
          rust-lld: error: a0330e891e733f4e-gfp_p256.o: object file uses globals for thread context, but --cooperative-threading was specified
          rust-lld: error: a0330e891e733f4e-ecp_nistz.o: object file uses globals for thread context, but --cooperative-threading was specified
          rust-lld: error: a0330e891e733f4e-gfp_p384.o: object file uses globals for thread context, but --cooperative-threading was specified
          rust-lld: error: a0330e891e733f4e-p256.o: object file uses globals for thread context, but --cooperative-threading was specified
          rust-lld: error: aaa1ba3e455ee2e1-limbs.o: object file uses globals for thread context, but --cooperative-threading was specified
          rust-lld: error: a4019cc0736b0423-mem.o: object file uses globals for thread context, but --cooperative-threading was specified
          rust-lld: error: d5a9841f3dc6e253-poly1305.o: object file uses globals for thread context, but --cooperative-threading was specified
          rust-lld: error: /home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/ring/9845654270f5adc8/out/libring-9845654270f5adc8.rlib(25ac62e5b3c53843-curve25519.o): undefined symbol: __stack_pointer
          rust-lld: error: /home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/ring/9845654270f5adc8/out/libring-9845654270f5adc8.rlib(25ac62e5b3c53843-curve25519.o): undefined symbol: __stack_pointer
          rust-lld: error: /home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/ring/9845654270f5adc8/out/libring-9845654270f5adc8.rlib(25ac62e5b3c53843-curve25519.o): undefined symbol: __stack_pointer
          rust-lld: error: /home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/ring/9845654270f5adc8/out/libring-9845654270f5adc8.rlib(25ac62e5b3c53843-curve25519.o): undefined symbol: __stack_pointer
          rust-lld: error: /home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/ring/9845654270f5adc8/out/libring-9845654270f5adc8.rlib(25ac62e5b3c53843-curve25519.o): undefined symbol: __stack_pointer
          rust-lld: error: /home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/ring/9845654270f5adc8/out/libring-9845654270f5adc8.rlib(25ac62e5b3c53843-curve25519.o): undefined symbol: __stack_pointer
          rust-lld: error: /home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/ring/9845654270f5adc8/out/libring-9845654270f5adc8.rlib(25ac62e5b3c53843-curve25519.o): undefined symbol: __stack_pointer
          rust-lld: error: /home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/ring/9845654270f5adc8/out/libring-9845654270f5adc8.rlib(25ac62e5b3c53843-curve25519.o): undefined symbol: __stack_pointer
          rust-lld: error: /home/ludovic/sparus-plugins/cascette/target/wasm32-wasip3/debug/build/ring/9845654270f5adc8/out/libring-9845654270f5adc8.rlib(25ac62e5b3c53843-curve25519.o): undefined symbol: __stack_pointer
          rust-lld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
          error: failed to invoke LLD: exit status: 1


error: could not compile `tauri-plugin-cascette` (lib) due to 1 previous

view this post on Zulip Bailey Hayes (Sep 25 2026 at 13:54):

I'm not really betting on this merging but funny enough I ran into this around the same time you did. Needs the c bindings for the rust wrapper: https://github.com/aws/aws-lc-rs/pull/1239

view this post on Zulip Ludea (Sep 28 2026 at 12:36):

So I have to set

[env]
CC_wasm32_wasip3 = "/opt/wasi-sdk/bin/clang"
CFLAGS_wasm32_wasip3 = "--sysroot=/opt/wasi-sdk/share/wasi-sysroot"

Into .cargo/config.toml and so download and untar wasi-sdk-34 into /opt/wasi-sdk?


Last updated: Oct 11 2026 at 02:20 UTC