[all-commits] [llvm/llvm-project] f78bb4: [libc++] Check _LIBCPP_USE_CLOCK_GETTIME before us...

Louis Dionne via All-commits all-commits at lists.llvm.org
Tue Oct 6 08:57:16 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f78bb4d84eee55c5d3bb1f3322c1e346e3388572
      https://github.com/llvm/llvm-project/commit/f78bb4d84eee55c5d3bb1f3322c1e346e3388572
  Author: Hafiz Abid Qadeer <abidh at codesourcery.com>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

  Changed paths:
    M libcxx/src/chrono.cpp

  Log Message:
  -----------
  [libc++] Check _LIBCPP_USE_CLOCK_GETTIME before using clock_gettime

The clock_gettime function is available when _POSIX_TIMERS is defined.
We check for this and set _LIBCPP_USE_CLOCK_GETTIME accordingly since
59b3102739c. But check for _LIBCPP_USE_CLOCK_GETTIME was removed in
babd3aefc91. As a result, code is now trying to use clock_gettime even
on platforms where it is not available and it is causing build failure
with newlib.

This patch restores the checks to fix this.

Differential Revision: https://reviews.llvm.org/D88825




More information about the All-commits mailing list