Bug 1451529 - Install shared libs in the Tup backend. r=mshal
authorChris Manchester <cmanchester@mozilla.com>
Wed, 04 Apr 2018 15:28:39 -0700
changeset 468500 1903ca3d1be1cf0f7c8263f92dfa14a0f5fa77c1
parent 468499 408c28463666f15ea0cf340460d31c07c6f7db77
child 468501 1e4c7821c157899ffc45055c457d31db36c255de
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1451529
milestone61.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 1451529 - Install shared libs in the Tup backend. r=mshal MozReview-Commit-ID: Jn9Uk5XmFxJ
python/mozbuild/mozbuild/backend/tup.py
--- a/python/mozbuild/mozbuild/backend/tup.py
+++ b/python/mozbuild/mozbuild/backend/tup.py
@@ -235,72 +235,78 @@ class TupOnly(CommonBackend, PartialBack
         ]
         return cmd
 
     def _lib_paths(self, objdir, libs):
         return [mozpath.relpath(mozpath.join(l.objdir, l.import_name), objdir)
                 for l in libs]
 
     def _gen_shared_library(self, backend_file):
-        if backend_file.shared_lib.name == 'libxul.so':
+        shlib = backend_file.shared_lib
+        if shlib.name == 'libxul.so':
             # This will fail to link currently due to missing rust symbols.
             return
 
-        if backend_file.shared_lib.cxx_link:
+        if shlib.cxx_link:
             mkshlib = (
                 [backend_file.environment.substs['CXX']] +
                 backend_file.local_flags['CXX_LDFLAGS']
             )
         else:
             mkshlib = (
                 [backend_file.environment.substs['CC']] +
                 backend_file.local_flags['C_LDFLAGS']
             )
 
         mkshlib += (
             backend_file.environment.substs['DSO_PIC_CFLAGS'] +
             [backend_file.environment.substs['DSO_LDOPTS']] +
-            ['-Wl,-h,%s' % backend_file.shared_lib.soname] +
-            ['-o', backend_file.shared_lib.lib_name]
+            ['-Wl,-h,%s' % shlib.soname] +
+            ['-o', shlib.lib_name]
         )
 
-        objs, _, shared_libs, os_libs, static_libs = self._expand_libs(backend_file.shared_lib)
+        objs, _, shared_libs, os_libs, static_libs = self._expand_libs(shlib)
         static_libs = self._lib_paths(backend_file.objdir, static_libs)
         shared_libs = self._lib_paths(backend_file.objdir, shared_libs)
 
-        list_file_name = '%s.list' % backend_file.shared_lib.name.replace('.', '_')
+        list_file_name = '%s.list' % shlib.name.replace('.', '_')
         list_file = self._make_list_file(backend_file.objdir, objs, list_file_name)
 
         inputs = objs + static_libs + shared_libs
         if any(i.endswith('libxul.so') for i in inputs):
             # Don't attempt to link anything that depends on libxul.
             return
 
         symbols_file = []
-        if backend_file.shared_lib.symbols_file:
-            inputs.append(backend_file.shared_lib.symbols_file)
+        if shlib.symbols_file:
+            inputs.append(shlib.symbols_file)
             # TODO: Assumes GNU LD
-            symbols_file = ['-Wl,--version-script,%s' % backend_file.shared_lib.symbols_file]
+            symbols_file = ['-Wl,--version-script,%s' % shlib.symbols_file]
 
         cmd = (
             mkshlib +
             [list_file] +
             backend_file.local_flags['LDFLAGS'] +
             static_libs +
             shared_libs +
             symbols_file +
             [backend_file.environment.substs['OS_LIBS']] +
             os_libs
         )
         backend_file.rule(
             cmd=cmd,
             inputs=inputs,
-            outputs=[backend_file.shared_lib.lib_name],
+            outputs=[shlib.lib_name],
             display='LINK %o'
         )
+        backend_file.symlink_rule(mozpath.join(backend_file.objdir,
+                                               shlib.lib_name),
+                                  output=mozpath.join(self.environment.topobjdir,
+                                                      shlib.install_target,
+                                                      shlib.lib_name))
 
 
     def _gen_program(self, backend_file):
         cc_or_cxx = 'CXX' if backend_file.program.cxx_link else 'CC'
         objs, _, shared_libs, os_libs, static_libs = self._expand_libs(backend_file.program)
         static_libs = self._lib_paths(backend_file.objdir, static_libs)
         shared_libs = self._lib_paths(backend_file.objdir, shared_libs)