about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJethro Beekman <jethro@fortanix.com>2020-05-28 17:13:14 +0200
committerJethro Beekman <jethro@fortanix.com>2020-06-11 16:56:26 +0200
commit8caa14f59919ac3a8eef4345df4c1840091e2913 (patch)
tree8df695dd660dcb07941857ab3fb399f9f55e95b6
parentfeb3536eba10c2e4585d066629598f03d5ddc7c6 (diff)
downloadrust-8caa14f59919ac3a8eef4345df4c1840091e2913.tar.gz
rust-8caa14f59919ac3a8eef4345df4c1840091e2913.zip
Enable LLVM zlib when building LLD
-rw-r--r--src/bootstrap/native.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
index 5b6e9534843..59769b7f5cf 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") {