timespec_get() and TIME_UTC are C11 and only reached macOS in 10.15, so qemu 11.1.0 fails on 10.14 and earlier. clock_gettime() has been available since 10.12 and TIME_UTC designates the realtime clock, so CLOCK_REALTIME is the direct equivalent. The guard tests MAC_OS_X_VERSION_MIN_REQUIRED so that building against a newer SDK while targeting 10.14 still takes the fallback. --- contrib/plugins/uftrace.c.orig +++ contrib/plugins/uftrace.c @@ -144,7 +144,14 @@ #else /* We need nanosecond precision for short lived functions. */ struct timespec ts; + /* timespec_get() is C11 and only reached macOS in 10.15; older SDKs + * provide clock_gettime(), for which TIME_UTC's clock is CLOCK_REALTIME. */ +#if defined(__APPLE__) && (!defined(MAC_OS_X_VERSION_10_15) || \ + MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15) + clock_gettime(CLOCK_REALTIME, &ts); +#else timespec_get(&ts, TIME_UTC); +#endif uint64_t now_ns = ts.tv_sec * NANOSECONDS_PER_SECOND + ts.tv_nsec; #endif return now_ns;