diff --git a/config.llvm.toml b/config.llvm.toml index b8d5239e0fee0..290dd692dc711 100644 --- a/config.llvm.toml +++ b/config.llvm.toml @@ -35,6 +35,8 @@ sysconfdir = "etc" [target.'wasm32-wasip1-threads'] wasi-root = "wasi-sdk-24.0-x86_64-linux/share/wasi-sysroot" # codegen-backends = ["cranelift"] +cc = "/home/bjorn/Projects/rust/wasi-sdk-24.0-x86_64-linux/bin/clang" +cxx = "/home/bjorn/Projects/rust/wasi-sdk-24.0-x86_64-linux/bin/clang" linker = "wasi-sdk-24.0-x86_64-linux/bin/clang" codegen-backends = ["llvm"] diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index ad7a7f3d03933..c8f76bed9acdc 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -1253,7 +1253,9 @@ fn rustc_llvm_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelect // Building with a static libstdc++ is only supported on linux right now, // not for MSVC or macOS - if builder.config.llvm_static_stdcpp + if target.contains("wasi") { + cargo.env("LLVM_STATIC_STDCPP", builder.wasi_libdir(target).unwrap().join("libstdc++.a")); + } else if builder.config.llvm_static_stdcpp && !target.contains("freebsd") && !target.is_msvc() && !target.contains("apple")