[llvm] [cmake] Fix overlapping native llvm-min-tblgen builds (PR #121021)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 23 18:19:04 PST 2024


https://github.com/arthurqiu created https://github.com/llvm/llvm-project/pull/121021

During sub-invocation of the native llvm-config build, llvm-min-tblgen is also built. If there is another sub-invocation of the native llvm-min-tblgen build running in parallel, they may overwrite each other's build results, and may lead to errors like "Text file busy". This patch adds tablegen dependency to the native llvm-config build to avoid this overlapping issue.

>From 67ae3344ff80708a299375f909b87b447650178a Mon Sep 17 00:00:00 2001
From: Arthurq Qiu <arthurq at nvidia.com>
Date: Mon, 23 Dec 2024 18:09:31 -0800
Subject: [PATCH] fix parallel build of native llvm-min-tblgen

---
 llvm/tools/llvm-config/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/tools/llvm-config/CMakeLists.txt b/llvm/tools/llvm-config/CMakeLists.txt
index 02c2532dba77a7..f233b574297da0 100644
--- a/llvm/tools/llvm-config/CMakeLists.txt
+++ b/llvm/tools/llvm-config/CMakeLists.txt
@@ -101,7 +101,7 @@ if(CMAKE_CROSSCOMPILING)
   endif()
 
   if (NOT LLVM_CONFIG_PATH)
-    build_native_tool(llvm-config LLVM_CONFIG_PATH)
+    build_native_tool(llvm-config LLVM_CONFIG_PATH DEPENDS ${LLVM_TABLEGEN_TARGET} ${LLVM_TABLEGEN_EXE})
     set(LLVM_CONFIG_PATH "${LLVM_CONFIG_PATH}" CACHE STRING "")
 
     add_custom_target(NativeLLVMConfig DEPENDS ${LLVM_CONFIG_PATH})



More information about the llvm-commits mailing list