Index: compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -2149,6 +2149,8 @@ namespace __sanitizer { extern "C" { int real_clock_gettime(u32 clk_id, void *tp) { + if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED) + return internal_clock_gettime(clk_id, tp); return REAL(clock_gettime)(clk_id, tp); } } // extern "C" Index: compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc +++ compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc @@ -782,15 +782,12 @@ // MonotonicNanoTime is a timing function that can leverage the vDSO by calling // clock_gettime. real_clock_gettime only exists if clock_gettime is -// intercepted, so define it weakly and use it if available. MonotonicNanoTime -// might also be called when interceptors are not yet initialized, so check for -// that as well. +// intercepted, so define it weakly and use it if available. extern "C" SANITIZER_WEAK_ATTRIBUTE int real_clock_gettime(u32 clk_id, void *tp); -namespace __interception { int (*real_clock_gettime)(u32 clk_id, void *tp); } u64 MonotonicNanoTime() { timespec ts; - if (CanUseVDSO() && __interception::real_clock_gettime) { + if (CanUseVDSO()) { if (&real_clock_gettime) real_clock_gettime(CLOCK_MONOTONIC, &ts); else