From 199a2f20a1ff5930b1b71103c2cec236101e5c9a Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Fri, 20 Dec 2024 13:44:12 +0100 Subject: [PATCH] [CMake] Use shm_open, not clock_gettime, to detect librt On systems with glibc, clock_gettime() was moved from librt to libc in version 2.17, in which case the current librt detection attempt would always fail. Look for shm_open instead, like other parts of the tree also do when looking for librt. --- llvm/cmake/config-ix.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake index 64878d28d9e1e..53cde952416c6 100644 --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -124,7 +124,7 @@ if( NOT PURE_WINDOWS ) endif() endif() check_library_exists(dl dlopen "" HAVE_LIBDL) - check_library_exists(rt clock_gettime "" HAVE_LIBRT) + check_library_exists(rt shm_open "" HAVE_LIBRT) endif() # Check for libpfm.