This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][test] Ensure CMAKE_SYSROOT is added as a test cflag if provided
ClosedPublic

Authored by leonardchan on Sep 14 2021, 5:02 PM.

Details

Summary

When running tests like SanitizerCommon-asan-x86_64-Linux :: Linux/crypt_r.cpp, it may attempt to use the host header crypt.h rather than a sysroot header. This is significant in the event where struct crypt_data defined on host is different from the sysroot used to make the sanitizer runtime libraries. This can result in logical differences between the expected size/layout of struct crypt_data known by sanitizers and the strict crypt_data provided by the host crypt.h.

Since tests should still use the CMAKE_SYSROOT, this ensures that CMAKE_SYSROOT is propagated to compiler-rt tests.

Diff Detail

Event Timeline

leonardchan created this revision.Sep 14 2021, 5:02 PM
leonardchan requested review of this revision.Sep 14 2021, 5:02 PM
phosek accepted this revision.Sep 14 2021, 11:08 PM

LGTM

This revision is now accepted and ready to land.Sep 14 2021, 11:08 PM