[Lldb-commits] [lldb] [lldb][test] Use `xcrun -f strip` for API tests on Darwin (PR #111842)

Vladislav Dzhidzhoev via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 10 07:31:28 PDT 2024


https://github.com/dzhidzhoev created https://github.com/llvm/llvm-project/pull/111842

A follow-up for https://github.com/llvm/llvm-project/pull/111816.

This is to fix buildbot failure https://lab.llvm.org/staging/#/builders/195/builds/4242.

TestSymbolFileJSON.py doesn't pass with llvm-strip on macOS. Apparently, llvm-strip/llvm-objcopy can't clean symbols from Mach-O nlists.

>From 39e32d0ef3ee3ebd292a007928b66fbff89cceb3 Mon Sep 17 00:00:00 2001
From: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
Date: Thu, 10 Oct 2024 16:09:16 +0200
Subject: [PATCH] [lldb][test] Use `xcrun -f strip` for API tests on Darwin

A follow-up for https://github.com/llvm/llvm-project/pull/111816.

This is to fix buildbot failure https://lab.llvm.org/staging/#/builders/195/builds/4242.

TestSymbolFileJSON.py doesn't pass with llvm-strip on macOS. Apparently,
llvm-strip/llvm-objcopy can't clean symbols from Mach-O nlists.
---
 lldb/packages/Python/lldbsuite/test/builders/builder.py | 4 ++++
 lldb/test/API/functionalities/json/symbol-file/Makefile | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index d399a5b228c131..de057324694486 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -10,6 +10,7 @@
 import lldbsuite.test.lldbutil as lldbutil
 from lldbsuite.test import configuration
 from lldbsuite.test_event import build_exception
+from lldbsuite.support import seven
 
 
 class Builder:
@@ -190,6 +191,9 @@ def getToolchainUtil(util_name):
                 if not util_paths["DWP"]:
                     del util_paths["DWP"]
 
+            if lldbplatformutil.platformIsDarwin():
+                util_paths["STRIP"] = seven.get_command_output("xcrun -f strip")
+
             for var, path in util_paths.items():
                 utils.append("%s=%s" % (var, path))
 
diff --git a/lldb/test/API/functionalities/json/symbol-file/Makefile b/lldb/test/API/functionalities/json/symbol-file/Makefile
index aff841c364299c..13bc164582eeee 100644
--- a/lldb/test/API/functionalities/json/symbol-file/Makefile
+++ b/lldb/test/API/functionalities/json/symbol-file/Makefile
@@ -3,6 +3,6 @@ C_SOURCES := main.c
 all: stripped.out
 
 stripped.out : a.out
-	strip a.out -o stripped.out
+	$(STRIP) a.out -o stripped.out
 
 include Makefile.rules



More information about the lldb-commits mailing list