Bug 1605215 - apply shared library naming conventions to wasm sandboxed libraries; r=firefox-build-system-reviewers,rstewart

Because that's what they really are under the hood.

Differential Revision: https://phabricator.services.mozilla.com/D57872

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nathan Froyd 2019-12-19 22:20:44 +00:00
parent eb3bb8c956
commit 6476df37aa
2 changed files with 15 additions and 3 deletions

View File

@ -679,6 +679,18 @@ class SandboxedWasmLibrary(Library):
def __init__(self, context, basename, real_name=None):
Library.__init__(self, context, basename, real_name)
# TODO: WASM sandboxed libraries are in a weird place: they are
# built in a different way, but they should share some code with
# SharedLibrary. This is the minimal configuration needed to work
# with Linux, but it would need to be extended for other platforms.
assert context.config.substs['OS_TARGET'] == 'Linux'
self.lib_name = '%s%s%s' % (
context.config.dll_prefix,
real_name or basename,
context.config.dll_suffix,
)
def _obj_suffix(self):
"""Can be overridden by a base class for custom behavior."""
return self.config.substs.get('WASM_OBJ_SUFFIX', '')

View File

@ -1338,8 +1338,8 @@ class TestEmitterBasic(unittest.TestCase):
linkable.objs)
def test_wasm_sources(self):
"""Test that HOST_SOURCES works properly."""
reader = self.reader('wasm-sources')
"""Test that WASM_SOURCES works properly."""
reader = self.reader('wasm-sources', extra_substs={'OS_TARGET': 'Linux'})
objs = list(self.read_topsrcdir(reader))
# The second to last object is a linkable.
@ -1718,7 +1718,7 @@ class TestEmitterBasic(unittest.TestCase):
self.read_topsrcdir(reader)
def test_wasm_compile_flags(self):
reader = self.reader('wasm-compile-flags')
reader = self.reader('wasm-compile-flags', extra_substs={'OS_TARGET': 'Linux'})
flags = list(self.read_topsrcdir(reader))[2]
self.assertIsInstance(flags, ComputedFlags)
self.assertEqual(flags.flags['WASM_CFLAGS'],