Skip to content

[lldb][test] Link test binaries with -random_uuid#199385

Open
kastiglione wants to merge 1 commit into
llvm:mainfrom
kastiglione:lldb-test-Link-test-binaries-with-random_uuid
Open

[lldb][test] Link test binaries with -random_uuid#199385
kastiglione wants to merge 1 commit into
llvm:mainfrom
kastiglione:lldb-test-Link-test-binaries-with-random_uuid

Conversation

@kastiglione
Copy link
Copy Markdown
Contributor

@kastiglione kastiglione commented May 23, 2026

While reviewing #197237, it occurred to me that -random_uuid could be an alternative solution to problem that was solved by adding a ".noindex" suffix to the lldb-test-build directory name.

@llvmorg-github-actions
Copy link
Copy Markdown

@llvm/pr-subscribers-lldb

Author: Dave Lee (kastiglione)

Changes

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

1 Files Affected:

  • (modified) lldb/packages/Python/lldbsuite/test/make/Makefile.rules (+4)
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 1ec9b420e3f36..44aa91ef7b6fc 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -209,6 +209,10 @@ ifeq "$(OS)" "Darwin"
 	DSFLAGS := $(DSFLAGS_EXTRAS)
 	DSYM = $(EXE).dSYM
 	ARFLAGS := -static -o
+	# The default UUID is a hash based on filename and __text section content.
+	# Use a random UUID so that LLDB and Spotlight never confuse two test
+	# binaries, where repeated test code can result in identical binaries.
+	LDFLAGS += -Wl,-random_uuid
 else
 	ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES"
 		DSYM = $(EXE).debug

@kastiglione kastiglione requested a review from adrian-prantl May 23, 2026 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant