This applies the learnings from [1]. What I intended as a simple
cleanup made me realize that the compiler-rt version checks have two
separate issues:
- In some places (e.g., mmap flag setting) what matters is the kernel version, not the OS version.
- OS version checks are implemented by querying the kernel version. This is not necessarily correct inside the simulators if the simulator runtime isn't aligned the host macOS.
This commit tackles 1) by adopting a separate query function for the
Darwin kernel version. 2) (and cleanups) will be dealt with in
follow-ups.
[1] https://reviews.llvm.org/D78942
rdar://63031937
Suggestion. You could instead implement operator> and then implement operator>= as