bug 1446066 - Handle HOST_OS_LIBS properly when the host and target compilers are different types. r?build
MozReview-Commit-ID: 1zFwR9EEMev
--- 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)