Skip to content

Commit

Permalink
Insert -Zbuild-std when building rust packages
Browse files Browse the repository at this point in the history
Otherwise we are linking a copy of the standard library built with some
particular version of emscripten selected by the rust compiler that does not
match the version we are using. This can lead to an ABI mismatch.

See rust-lang/rust#131467
  • Loading branch information
hoodmane committed Oct 11, 2024
1 parent fac0109 commit a84379d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pyodide_build/pywasmcross.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,9 @@ def handle_command_generate_args( # noqa: C901
elif cmd == "strip":
line[0] = "emstrip"
return line
elif cmd == "cargo":
line.insert(1, "-Zbuild-std")
return line
else:
return line

Expand Down

0 comments on commit a84379d

Please sign in to comment.