LSan on darwin doesn't exist on older versions of clang,
causing non-boostrapped sanitized buildbots to fail
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
utils/lit/lit/llvm/config.py | ||
---|---|---|
83 ↗ | (On Diff #118264) | How is config.host_cxx set? I don't think this is always set is it? |
utils/lit/lit/llvm/config.py | ||
---|---|---|
83 ↗ | (On Diff #118264) | Actually I think this is wrong, for several reasons:
|
utils/lit/lit/llvm/config.py | ||
---|---|---|
83 ↗ | (On Diff #118264) | config.host_cxx is set in the same file that sets config.llvm_use_sanitizer (which probably means I should use getattr() instead, now that I look at it), but which also means that it will always be defined in this if block. config.host_cxx is set to HOST_CXX from cmake. I do think that this is correct generally, because we don't actually want the clang we're testing, we want the clang that built the llvm source (since that's what will be compiled with -fsanitize=address, and which will provide the ASan DSO which needs to have LSan in it). The unit tests themselves won't be compiled with ASan afaik, so the version of clang used to build the unit tests isn't what we want here. |
utils/lit/lit/llvm/config.py | ||
---|---|---|
83 ↗ | (On Diff #118264) | I'll verify with check-clang though, to be sure. |
utils/lit/lit/llvm/config.py | ||
---|---|---|
83 ↗ | (On Diff #118264) | Yup, you're right, host_cxx isn't defined. We still don't want the just-built clang though, I'll try to figure out a solution. |
utils/lit/lit/llvm/config.py | ||
---|---|---|
83 ↗ | (On Diff #118264) | Is there a reason we can't just add config.host_cxx = CMAKE_CXX_COMPILER to the clang lit config? Or if not that, config.host_cxx_version = CMAKE_CXX_COMPILER_VERSION |
You can probably just define host_cxx, and then use getattr in the function to check for it.
Heh, we crossed paths. Yea that seems reasonable. Can you emit a warning if any of the following are true though?
- llvm_use_sanitizer is true, but host_cxx doesn't look like a clang compiler.
- 'self.get_clang_has_lsan` is called, but host_cxx is not present.
I'll upload the clang host_cxx patch shortly, but this shouldn't be blocked on that (since it handles the undefined case).
utils/lit/lit/llvm/config.py | ||
---|---|---|
207 ↗ | (On Diff #118404) | Can you improve this warning to say why it's needed? Something like "config.host_cxx is unset but test suite is configured to use sanitizers. |
213–214 ↗ | (On Diff #118404) | Same here. compiler '%s' does not appear to be clang, but test suite is configured to use sanitizers. |
@qcolombet - Can you keep an eye on the internal apple builders and let me know if this doesn't fix them? I'll be out of the town the rest of the week though, so I probably won't be able to do much until Monday.