bug 1446066 - Handle HOST_OS_LIBS properly when the host and target compilers are different types. r?build draft
authorTed Mielczarek <ted@mielczarek.org>
Thu, 21 Sep 2017 11:16:34 -0400
changeset 768086 e9813c8bcfe04eab137b8c69da51753f4537960b
parent 768085 91f360d06ed670fe27332c32cb365504750d01e3
push id102803
push userbmo:ted@mielczarek.org
push dateThu, 15 Mar 2018 18:13:50 +0000
reviewersbuild
bugs1446066
milestone60.0a1
bug 1446066 - Handle HOST_OS_LIBS properly when the host and target compilers are different types. r?build MozReview-Commit-ID: 1zFwR9EEMev
python/mozbuild/mozbuild/frontend/data.py
--- a/python/mozbuild/mozbuild/frontend/data.py
+++ b/python/mozbuild/mozbuild/frontend/data.py
@@ -409,17 +409,18 @@ class Linkable(ContextDerived):
         if obj.cxx_link and not isinstance(obj, SharedLibrary):
             self.cxx_link = True
         obj.refs.append(self)
 
     def link_system_library(self, lib):
         # The '$' check is here as a special temporary rule, allowing the
         # inherited use of make variables, most notably in TK_LIBS.
         if not lib.startswith('$') and not lib.startswith('-'):
-            if self.config.substs.get('GNU_CC'):
+            compiler_type = self.config.substs.get('HOST_CC_TYPE') if self.KIND == 'host' else self.config.substs.get('CC_TYPE')
+            if compiler_type in ('gcc', 'clang'):
                 lib = '-l%s' % lib
             else:
                 lib = '%s%s%s' % (
                     self.config.import_prefix,
                     lib,
                     self.config.import_suffix,
                 )
         self.linked_system_libs.append(lib)