[Lldb-commits] [lldb] [lldb] Avoid copying header just to overwrite it (PR #160555)
Justin Cady via lldb-commits
lldb-commits at lists.llvm.org
Wed Sep 24 09:51:42 PDT 2025
https://github.com/justincady created https://github.com/llvm/llvm-project/pull/160555
The build script copies lldb-defines.h into the staging area but it gets
overwritten by version-header-fix.py. This flow assumes that the
lldb-defines.h from the source was writable originally (thus the copy
maintains that permission). This is problematic for systems that
integrate LLVM source as read only.
This change skips the initial copy of lldb-defines.h, which prevents
lldb build failures when the source is not writable.
>From d1ba166b80393567663c31ec94379d41b39efc06 Mon Sep 17 00:00:00 2001
From: Justin Cady <desk at justincady.com>
Date: Wed, 24 Sep 2025 12:42:34 -0400
Subject: [PATCH] [lldb] Avoid copying header just to overwrite it
The build script copies lldb-defines.h into the staging area but it gets
overwritten by version-header-fix.py. This flow assumes that the
lldb-defines.h from the source was writable originally (thus the copy
maintains that permission). This is problematic for systems that
integrate LLVM source as read only.
This change skips the initial copy of lldb-defines.h, which prevents
lldb build failures when the source is not writable.
---
lldb/source/API/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index fdd6b3b077463..ce59ee505cd3d 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -299,6 +299,8 @@ set(generated_public_headers ${LLDB_OBJ_DIR}/include/lldb/API/SBLanguages.h)
file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h)
list(REMOVE_ITEM root_public_headers ${root_private_headers})
+# Skip the initial copy of lldb-defines.h. The fixed version is generated at build time.
+list(REMOVE_ITEM root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-defines.h)
find_program(unifdef_EXECUTABLE unifdef)
More information about the lldb-commits
mailing list