This is an archive of the discontinued LLVM Phabricator instance.

[Darwin][compiler-rt] kern.osproductversion unavailable pre macOS 10.13
ClosedPublic

Authored by yln on Jul 29 2020, 2:57 PM.

Details

Summary

Add a fallback for sysctl kern.osproductversion for XNU 17 (macOS
10.13) and below, which do not provide this property.

Unfortunately, this means we have to take the detour via Darwin kernel
version again (at least for the fallback).

Diff Detail

Event Timeline

yln created this revision.Jul 29 2020, 2:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 29 2020, 2:57 PM
Herald added subscribers: Restricted Project, dberris. · View Herald Transcript
yln requested review of this revision.Jul 29 2020, 2:57 PM
yln updated this revision to Diff 281747.Jul 29 2020, 3:09 PM

Fix linter warning.

delcypher accepted this revision.Jul 29 2020, 3:32 PM

LGTM

compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
635

If for some reason in the future we need the minor OS version too then we could use the kern.osversion sysctl. Right now we don't need it for those older OSs AFAIK so let's go with your approach.

This revision is now accepted and ready to land.Jul 29 2020, 3:32 PM
This revision was landed with ongoing or failed builds.Jul 29 2020, 5:22 PM
This revision was automatically updated to reflect the committed changes.