From a84379d17b01b491f75f56a500758ffe7d5ccb79 Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Fri, 11 Oct 2024 13:26:03 +0200 Subject: [PATCH] Insert -Zbuild-std when building rust packages 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 --- pyodide_build/pywasmcross.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyodide_build/pywasmcross.py b/pyodide_build/pywasmcross.py index 858b748..7e4c2a5 100755 --- a/pyodide_build/pywasmcross.py +++ b/pyodide_build/pywasmcross.py @@ -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