Quoted from Linux Programmer's Manual (2017-09-15):
#include <time.h>
int clock_gettime(clockid_t clk_id, struct timespec *tp);
Link with -lrt (only for glibc versions before 2.17).
This patch adds additional checks for librt availability and append
target_link_libraries accordingly. librt is absent on macOS.
Fixed#139
GCC's default visibility is "public" but can be changed to
"hidden" with the argument "-fvisibility=hidden".
Tested with x86_64 / Ubuntu Linux 18.04 LTS:
[before]
$ nm -g -C libmimalloc.so | grep "T " | wc -l
142
[after]
$ nm -g -C libmimalloc.so | grep "T " | wc -l
93
This patch does not change the build on macOS.
In 2012, with the release of OS X 10.8 Mountain Lion, the name of the
system was shortened from Mac OS X to OS X. In 2016, with the release
of macOS 10.12 Sierra, the name was changed from OS X to macOS to
streamline it with the branding of Apple's other primary operating
systems: iOS, watchOS, and tvOS.
Reference: https://en.wikipedia.org/wiki/MacOS