path: root/builtin/rm.c
diff options
authorRonald Wampler <>2016-07-07 20:45:54 (GMT)
committerJunio C Hamano <>2016-07-07 21:15:08 (GMT)
commitd19e3a5b21f28c07886801616e02e08eab64a7d8 (patch)
treef3ad8e4dbce119ebe2a4bbde60b041a44177f0b6 /builtin/rm.c
parent0b65a8dbdb38962e700ee16776a3042beb489060 (diff)
Makefile: add NEEDS_LIBRT to optionally link with librt
We unconditionally link with librt, when HAVE_CLOCK_GETTIME is defined. But clock_gettime() has been available in most libc implementations for some time now (e.g., for glibc since version 2.17) and no longer requires linking with librt. Furthermore, commit a6c3c63 ( check for clock_gettime() and CLOCK_MONOTONIC) will automatically determined which library (libc or librt) is required for linking when checking for clock_gettime(). The assumption to unconditionally link with librt was OK, since either almost every Unix-like system provides a version of librt for backwards compatibility or other systems, namely Windows or OS X, never provided clock_gettime(). However, in the latest release of OS X (macOS Sierra), this function has been added to OS X libc version. As a result, when running the configuration script, HAVE_CLOCK_GETTIME is set and since librt is not present, it causes a linker error. This patches requires those not building via the configuration scripts to define NEEDS_LIBRT in addition to HAVE_CLOCK_GETTIME, if needed. Signed-off-by: Ronald Wampler <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/rm.c')
0 files changed, 0 insertions, 0 deletions