1
Fork 0

Auto merge of #72696 - jethrogb:jb/llvm-zlib, r=Mark-Simulacrum

Enable LLVM zlib

Compilers may generate ELF objects with compressed sections (although rustc currently doesn't do this). Currently, when linking these with `rust-lld`, you'll get this error:

`rust-lld: error: ...: contains a compressed section, but zlib is not available`

This enables zlib when building LLVM.
This commit is contained in:
bors 2020-06-21 13:18:00 +00:00
commit 349f6bfb11

View file

@ -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") {