This changes the add_custom_libcxx macro to resemble the
llvm_ExternalProject_Add. The primary motivation is to avoid
unnecessary libFuzzer rebuilds that are being done on every
Ninja/Make invocation. The libc++ should be only rebuilt whenever
the libc++ source itself changes.
Details
Diff Detail
- Repository
- rCRT Compiler Runtime
Event Timeline
compiler-rt/cmake/Modules/AddCompilerRT.cmake | ||
---|---|---|
530–531 | Can you please add into patch description explanation when it is expected to be rebuilt | |
540 | Have you considered to achieve the same with just: | |
542 | Why do you need USES_TERMINAL_ ? | |
compiler-rt/lib/fuzzer/CMakeLists.txt | ||
89 | Can this be just ${dir}/src/libcxx_fuzzer_${arch}/lib/libc++.a ? | |
compiler-rt/test/tsan/lit.cfg | ||
60 | why do we need "-bins" suffix? |
Why not just call llvm_ExternalProject_Add rather than duplicating here?
compiler-rt/cmake/Modules/AddCompilerRT.cmake | ||
---|---|---|
555 | Unused if. |
Don't we still want to support the setup where compiler-rt is built as a standalone project in which case llvm_ExternalProject_Add wouldn't be available?
In that case, llvm_ExternalProject_BuildCmd won't be available either but is still used by this patch.
compiler-rt/cmake/Modules/AddCompilerRT.cmake | ||
---|---|---|
540 | The problem is that we would need to list all the library artifacts, e.g. libc++.so is only a symlink to libc++.so.1 which is a symlink to libc++.so.1.0, and I don't know if we want to rely on those details here? | |
542 | This is not really needed, but now that libc++ is being used as part of the libFuzzer build, I just found it much easier to debug build issues if the libFuzzer's libc++ build output goes to terminal rather than file log which requires extra steps to read, I'm happy to drop this if you don't like it though. | |
compiler-rt/lib/fuzzer/CMakeLists.txt | ||
89 | That directory no longer exists, all the binary artifacts now end up in the -bins directory. | |
compiler-rt/test/tsan/lit.cfg | ||
60 | I was following the naming convention used by llvm_ExternalProject_Add, but I can drop the "-bins" suffix if you prefer? |
compiler-rt/cmake/Modules/AddCompilerRT.cmake | ||
---|---|---|
522 | Why don't we depend on LIBCXX_DEPS here? |
compiler-rt/cmake/Modules/AddCompilerRT.cmake | ||
---|---|---|
542 | up to you. | |
compiler-rt/lib/fuzzer/CMakeLists.txt | ||
89 | So why to use ${dir}-bins instead of ${dir}? | |
compiler-rt/test/tsan/lit.cfg | ||
60 | This is the primary location which will be used for linking? i'd prefer without suffix |
Why don't we depend on LIBCXX_DEPS here?