From a3fc3ae4a061c99e01dd3a38c0cdf90043a943c4 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 28 Feb 2025 00:36:58 +1100 Subject: [PATCH 1/2] Fix wasm32-unknown-unknown by passing -c Fix #1423 --- src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c4fc9e45..614922fa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1351,6 +1351,8 @@ impl Build { }, ); + cmd.arg("-c"); + if compiler.supports_path_delimiter() { cmd.arg("--"); } From 9160871401289cf303e2786d3fd157db3750022b Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 28 Feb 2025 13:46:36 +1000 Subject: [PATCH 2/2] Update lib.rs Co-authored-by: Mads Marquart --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 614922fa..beea241f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1351,6 +1351,10 @@ impl Build { }, ); + // Checking for compiler flags does not require linking (and we _must_ + // avoid making it do so, since it breaks cross-compilation when the C + // compiler isn't configured to be able to link). + // https://github.com/rust-lang/cc-rs/issues/1423 cmd.arg("-c"); if compiler.supports_path_delimiter() {