Skip to content

Commit f7453dc

Browse files
committed
build: remove linking librt for backwards compatibility
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.
1 parent 35fff5b commit f7453dc

File tree

2 files changed

+0
-7
lines changed

2 files changed

+0
-7
lines changed

build_msvc/bitcoin_config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,6 @@
218218
/* Define to 1 if you have the `rpcrt4' library (-lrpcrt4). */
219219
#define HAVE_LIBRPCRT4 1
220220

221-
/* Define to 1 if you have the `rt' library (-lrt). */
222-
/* #undef HAVE_LIBRT */
223-
224221
/* Define to 1 if you have the `shell32' library (-lshell32). */
225222
#define HAVE_LIBSHELL32 1
226223

configure.ac

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -693,10 +693,6 @@ AX_GCC_FUNC_ATTRIBUTE([dllimport])
693693

694694
if test x$use_glibc_compat != xno; then
695695

696-
dnl glibc absorbed clock_gettime in 2.17. librt (its previous location) is safe to link
697-
dnl in anyway for back-compat.
698-
AC_CHECK_LIB([rt],[clock_gettime],, AC_MSG_ERROR(librt missing))
699-
700696
dnl __fdelt_chk's params and return type have changed from long unsigned int to long int.
701697
dnl See which one is present here.
702698
AC_MSG_CHECKING(__fdelt_chk type)

0 commit comments

Comments
 (0)