[Bug libstdc++/93325] libstdc++ wrongly uses direct clock_gettime syscall on non-glibc, breaks time64

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 26 15:43:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93325

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:08a70a65670ee801d4190ec122d42aa4a9a997a9

commit r9-8286-g08a70a65670ee801d4190ec122d42aa4a9a997a9
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Feb 26 15:32:34 2020 +0000

    libstdc++: Replace glibc-specific check for clock_gettime (PR 93325)

    It's wrong to assume that clock_gettime is unavailable on any *-*-linux*
    target that doesn't have glibc 2.17 or later. Use a generic test instead
    of using __GLIBC_PREREQ. Only do that test when is_hosted=yes so that we
    don't get an error for cross targets without a working linker.

    This ensures that C library's clock_gettime will be used on non-glibc
    targets, instead of an incorrect syscall to SYS_clock_gettime.

    Backport from mainline
    2020-01-28  Jonathan Wakely  <jwakely@redhat.com>

        PR libstdc++/93325
        * acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Use AC_SEARCH_LIBS for
        clock_gettime instead of explicit glibc version check.
        * configure: Regenerate.


More information about the Gcc-bugs mailing list