[Lldb-commits] [lldb] [lldb/test] Codesign executables built with custom Makefile rules (PR #189902)

via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 1 00:46:02 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Med Ismail Bennani (medismailben)

<details>
<summary>Changes</summary>

Tests with custom a.out targets (i.e. `TestBSDArchives.py`) in their Makefile bypass the standard Makefile.rules linking step where `CODESIGN` is applied. This leaves the binary unsigned, causing the process to get kill it on remote darwin devices.

This adds a codesigning step to the all target in Makefile.rules that signs both $(EXE) and a.out if they exist. This ensures all test binaries are signed regardless of how they were built.

rdar://173840592

---
Full diff: https://github.com/llvm/llvm-project/pull/189902.diff


1 Files Affected:

- (modified) lldb/packages/Python/lldbsuite/test/make/Makefile.rules (+7) 


``````````diff
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index f7f6e48f71e55..cff815d83305c 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -728,6 +728,13 @@ include $(wildcard $(PREREQS) $(DYLIB_PREREQS))
 .PHONY: clean
 dsym:	$(DSYM)
 all:	$(EXE) $(DSYM)
+ifneq "$(CODESIGN)" ""
+	@for bin in $(EXE) a.out; do \
+		if [ -n "$$bin" ] && [ -f "$$bin" ]; then \
+			$(CODESIGN) -s - "$$bin" 2>/dev/null || true; \
+		fi; \
+	done
+endif
 clean::
 ifeq "$(findstring lldb-test-build.noindex, $(BUILDDIR))" ""
 	$(error Trying to invoke the clean rule, but not using the default build tree layout)

``````````

</details>


https://github.com/llvm/llvm-project/pull/189902


More information about the lldb-commits mailing list