diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs index b0783d75d47..aa1121d6bb3 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs @@ -251,8 +251,11 @@ fn main() { } else if target.contains("windows-gnu") { println!("cargo:rustc-link-lib=shell32"); println!("cargo:rustc-link-lib=uuid"); - } else if target.contains("netbsd") || target.contains("haiku") || target.contains("darwin") { + } else if target.contains("haiku") || target.contains("darwin") { println!("cargo:rustc-link-lib=z"); + } else if target.contains("netbsd") { + println!("cargo:rustc-link-lib=z"); + println!("cargo:rustc-link-lib=execinfo"); } cmd.args(&components);