This is an archive of the discontinued LLVM Phabricator instance.

[TSan][libdispatch] Guard test execution on old platforms
ClosedPublic

Authored by yln on Aug 14 2020, 1:55 PM.

Details

Summary

dispatch_async_and_wait() was introduced in macOS 10.14. Let's
forward declare it to ensure we can compile the test with older SDKs and
guard execution by checking if the symbol is available. (We can't use
__builtin_available(), because that itself requires a higher minimum
deployment target.) We also need to specify the `-undefined
dynamic_lookup` compiler flag.

Diff Detail

Event Timeline

yln created this revision.Aug 14 2020, 1:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 14 2020, 1:55 PM
Herald added subscribers: Restricted Project, Charusso. · View Herald Transcript
yln requested review of this revision.Aug 14 2020, 1:55 PM
kubamracek accepted this revision.Aug 14 2020, 2:15 PM

This looks good to me. Note that I was actually suggesting to avoid the dynamic_lookup + forward declare and requiring that the *SDK* is at least 10.14 to run tests (which is separate from your OS version). But this way it's even more compatible, so I think we should go with it.

This revision is now accepted and ready to land.Aug 14 2020, 2:15 PM
This revision was automatically updated to reflect the committed changes.