[all-commits] [llvm/llvm-project] 084ab1: [cmake] Add pthread to required libraries before d...

Reid Kleckner via All-commits all-commits at lists.llvm.org
Wed Jun 10 13:03:56 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 084ab17b3c602f8e34ea471a4cc7297d1e8f05dd
      https://github.com/llvm/llvm-project/commit/084ab17b3c602f8e34ea471a4cc7297d1e8f05dd
  Author: Reid Kleckner <rkleckner at nvidia.com>
  Date:   2026-06-10 (Wed, 10 Jun 2026)

  Changed paths:
    M llvm/cmake/config-ix.cmake

  Log Message:
  -----------
  [cmake] Add pthread to required libraries before dl and rt checks (#203054)

This fixes detection of shm_open on glibc < 2.34.

On glibc before 2.34 (released 2021), librt may depend on symbols from
libpthread. LLVM's HAVE_LIBRT probe uses check_library_exists(rt
shm_open ...), which links a small test against librt and
CMAKE_REQUIRED_LIBRARIES. If pthread is not included in the test link,
the probe can fail even though shm_open is available and LLVM targets
later link with pthread.

Move the dl and rt library checks after pthread detection and add the
detected pthread library to CMAKE_REQUIRED_LIBRARIES. This also lets us
remove later logic that temporarily made pthread a required library for
pthread symbol checks.

Modern C libraries (glibc 2.34+ and musl) integrate pthread-related
functionality into libc, so there is little practical benefit to
avoiding a libpthread dependency on pre-2021 glibc versions when
LLVM_ENABLE_THREADS is disabled.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list