Diff Detail
Event Timeline
Can you please elaborate the goal? BOLT tests are disabled if LLVM tests are disabled (LLVM_INCLUDE_TESTS=OFF), or if prerequisites are not met (clang/lld are not built or not specified via BOLT_{CLANG,LLD}_EXE). Likewise, they are enabled if LLVM_INCLUDE_TESTS is on.
If the goal is to control BOLT tests independent from LLVM tests, can you please confirm by specifying LLVM_INCLUDE_TESTS=ON and BOLT_INCLUDE_TESTS=OFF and vice versa.
BOLT_INCLUDE_TESTS also controls whether merge-fdata gets built with relocation. My goal is to build LLVM with tests but without relocation for merge-fdata.
Makes sense. Although why is building with relocs a problem? (It might be a problem with gold linker that doesn't accept -emit-relocs together with -icf or -gc-sections)
bolt/CMakeLists.txt | ||
---|---|---|
17 | Should this definition also be changed to set a cache entry? | |
29 | Add FORCE to override a cache entry in case prerequisites are not met |
Due to some Darwin specific issues, we can only --strip-debug on the final library instead of --strip-all, and this causes error (symbol named in a relocation).
Please address the feedback, but otherwise LGTM. The proper way to solve the problem you're running into would be to disable relocs for merge-fdata and meta merge-fdata test on Darwin host, but it's orthogonal to disabling BOLT tests separate from the rest of LLVM tests. I'll take care of it.
I've double checked the test and I'm not sure why you're running into issues with it:
- emit-relocs shouldn't be set for Darwin (https://github.com/llvm/llvm-project/blob/main/bolt/tools/merge-fdata/CMakeLists.txt#L11)
# Emit relocations for BOLT meta test (bolt/test/runtime/meta-merge-fdata.test) if (BOLT_INCLUDE_TESTS AND UNIX AND NOT APPLE) target_link_options(merge-fdata PRIVATE LINKER:--emit-relocs) endif()
- meta-merge-fdata.test should only be enabled on linux: (https://github.com/llvm/llvm-project/blob/main/bolt/test/runtime/meta-merge-fdata.test#L4)
REQUIRES: x86_64-linux