about summary refs log tree commit diff
path: root/src/bootstrap/bin/rustc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootstrap/bin/rustc.rs')
-rw-r--r--src/bootstrap/bin/rustc.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index 28c8a75a13a..7429492f914 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -122,8 +122,8 @@ fn main() {
             cmd.arg("-Cprefer-dynamic");
         }
 
-        // Help the libc crate compile by assisting it in finding the MUSL
-        // native libraries.
+        // Help the libc crate compile by assisting it in finding various
+        // sysroot native libraries.
         if let Some(s) = env::var_os("MUSL_ROOT") {
             if target.contains("musl") {
                 let mut root = OsString::from("native=");
@@ -132,6 +132,12 @@ fn main() {
                 cmd.arg("-L").arg(&root);
             }
         }
+        if let Some(s) = env::var_os("WASI_ROOT") {
+            let mut root = OsString::from("native=");
+            root.push(&s);
+            root.push("/lib/wasm32-wasi");
+            cmd.arg("-L").arg(&root);
+        }
 
         // Override linker if necessary.
         if let Ok(target_linker) = env::var("RUSTC_TARGET_LINKER") {