<div dir="ltr">Hi!<br><br>I'm trying to build a fast Clang for myself to use for debug builds on Clang itself, but I've been struggling for a very long time on it. Could you please help?<br><br>I've been following this guide: <a href="https://llvm.org/docs/HowToBuildWithPGO.html">https://llvm.org/docs/HowToBuildWithPGO.html</a><div><br></div><div>I've quickly learned that its outdated, because the script it talks about doesn't work with the monorepo layout at all, but in any case, it does describe how to do the entire process by hand, so I went for that. Here are my steps:<br><br></div><div>* Built a release version of LLVM/Clang/LLD/compiler-rt on version 9.0.0-rc3</div><div><br></div><div>* Built an instrumented clang with the following config:</div><div><font face="monospace">cmake -G Ninja ../llvm \<br>  -DLLVM_ENABLE_PROJECTS='clang;compiler-rt' \<br>  -DLLVM_TARGETS_TO_BUILD=X86 \<br>  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \<br>  -DCMAKE_CXX_COMPILER=/path/to/release_build/bin/clang++ \<br>  -DCMAKE_C_COMPILER=/path/to/release_build/bin/clang \<br>  -DLLVM_USE_LINKER=/path/to/release_build/bin/ld.lld \<br>  -DLLVM_CCACHE_BUILD=ON \<br>  -DLLVM_BUILD_INSTRUMENTED=IR \<br>  -DLLVM_BUILD_RUNTIME=No \<br>  -DLLVM_ENABLE_ZLIB=1 \<br>  -DCMAKE_BUILD_TYPE=Release \<br>  -DLLVM_ENABLE_LTO=Thin \<br>  -DCMAKE_RANLIB=/path/to/release_build/bin/llvm-ranlib \<br>  -DCMAKE_AR=/path/to/release_build/bin/llvm-ar</font></div><div><font face="monospace"><br></font></div><div><font face="arial, sans-serif">I tried this without specifying zlib being enabled, without thinlto, everything I could come up with really.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">* Built a debug Clang with the following configuration:</font></div><div><font face="monospace">cmake -G Ninja ../llvm \<br>  -DCMAKE_BUILD_TYPE=Debug \<br>  -DLLVM_ENABLE_PROJECTS='clang' \<br>  -DBUILD_SHARED_LIBS=ON \<br>  -DLLVM_TARGETS_TO_BUILD=X86 \<br>  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \<br>  -DCMAKE_CXX_COMPILER=/path/to/instrumented_build/bin/clang++ \<br>  -DCMAKE_C_COMPILER=/path/to/instrumented_build/bin/clang \<br>  -DLLVM_USE_LINKER=/path/to/release_build/bin/ld.lld  \<br>  -DLLVM_CCACHE_BUILD=ON</font></div><div><br></div><div>* Tried to use <font face="monospace">/path/to/instrumented_build/llvm-profdata </font><font face="arial, sans-serif">on the profraw files found in </font> <font face="monospace">/path/to/instrumented_build/profiles/.</font></div><div><font face="monospace"><br></font></div><div><font face="arial, sans-serif">I got the following error message:</font></div><div><font face="monospace">error: profiles/default_15822678447050577402_0.profraw: Profile uses zlib compression but the profile reader was built without zlib support</font><br></div><div><br></div><div>Even when I explicitly specified zlib to be enabled, and double check whether zlib.h was found I got this message. I've found this [1] thread mentioning a similar issue, but I'm unfortunately not familiar enough with LLVM itself to use the discussed tips with any success. Is there something obvious I'm missing?<br><br>Thanks in advance,</div><div>Kristóf</div><div><br></div><div>[1] <a href="http://lists.llvm.org/pipermail/llvm-dev/2017-July/115588.html">http://lists.llvm.org/pipermail/llvm-dev/2017-July/115588.html</a></div></div>