Skip to content

Commit

Permalink
build: remove linking librt for backwards compatibility
Browse files Browse the repository at this point in the history
Now that we require glibc 2.17+, #17538, we can remove linking in librt
for backwards compatibility purposes. The clock_* functions from librt
were merged into glibc as part of the 2.17 release.

* The `clock_*' suite of functions (declared in <time.h>) is now available
  directly in the main C library.  Previously it was necessary to link with
  -lrt to use these functions.  This change has the effect that a
  single-threaded program that uses a function such as `clock_gettime' (and
  is not linked with -lrt) will no longer implicitly load the pthreads
  library at runtime and so will not suffer the overheads associated with
  multi-thread support in other code such as the C++ runtime library.

https://sourceware.org/ml/libc-announce/2012/msg00001.html

Note that librt is already not linked by the RISC-V and AARCH64 binaries.
  • Loading branch information
fanquake committed Dec 31, 2019
1 parent 35fff5b commit f7453dc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
3 changes: 0 additions & 3 deletions build_msvc/bitcoin_config.h
Expand Up @@ -218,9 +218,6 @@
/* Define to 1 if you have the `rpcrt4' library (-lrpcrt4). */
#define HAVE_LIBRPCRT4 1

/* Define to 1 if you have the `rt' library (-lrt). */
/* #undef HAVE_LIBRT */

/* Define to 1 if you have the `shell32' library (-lshell32). */
#define HAVE_LIBSHELL32 1

Expand Down
4 changes: 0 additions & 4 deletions configure.ac
Expand Up @@ -693,10 +693,6 @@ AX_GCC_FUNC_ATTRIBUTE([dllimport])

if test x$use_glibc_compat != xno; then

dnl glibc absorbed clock_gettime in 2.17. librt (its previous location) is safe to link
dnl in anyway for back-compat.
AC_CHECK_LIB([rt],[clock_gettime],, AC_MSG_ERROR(librt missing))

dnl __fdelt_chk's params and return type have changed from long unsigned int to long int.
dnl See which one is present here.
AC_MSG_CHECKING(__fdelt_chk type)
Expand Down

0 comments on commit f7453dc

Please sign in to comment.