Skip to content

Commit b773da0

Browse files
[lldb][test] Use $(STRIP) instead of strip in API tests (Darwin-only change) (#111816)
This makes tests more portable. Make variables for LLVM utils are passed to `make` on Darwin as well. Co-authored-by: Vladimir Vereschaka <[email protected]>
1 parent 55d51dd commit b773da0

File tree

7 files changed

+30
-30
lines changed

7 files changed

+30
-30
lines changed

lldb/packages/Python/lldbsuite/test/builders/builder.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -169,31 +169,31 @@ def getToolchainUtil(util_name):
169169
if not os.getenv("LLVM_AR"):
170170
utils.extend(["LLVM_AR=%s" % getToolchainUtil("llvm-ar")])
171171

172-
if not lldbplatformutil.platformIsDarwin():
173-
if cc_type in ["clang", "cc", "gcc"]:
174-
util_paths = {}
175-
# Assembly a toolchain side tool cmd based on passed CC.
176-
for var, name in util_names.items():
177-
# Do not override explicity specified tool from the cmd line.
178-
if not os.getenv(var):
179-
util_paths[var] = getToolchainUtil("llvm-" + name)
180-
else:
181-
util_paths[var] = os.getenv(var)
182-
utils.extend(["AR=%s" % util_paths["ARCHIVER"]])
183-
184-
# Look for llvm-dwp or gnu dwp
185-
if not lldbutil.which(util_paths["DWP"]):
186-
util_paths["DWP"] = getToolchainUtil("llvm-dwp")
187-
if not lldbutil.which(util_paths["DWP"]):
188-
util_paths["DWP"] = lldbutil.which("llvm-dwp")
172+
if cc_type in ["clang", "cc", "gcc"]:
173+
util_paths = {}
174+
# Assembly a toolchain side tool cmd based on passed CC.
175+
for var, name in util_names.items():
176+
# Do not override explicity specified tool from the cmd line.
177+
if not os.getenv(var):
178+
util_paths[var] = getToolchainUtil("llvm-" + name)
179+
else:
180+
util_paths[var] = os.getenv(var)
181+
utils.extend(["AR=%s" % util_paths["ARCHIVER"]])
182+
183+
# Look for llvm-dwp or gnu dwp
184+
if not lldbutil.which(util_paths["DWP"]):
185+
util_paths["DWP"] = getToolchainUtil("llvm-dwp")
186+
if not lldbutil.which(util_paths["DWP"]):
187+
util_paths["DWP"] = lldbutil.which("llvm-dwp")
188+
if not util_paths["DWP"]:
189+
util_paths["DWP"] = lldbutil.which("dwp")
189190
if not util_paths["DWP"]:
190-
util_paths["DWP"] = lldbutil.which("dwp")
191-
if not util_paths["DWP"]:
192-
del util_paths["DWP"]
191+
del util_paths["DWP"]
193192

194-
for var, path in util_paths.items():
195-
utils.append("%s=%s" % (var, path))
196-
else:
193+
for var, path in util_paths.items():
194+
utils.append("%s=%s" % (var, path))
195+
196+
if lldbplatformutil.platformIsDarwin():
197197
utils.extend(["AR=%slibtool" % os.getenv("CROSS_COMPILE", "")])
198198

199199
return [

lldb/test/API/lang/objc/hidden-ivars/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ endif
1414

1515
stripped: a.out libInternalDefiner.dylib
1616
mkdir stripped
17-
strip -Sx a.out -o stripped/a.out
18-
strip -Sx libInternalDefiner.dylib -o stripped/libInternalDefiner.dylib
17+
$(STRIP) -Sx a.out -o stripped/a.out
18+
$(STRIP) -Sx libInternalDefiner.dylib -o stripped/libInternalDefiner.dylib
1919
ifneq "$(CODESIGN)" ""
2020
$(CODESIGN) -fs - stripped/a.out
2121
endif

lldb/test/API/lang/objc/objc-ivar-stripped/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ all: a.out.stripped
66
include Makefile.rules
77

88
a.out.stripped: a.out.dSYM
9-
strip -o a.out.stripped a.out
9+
$(STRIP) -o a.out.stripped a.out
1010
ifneq "$(CODESIGN)" ""
1111
$(CODESIGN) -fs - a.out.stripped
1212
endif

lldb/test/API/lang/objc/objc-static-method-stripped/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LD_EXTRAS := -lobjc -framework Foundation
44
default: a.out.stripped
55

66
a.out.stripped: a.out.dSYM
7-
strip -o a.out.stripped a.out
7+
$(STRIP) -o a.out.stripped a.out
88
ln -sf a.out.dSYM a.out.stripped.dSYM
99

1010
include Makefile.rules

lldb/test/API/macosx/add-dsym/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ hide.app/Contents/a.out.dSYM:
88
mkdir hide.app
99
mkdir hide.app/Contents
1010
mv a.out.dSYM hide.app/Contents
11-
strip -x a.out
11+
$(STRIP) -x a.out
1212
ifneq "$(CODESIGN)" ""
1313
$(CODESIGN) -fs - a.out
1414
endif

lldb/test/API/tools/lldb-dap/module/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include Makefile.rules
1010
all: a.out.stripped
1111

1212
a.out.stripped:
13-
strip -o a.out.stripped a.out
13+
$(STRIP) -o a.out.stripped a.out
1414

1515
ifneq "$(CODESIGN)" ""
1616
$(CODESIGN) -fs - a.out.stripped

lldb/test/API/tools/lldb-dap/terminated-event/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include Makefile.rules
1010
all: a.out.stripped
1111

1212
a.out.stripped:
13-
strip -o a.out.stripped a.out
13+
$(STRIP) -o a.out.stripped a.out
1414

1515
ifneq "$(CODESIGN)" ""
1616
$(CODESIGN) -fs - a.out.stripped

0 commit comments

Comments
 (0)