Skip to content

Commit 2dca9e8

Browse files
authored
[BOLT][test] Resolve symlink for nm tool (NFC) (#136722)
Handle the case where nm could be a symlink to llvm-nm.
1 parent 80872d7 commit 2dca9e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bolt/test/link_fdata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import argparse
1111
import os
12+
import shutil
1213
import subprocess
1314
import sys
1415
import re
@@ -85,7 +86,7 @@
8586
exit("ERROR: unexpected input:\n%s" % line)
8687

8788
# Read nm output: <symbol value> <symbol type> <symbol name>
88-
is_llvm_nm = os.path.basename(args.nmtool) == "llvm-nm"
89+
is_llvm_nm = os.path.basename(os.path.realpath(shutil.which(args.nmtool))) == "llvm-nm"
8990
nm_output = subprocess.run(
9091
[
9192
args.nmtool,

0 commit comments

Comments
 (0)