Skip to content

Commit 275b3a6

Browse files
[wasm-pic] Explicitly pass asyncify-ignore-imports for non-pic builds
`configure.ac` had been passing `--pass-arg=asyncify-ignore-imports` to wasm-opt by default, but we cannot use it for dynamic linking builds because dynamic library can call Ruby's asyncified functions, so we cannot assume that all imported dynamically linked functions do not change asyncify state. Therefore `configure.ac` removed the default `--pass-arg=asyncify-ignore-imports`. We can still use it for non-pic builds, so we explicitly pass it for non-pic builds.
1 parent fb7404b commit 275b3a6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ruby_wasm/packager/core.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,9 @@ def derive_build
209209
# script of Ruby.
210210
if @packager.full_build_options[:target] != "wasm32-unknown-emscripten"
211211
build.crossruby.debugflags = %w[-g]
212-
build.crossruby.wasmoptflags = %w[-O3 -g]
212+
# We assume that imported functions provided through WASI will not change
213+
# asyncify state, so we ignore them.
214+
build.crossruby.wasmoptflags = %w[-O3 -g --pass-arg=asyncify-ignore-imports]
213215
build.crossruby.ldflags = %w[
214216
-Xlinker
215217
--stack-first

0 commit comments

Comments
 (0)