@@ -39,6 +39,16 @@ module Build
39
39
40
40
def self . debug ( verbose : false )
41
41
ENV [ 'RUSTFLAGS' ] = RUSTFLAGS . join ( ' ' )
42
+ # Rust compilation on `wasm32-unknown-emscripten` fails during linking
43
+ # due to a dependency on missing symbol `__gxx_personality_v0`. This has
44
+ # been broken since Rust 1.53.0 and emsdk newer than 2.0.9.
45
+ #
46
+ # These flags work around the problem by letting the emcc linker ignore
47
+ # the missing symbol error.
48
+ #
49
+ # - https://github.com/zackradisic/cheatsheets/issues/21#issuecomment-969393554
50
+ # - https://github.com/rust-lang/rust/issues/85821#issuecomment-969369677
51
+ ENV [ 'EMMAKEN_CFLAGS' ] = '-s ERROR_ON_UNDEFINED_SYMBOLS=0 --no-entry'
42
52
43
53
if verbose
44
54
`cargo build --target wasm32-unknown-emscripten --verbose`
@@ -57,6 +67,16 @@ def self.debug(verbose: false)
57
67
58
68
def self . release ( verbose : false )
59
69
ENV [ 'RUSTFLAGS' ] = RUSTFLAGS . join ( ' ' )
70
+ # Rust compilation on `wasm32-unknown-emscripten` fails during linking
71
+ # due to a dependency on missing symbol `__gxx_personality_v0`. This has
72
+ # been broken since Rust 1.53.0 and emsdk newer than 2.0.9.
73
+ #
74
+ # These flags work around the problem by letting the emcc linker ignore
75
+ # the missing symbol error.
76
+ #
77
+ # - https://github.com/zackradisic/cheatsheets/issues/21#issuecomment-969393554
78
+ # - https://github.com/rust-lang/rust/issues/85821#issuecomment-969369677
79
+ ENV [ 'EMMAKEN_CFLAGS' ] = '-s ERROR_ON_UNDEFINED_SYMBOLS=0 --no-entry'
60
80
61
81
if verbose
62
82
`cargo build --target wasm32-unknown-emscripten --release --verbose`
0 commit comments