[llvm] 437040f - [CMake] Use shm_open, not clock_gettime, to detect librt (#120727)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 15:17:48 PST 2025


Author: Raphael Kubo da Costa
Date: 2025-01-28T15:17:45-08:00
New Revision: 437040fe3df48eeb8584c25b45f0058e8fbac098

URL: https://github.com/llvm/llvm-project/commit/437040fe3df48eeb8584c25b45f0058e8fbac098
DIFF: https://github.com/llvm/llvm-project/commit/437040fe3df48eeb8584c25b45f0058e8fbac098.diff

LOG: [CMake] Use shm_open, not clock_gettime, to detect librt (#120727)

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.

Co-authored-by: Raphael Kubo da Costa <kubo at igalia.com>

Added: 
    

Modified: 
    llvm/cmake/config-ix.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index e906bdd9eac6eb..767774812ade54 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -146,7 +146,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.


        


More information about the llvm-commits mailing list