[llvm] [CAS] Fix AIX build (PR #159647)

Steven Wu via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 18 13:25:18 PDT 2025


https://github.com/cachemeifyoucan created https://github.com/llvm/llvm-project/pull/159647

Fix AIX build by linking `libbsd.a` to include implementation for `flock`.


>From e3e0623f4b14c24de8197509057d05b12f029fa3 Mon Sep 17 00:00:00 2001
From: Steven Wu <stevenwu at apple.com>
Date: Thu, 18 Sep 2025 13:25:08 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.6
---
 llvm/lib/CAS/CMakeLists.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/llvm/lib/CAS/CMakeLists.txt b/llvm/lib/CAS/CMakeLists.txt
index 6ed724bc2fd76..5ba73a301a103 100644
--- a/llvm/lib/CAS/CMakeLists.txt
+++ b/llvm/lib/CAS/CMakeLists.txt
@@ -1,3 +1,7 @@
+if (UNIX AND "${CMAKE_SYSTEM_NAME}" MATCHES "AIX")
+  set(additional_libs bsd)
+endif()
+
 add_llvm_component_library(LLVMCAS
   ActionCache.cpp
   ActionCaches.cpp
@@ -10,6 +14,9 @@ add_llvm_component_library(LLVMCAS
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/CAS
 
+  LINK_LIBS
+  ${additional_libs}
+
   LINK_COMPONENTS
   Support
 )



More information about the llvm-commits mailing list