Bug 1516228 - Use llvm-objdump for mac in dependentlibs.py, too. r=firefox-build-system-reviewers,mshal
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 24 Jan 2019 15:54:05 +0000
changeset 515357 4f53ede3351741395c132fbbcfb03a06926b7113
parent 515356 2e6bec87c9f38d8621c9fbf5b2099df2c6558ddb
child 515358 53d93ee3ad847b03120d3159e2b8b2caace7a370
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfirefox-build-system-reviewers, mshal
bugs1516228
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1516228 - Use llvm-objdump for mac in dependentlibs.py, too. r=firefox-build-system-reviewers,mshal Depends on D17464 Differential Revision: https://phabricator.services.mozilla.com/D17465
toolkit/library/dependentlibs.py
--- a/toolkit/library/dependentlibs.py
+++ b/toolkit/library/dependentlibs.py
@@ -46,23 +46,24 @@ def dependentlibs_readelf(lib):
             # or with BSD readelf:
             # 0x00000001 NEEDED               Shared library: [libname]
             match = re.search('\[(.*)\]', tmp[3])
             if match:
                 deps.append(match.group(1))
     proc.wait()
     return deps
 
-def dependentlibs_otool(lib):
+def dependentlibs_mac_objdump(lib):
     '''Returns the list of dependencies declared in the given MACH-O dylib'''
-    proc = subprocess.Popen([substs['OTOOL'], '-l', lib], stdout = subprocess.PIPE)
-    deps= []
+    proc = subprocess.Popen([substs['LLVM_OBJDUMP'], '--private-headers', lib], stdout = subprocess.PIPE)
+    deps = []
     cmd = None
     for line in proc.stdout:
-        # otool -l output contains many different things. The interesting data
+        # llvm-objdump --private-headers output contains many different
+        # things. The interesting data
         # is under "Load command n" sections, with the content:
         #           cmd LC_LOAD_DYLIB
         #       cmdsize 56
         #          name libname (offset 24)
         tmp = line.split()
         if len(tmp) < 2:
             continue
         if tmp[0] == 'cmd':
@@ -95,17 +96,17 @@ def dependentlibs(lib, libpaths, func):
     return deps
 
 def gen_list(output, lib):
     libpaths = [os.path.join(substs['DIST'], 'bin')]
     binary_type = get_type(lib)
     if binary_type == ELF:
         func = dependentlibs_readelf
     elif binary_type == MACHO:
-        func = dependentlibs_otool
+        func = dependentlibs_mac_objdump
     else:
         ext = os.path.splitext(lib)[1]
         assert(ext == '.dll')
         func = dependentlibs_win32_objdump
 
     deps = dependentlibs(lib, libpaths, func)
     base_lib = mozpath.basename(lib)
     deps[base_lib] = mozpath.join(libpaths[0], base_lib)