Skip to content

Commit 6d92b2a

Browse files
committed
build(macos/other): librt is not needed
Since glibc >=2.17 (2012-12-25), librt is a stub-only library. (https://abi-laboratory.pro/?view=changelog&l=glibc&v=2.17) * 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. Current version on Arch Linux is 2.40. Signed-off-by: Ivan Prisyazhnyy <john.koepi@gmail.com>
1 parent 5db72da commit 6d92b2a

4 files changed

Lines changed: 4 additions & 14 deletions

File tree

SConstruct

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,6 @@ if not conf.CheckLib('pthread'):
462462
if not x86:
463463
conf.CheckLib('atomic')
464464

465-
if sysname != 'darwin':
466-
if not conf.CheckLib('rt'):
467-
print('Error: rt library not found')
468-
Exit(1)
469-
470465
if sysname == 'freebsd':
471466
if not conf.CheckLib('execinfo'):
472467
print('Error: execinfo library not found')
@@ -775,11 +770,6 @@ if not conf.CheckLib('m'):
775770
# potential check dependency, link if present
776771
conf.CheckLib('subunit')
777772

778-
if sysname != 'darwin':
779-
if not conf.CheckLib('rt'):
780-
print('Error: realtime library not found or not usable')
781-
Exit(1)
782-
783773
if not conf.CheckCXXHeader('boost/filesystem.hpp'):
784774
print('Error: boost/filesystem.hpp file not found or not usable')
785775
Exit(1)

cmake/os.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#
66

77
find_library(PTHREAD_LIB pthread)
8-
find_library(RT_LIB rt)
9-
set(GALERA_SYSTEM_LIBS ${PTHREAD_LIB} ${RT_LIB})
8+
9+
set(GALERA_SYSTEM_LIBS ${PTHREAD_LIB})
1010

1111
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
1212
# Check if linkage with atomic library is needed for 8 byte atomics

galerautils/tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ target_compile_options(deqmap_bench
102102
PRIVATE
103103
-Wno-conversion)
104104

105-
target_link_libraries(deqmap_bench galerautilsxx rt)
105+
target_link_libraries(deqmap_bench galerautilsxx)
106106

107107
#
108108
# CRC32C micro benchmark.

gcache/src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ target_link_libraries(gcache galerautilsxx)
3333

3434
add_executable(gcache_test test.cpp)
3535

36-
target_link_libraries(gcache_test gcache pthread rt)
36+
target_link_libraries(gcache_test gcache pthread)
3737

3838
target_compile_options(gcache_test
3939
PRIVATE

0 commit comments

Comments
 (0)