Skip to content

Commit 2d5dcf2

Browse files
Bump WASI SDK to version 22
1 parent e3d5681 commit 2d5dcf2

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/ruby_wasm/build/product/crossruby.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,17 @@ def configure_args(build_triple, toolchain)
345345
wasi_sdk_path = @toolchain
346346
args << %Q(WASMOPT=#{wasi_sdk_path.wasm_opt})
347347
args << %Q(WASI_SDK_PATH=#{wasi_sdk_path.wasi_sdk_path})
348+
# NOTE: wasi-libc 22 and later defines stubs for fchmod and chmod
349+
# but they just return ENOTSUP, and ruby's configure doesn't check
350+
# the runtime behavior. So we need to tell configure that
351+
# these functions are not available.
352+
# https://github.com/WebAssembly/wasi-libc/pull/463
353+
args << %Q(ac_cv_func_fchmod=no)
354+
args << %Q(ac_cv_func_chmod=no)
355+
# TODO: wasi-libc 22 and later started using musl's realpath impl but
356+
# it broke Kernel#require on @bjorn3/browser_wasi_shim setup for some
357+
# reason. So we disable it for now.
358+
args << %Q(ac_cv_func_realpath=no)
348359
when "wasm32-unknown-emscripten"
349360
ldflags.concat(%w[-s MODULARIZE=1])
350361
env_emcc_ldflags = ENV["RUBY_WASM_EMCC_LDFLAGS"] || ""

lib/ruby_wasm/build/toolchain.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class WASISDK < Toolchain
5656
def initialize(
5757
wasi_sdk_path = ENV["WASI_SDK_PATH"],
5858
build_dir: nil,
59-
version_major: 21,
59+
version_major: 22,
6060
version_minor: 0,
6161
binaryen_version: 108
6262
)

0 commit comments

Comments
 (0)