This is an archive of the discontinued LLVM Phabricator instance.

[CMake][ASan][HWASan] Set an explicit dependency on libc++ headers
ClosedPublic

Authored by phosek on Nov 6 2018, 11:48 PM.

Details

Summary

We have seen failing builds due to a race condition between
RTAsan_dynamic and libc++ headers builds, specifically libc++
headers depend on __config and if this header hasn't been copied
into the final location, including other headers will typically
result in failure. To avoid this race, we add an explicit dependency
on libc++ headers which ensures that they've been copied into place
before the sanitizer object library build starts.

Diff Detail

Event Timeline

phosek created this revision.Nov 6 2018, 11:48 PM
This comment was removed by phosek.

Here's an example of one such failure: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket.appspot.com/8931024528216969696/+/steps/clang/0/steps/build/0/stdout

This is not a particularly pretty solution, but we already use it for XRay and Fuzzer. I'll try to think of a better way to handle this, but in the meantime this should avoid the build failures we've been seeing increasingly more often, especially on macOS.

This revision is now accepted and ready to land.Nov 7 2018, 9:26 AM
This revision was automatically updated to reflect the committed changes.