Bug 1471293 - Support using llvm-objdump in dependentlibs.py r=glandium

MozReview-Commit-ID: 8b0o06EQh3n

--HG--
extra : rebase_source : e5a3296723d6a64db38427d4b30fb820d0516abd
This commit is contained in:
Jacek Caban 2018-06-26 15:15:19 +02:00
parent 4e1a98da16
commit 29adb6362f

View File

@ -41,10 +41,14 @@ def dependentlibs_dumpbin(lib):
return deps
def dependentlibs_mingw_objdump(lib):
proc = subprocess.Popen(['objdump', '-x', lib], stdout = subprocess.PIPE)
try:
proc = subprocess.Popen(['objdump', '-x', lib], stdout = subprocess.PIPE)
except OSError:
# objdump is missing, try using llvm-objdump.
proc = subprocess.Popen(['llvm-objdump', '-private-headers', lib], stdout = subprocess.PIPE)
deps = []
for line in proc.stdout:
match = re.match('\tDLL Name: (\S+)', line)
match = re.match('\s+DLL Name: (\S+)', line)
if match:
deps.append(match.group(1))
proc.wait()