File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 9
9
10
10
import argparse
11
11
import os
12
+ import platform
12
13
import shutil
13
14
import subprocess
14
15
import sys
19
20
parser .add_argument ("objfile" , help = "Object file to extract symbol values from" )
20
21
parser .add_argument ("output" )
21
22
parser .add_argument ("prefix" , nargs = "?" , default = "FDATA" , help = "Custom FDATA prefix" )
22
- parser .add_argument ("--nmtool" , default = "nm" , help = "Path to nm tool" )
23
+ parser .add_argument (
24
+ "--nmtool" ,
25
+ default = "llvm-nm" if platform .system () == "Windows" else "nm" ,
26
+ help = "Path to nm tool" ,
27
+ )
23
28
parser .add_argument ("--no-lbr" , action = "store_true" )
24
29
parser .add_argument ("--no-redefine" , action = "store_true" )
25
30
86
91
exit ("ERROR: unexpected input:\n %s" % line )
87
92
88
93
# Read nm output: <symbol value> <symbol type> <symbol name>
89
- is_llvm_nm = os .path .basename (os .path .realpath (shutil .which (args .nmtool ))) == "llvm-nm"
94
+ # Ignore .exe on Windows host.
95
+ is_llvm_nm = os .path .basename (os .path .realpath (shutil .which (args .nmtool ))).startswith (
96
+ "llvm-nm"
97
+ )
90
98
nm_output = subprocess .run (
91
99
[
92
100
args .nmtool ,
You can’t perform that action at this time.
0 commit comments