From 8caa14f59919ac3a8eef4345df4c1840091e2913 Mon Sep 17 00:00:00 2001 From: Jethro Beekman Date: Thu, 28 May 2020 17:13:14 +0200 Subject: [PATCH] Enable LLVM zlib when building LLD --- src/bootstrap/native.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 5b6e953484369..59769b7f5cfe2 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -158,7 +158,6 @@ impl Step for Llvm { .define("LLVM_INCLUDE_TESTS", "OFF") .define("LLVM_INCLUDE_DOCS", "OFF") .define("LLVM_INCLUDE_BENCHMARKS", "OFF") - .define("LLVM_ENABLE_ZLIB", "OFF") .define("WITH_POLLY", "OFF") .define("LLVM_ENABLE_TERMINFO", "OFF") .define("LLVM_ENABLE_LIBEDIT", "OFF") @@ -168,6 +167,14 @@ impl Step for Llvm { .define("LLVM_TARGET_ARCH", target.split('-').next().unwrap()) .define("LLVM_DEFAULT_TARGET_TRIPLE", target); + if !target.contains("netbsd") { + cfg.define("LLVM_ENABLE_ZLIB", "ON"); + } else { + // FIXME: Enable zlib on NetBSD too + // https://github.com/rust-lang/rust/pull/72696#issuecomment-641517185 + cfg.define("LLVM_ENABLE_ZLIB", "OFF"); + } + if builder.config.llvm_thin_lto { cfg.define("LLVM_ENABLE_LTO", "Thin"); if !target.contains("apple") {