https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93325
Bug ID: 93325 Summary: libstdc++ wrongly uses direct clock_gettime syscall on non-glibc, breaks time64 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: bugdal at aerifal dot cx Target Milestone: --- The configure logic for libstdc++ is choosing to make direct clock_gettime syscalls (via syscall()) rather than using the clock_gettime function except on glibc 2.17 or later (when it was moved from librt to libc). This is incompatible with time64 (because struct timespec mismatches the form the old clock_gettime syscall uses) and also undesirable because it can't take advantage of vdso. The hard-coded glibc version dependency is a configure anti-pattern and should be removed; the right way to test this would be just probing for the clock_gettime function without adding any libs (like -lrt).