Skip to content

Commit 6d8ed52

Browse files
committed
bootstrap: enable zlib for LLVM when we compile it for profiling
when compiling target LLVM with `opt-dist local` on Windows/MinGW, profraw files are being compressed with zlib, so compiling without it will make `llvm-profdata` complain about lacking of zlib support. this error is shown: `profile uses zlib compression but the profile reader was built without zlib support` example from llvm test suite: https://github.com/llvm/llvm-project/blob/76b5fcbf975547251faaeed8b567ea09d139a607/llvm/test/tools/llvm-profdata/nocompress.test#L15
1 parent afa859f commit 6d8ed52

File tree

1 file changed

+2
-2
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+2
-2
lines changed

src/bootstrap/src/core/build_steps/llvm.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,8 @@ impl Step for Llvm {
370370
cfg.define("LLVM_PROFDATA_FILE", path);
371371
}
372372

373-
// Libraries for ELF section compression.
374-
if !target.is_windows() {
373+
// Libraries for ELF section compression and profraw files merging.
374+
if !target.is_windows() || builder.config.llvm_profile_generate {
375375
cfg.define("LLVM_ENABLE_ZLIB", "ON");
376376
} else {
377377
cfg.define("LLVM_ENABLE_ZLIB", "OFF");

0 commit comments

Comments
 (0)