File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -625,11 +625,11 @@ class Builder {
625625 )
626626 this . setEnvIfNotExists (
627627 'TARGET_CFLAGS' ,
628- `--target=wasm32-wasi-threads --sysroot=${ WASI_SDK_PATH } /share/wasi-sysroot -pthread -mllvm -wasm-enable-sjlj -lsetjmp ` ,
628+ `--target=wasm32-wasi-threads --sysroot=${ WASI_SDK_PATH } /share/wasi-sysroot -pthread -mllvm -wasm-enable-sjlj` ,
629629 )
630630 this . setEnvIfNotExists (
631631 'TARGET_CXXFLAGS' ,
632- `--target=wasm32-wasi-threads --sysroot=${ WASI_SDK_PATH } /share/wasi-sysroot -pthread -mllvm -wasm-enable-sjlj -lsetjmp ` ,
632+ `--target=wasm32-wasi-threads --sysroot=${ WASI_SDK_PATH } /share/wasi-sysroot -pthread -mllvm -wasm-enable-sjlj` ,
633633 )
634634 this . setEnvIfNotExists (
635635 `TARGET_LDFLAGS` ,
Original file line number Diff line number Diff line change @@ -44,13 +44,18 @@ pub fn setup() {
4444 crt_reactor_path. display( )
4545 ) ;
4646 }
47- if let Ok ( setjmp_link_dir) = env:: var ( "SETJMP_LINK_DIR" ) {
48- println ! ( "cargo:rustc-link-search={setjmp_link_dir}" ) ;
49- println ! ( "cargo:rustc-link-lib=static=setjmp-mt" ) ;
50- }
5147 if let Ok ( wasi_sdk_path) = env:: var ( "WASI_SDK_PATH" ) {
5248 println ! (
5349 "cargo:rustc-link-search={wasi_sdk_path}/share/wasi-sysroot/lib/wasm32-wasip1-threads"
5450 ) ;
51+ let setjmp_static_lib = Path :: new ( & wasi_sdk_path)
52+ . join ( "share" )
53+ . join ( "wasi-sysroot" )
54+ . join ( "lib" )
55+ . join ( "wasm32-wasip1-threads" )
56+ . join ( "libsetjmp.a" ) ;
57+ if setjmp_static_lib. exists ( ) {
58+ println ! ( "cargo:rustc-link-lib=static=setjmp" ) ;
59+ }
5560 }
5661}
You can’t perform that action at this time.
0 commit comments