summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authorsbc <sbc@chromium.org>2015-10-16 10:37:29 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-16 17:38:16 +0000
commit5afc24479ba6b45f12caaa1fb805930004db2596 (patch)
tree00d7e9bc1a59e13bded5f292b57c59a41f9d799b /native_client_sdk
parent00a64f18a8e513fce349820231e10786c2709828 (diff)
downloadchromium_src-5afc24479ba6b45f12caaa1fb805930004db2596.zip
chromium_src-5afc24479ba6b45f12caaa1fb805930004db2596.tar.gz
chromium_src-5afc24479ba6b45f12caaa1fb805930004db2596.tar.bz2
[NaCl SDK] Fix create_nmf to include arm/glibc ELF loader
Add tests for ARM glibc nmfs. CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:linux_nacl_sdk;tryserver.chromium.mac:mac_nacl_sdk;tryserver.chromium.win:win_nacl_sdk BUG=505885 Review URL: https://codereview.chromium.org/1398883004 Cr-Commit-Position: refs/heads/master@{#354536}
Diffstat (limited to 'native_client_sdk')
-rwxr-xr-xnative_client_sdk/src/test_all.py2
-rwxr-xr-xnative_client_sdk/src/tools/create_nmf.py19
-rw-r--r--native_client_sdk/src/tools/lib/get_shared_deps.py10
-rw-r--r--native_client_sdk/src/tools/lib/tests/data/test_dynamic_arm.nexebin0 -> 132512 bytes
-rwxr-xr-xnative_client_sdk/src/tools/tests/create_nmf_test.py218
5 files changed, 184 insertions, 65 deletions
diff --git a/native_client_sdk/src/test_all.py b/native_client_sdk/src/test_all.py
index 5062c40..88b549f 100755
--- a/native_client_sdk/src/test_all.py
+++ b/native_client_sdk/src/test_all.py
@@ -32,7 +32,7 @@ TAR_DIR = os.path.join(build_paths.NACL_DIR, 'toolchain', '.tars')
PKG_VER = os.path.join(PKG_VER_DIR, 'package_version.py')
-EXTRACT_PACKAGES = ['nacl_x86_glibc']
+EXTRACT_PACKAGES = ['nacl_x86_glibc', 'nacl_arm_glibc']
TOOLCHAIN_OUT = os.path.join(build_paths.OUT_DIR, 'sdk_tests', 'toolchain')
# List of modules containing unittests. The goal is to keep the total
diff --git a/native_client_sdk/src/tools/create_nmf.py b/native_client_sdk/src/tools/create_nmf.py
index eabcc12..fe4abb9 100755
--- a/native_client_sdk/src/tools/create_nmf.py
+++ b/native_client_sdk/src/tools/create_nmf.py
@@ -36,12 +36,11 @@ import quote
ARCH_LOCATION = {
'x86-32': 'lib32',
'x86-64': 'lib64',
- 'arm': 'lib',
+ 'arm': 'libarm',
}
# These constants are used within nmf files.
-RUNNABLE_LD = 'runnable-ld.so' # Name of the dynamic loader
MAIN_NEXE = 'main.nexe' # Name of entry point for execution
PROGRAM_KEY = 'program' # Key of the program section in an nmf file
URL_KEY = 'url' # Key of the url field for a particular file in an nmf file
@@ -142,6 +141,11 @@ class Error(Exception):
pass
+def IsLoader(filename):
+ return (filename.endswith(get_shared_deps.LOADER_X86) or
+ filename.endswith(get_shared_deps.LOADER_ARM))
+
+
class ArchFile(object):
"""Simple structure containing information about an architecture-specific
file.
@@ -295,7 +299,7 @@ class NmfUtils(object):
prefix = arch_to_main_dir[arch_file.arch]
url = os.path.basename(arch_file.path)
- if arch_file.name.endswith('.nexe'):
+ if arch_file.name.endswith('.nexe') and not IsLoader(arch_file.name):
prefix = posixpath.join(prefix, self.nexe_prefix)
elif self.no_arch_prefix:
prefix = posixpath.join(prefix, self.lib_prefix)
@@ -375,10 +379,10 @@ class NmfUtils(object):
manifest_items = needed.items() + extra_files_kv
- # Add in runnable-ld.so entries to the program section.
+ # Add dynamic loader to the program section.
for need, archinfo in manifest_items:
- urlinfo = { URL_KEY: archinfo.url }
- if need.endswith(RUNNABLE_LD):
+ if IsLoader(need):
+ urlinfo = { URL_KEY: archinfo.url }
manifest[PROGRAM_KEY][archinfo.arch] = urlinfo
for need, archinfo in manifest_items:
@@ -386,7 +390,7 @@ class NmfUtils(object):
name = archinfo.name
arch = archinfo.arch
- if need.endswith(RUNNABLE_LD):
+ if IsLoader(need):
continue
if need in self.main_files:
@@ -557,6 +561,7 @@ def GetDefaultLibPath(config):
]
libpath = [os.path.normpath(p) for p in libpath]
libpath = [os.path.join(sdk_root, p) for p in libpath]
+ libpath.append(os.path.join(sdk_root, 'tools'))
return libpath
diff --git a/native_client_sdk/src/tools/lib/get_shared_deps.py b/native_client_sdk/src/tools/lib/get_shared_deps.py
index ac5529a..5a3a658 100644
--- a/native_client_sdk/src/tools/lib/get_shared_deps.py
+++ b/native_client_sdk/src/tools/lib/get_shared_deps.py
@@ -27,7 +27,8 @@ SDK_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR))
NeededMatcher = re.compile('^ *NEEDED *([^ ]+)\n$')
FormatMatcher = re.compile('^(.+):\\s*file format (.+)\n$')
-RUNNABLE_LD = 'runnable-ld.so' # Name of the dynamic loader
+LOADER_X86 = 'runnable-ld.so' # Name of the dynamic loader
+LOADER_ARM = 'elf_loader_arm.nexe' # Name of the ARM dynamic loader
OBJDUMP_ARCH_MAP = {
# Names returned by Linux's objdump:
@@ -89,8 +90,11 @@ def _GetNeededDynamic(main_files, objdump, lib_path):
examined = set()
all_files, unexamined = GleanFromObjdump(main_files, None, objdump, lib_path)
for arch in all_files.itervalues():
- if unexamined and arch != 'arm':
- unexamined.add((RUNNABLE_LD, arch))
+ if unexamined:
+ if arch == 'arm':
+ unexamined.add((LOADER_ARM, arch))
+ else:
+ unexamined.add((LOADER_X86, arch))
while unexamined:
files_to_examine = {}
diff --git a/native_client_sdk/src/tools/lib/tests/data/test_dynamic_arm.nexe b/native_client_sdk/src/tools/lib/tests/data/test_dynamic_arm.nexe
new file mode 100644
index 0000000..b1d5738
--- /dev/null
+++ b/native_client_sdk/src/tools/lib/tests/data/test_dynamic_arm.nexe
Binary files differ
diff --git a/native_client_sdk/src/tools/tests/create_nmf_test.py b/native_client_sdk/src/tools/tests/create_nmf_test.py
index 03b802a..85dc020 100755
--- a/native_client_sdk/src/tools/tests/create_nmf_test.py
+++ b/native_client_sdk/src/tools/tests/create_nmf_test.py
@@ -29,9 +29,12 @@ import getos
from mock import patch, Mock
TOOLCHAIN_OUT = os.path.join(build_paths.OUT_DIR, 'sdk_tests', 'toolchain')
-NACL_X86_GLIBC_TOOLCHAIN = os.path.join(TOOLCHAIN_OUT,
- '%s_x86' % getos.GetPlatform(),
- 'nacl_x86_glibc')
+X86_GLIBC_TOOLCHAIN = os.path.join(TOOLCHAIN_OUT,
+ '%s_x86' % getos.GetPlatform(),
+ 'nacl_x86_glibc')
+ARM_GLIBC_TOOLCHAIN = os.path.join(TOOLCHAIN_OUT,
+ '%s_x86' % getos.GetPlatform(),
+ 'nacl_arm_glibc')
PosixRelPath = create_nmf.PosixRelPath
@@ -47,9 +50,10 @@ def StripSo(name):
libc.so.ad6acbfa => libc.so
foo.bar.baz => foo.bar.baz
"""
- stripped_name = '.'.join(name.split('.')[:-1])
- if stripped_name.endswith('.so'):
- return stripped_name
+ if '.' in name:
+ stripped_name, ext = name.rsplit('.', 1)
+ if stripped_name.endswith('.so') and len(ext) > 1:
+ return stripped_name
return name
@@ -103,12 +107,20 @@ class TestNmfUtils(unittest.TestCase):
def setUp(self):
self.tempdir = None
- self.toolchain = NACL_X86_GLIBC_TOOLCHAIN
- self.objdump = os.path.join(self.toolchain, 'bin', 'i686-nacl-objdump')
+ self.objdump = os.path.join(X86_GLIBC_TOOLCHAIN, 'bin', 'i686-nacl-objdump')
if os.name == 'nt':
self.objdump += '.exe'
self._Mktemp()
+ # Create dummy elf_loader_arm.nexe by duplicating an existing so.
+ # This nexe is normally build during SDK build but we want these tests
+ # to run standalone, and the contents of the ELF are not important for
+ # these tests.
+ arm_libdir = os.path.join(ARM_GLIBC_TOOLCHAIN, 'arm-nacl', 'lib')
+ shutil.copy(os.path.join(arm_libdir, 'ld-nacl-arm.so.1'),
+ os.path.join(arm_libdir, 'elf_loader_arm.nexe'))
+
+
def _CreateTestNexe(self, name, arch):
"""Create an empty test .nexe file for use in create_nmf tests.
@@ -116,7 +128,12 @@ class TestNmfUtils(unittest.TestCase):
checked in binaries depend on .so files that only exist in the
certain SDK that build them.
"""
- compiler = os.path.join(self.toolchain, 'bin', '%s-nacl-g++' % arch)
+ if arch == 'arm':
+ toolchain = ARM_GLIBC_TOOLCHAIN
+ else:
+ toolchain = X86_GLIBC_TOOLCHAIN
+
+ compiler = os.path.join(toolchain, 'bin', '%s-nacl-g++' % arch)
if os.name == 'nt':
compiler += '.exe'
os.environ['CYGWIN'] = 'nodosfilewarning'
@@ -141,10 +158,11 @@ class TestNmfUtils(unittest.TestCase):
def _CreateNmfUtils(self, nexes, **kwargs):
if not kwargs.get('lib_path'):
- # Use lib instead of lib64 (lib64 is a symlink to lib).
kwargs['lib_path'] = [
- os.path.join(self.toolchain, 'x86_64-nacl', 'lib'),
- os.path.join(self.toolchain, 'x86_64-nacl', 'lib32')]
+ # Use lib instead of lib64 (lib64 is a symlink to lib).
+ os.path.join(X86_GLIBC_TOOLCHAIN, 'x86_64-nacl', 'lib'),
+ os.path.join(X86_GLIBC_TOOLCHAIN, 'x86_64-nacl', 'lib32'),
+ os.path.join(ARM_GLIBC_TOOLCHAIN, 'arm-nacl', 'lib')]
return create_nmf.NmfUtils(nexes,
objdump=self.objdump,
**kwargs)
@@ -197,7 +215,7 @@ class TestNmfUtils(unittest.TestCase):
"""
arch_path = arch_path or {}
nexes = []
- for arch in ('x86_64', 'x86_32'):
+ for arch in ('x86_64', 'x86_32', 'arm'):
nexe_name = 'test_dynamic_%s.nexe' % arch
rel_nexe = os.path.join(arch_path.get(arch, ''), nexe_name)
arch_alt = 'i686' if arch == 'x86_32' else arch
@@ -285,7 +303,13 @@ class TestNmfUtils(unittest.TestCase):
new_d[new_k] = new_v
return new_d
- self.assertEqual(StripSoCopyDict(manifest), expected)
+ strip_manifest = StripSoCopyDict(manifest)
+ self.assertEqual(strip_manifest['program'], expected['program'])
+ if 'files' in strip_manifest:
+ for key in strip_manifest['files']:
+ self.assertEqual(strip_manifest['files'][key], expected['files'][key])
+
+ self.assertEqual(strip_manifest, expected)
def assertStagingEquals(self, expected):
"""Compare the contents of the temporary directory, to an expected
@@ -304,6 +328,7 @@ class TestNmfUtils(unittest.TestCase):
all_files.append(path)
self.assertEqual(set(expected), set(all_files))
+ arch_dir = {'x86_32': 'x86_32', 'x86_64': 'x86_64', 'arm': 'arm'}
def testStatic(self):
nmf, _ = self._CreateStatic()
@@ -318,8 +343,7 @@ class TestNmfUtils(unittest.TestCase):
self.assertManifestEquals(nmf, expected_manifest)
def testStaticWithPath(self):
- arch_dir = {'x86_32': 'x86_32', 'x86_64': 'x86_64', 'arm': 'arm'}
- nmf, _ = self._CreateStatic(arch_dir, nmf_root=self.tempdir)
+ nmf, _ = self._CreateStatic(self.arch_dir, nmf_root=self.tempdir)
expected_manifest = {
'files': {},
'program': {
@@ -335,8 +359,7 @@ class TestNmfUtils(unittest.TestCase):
# used to work. If there is no nmf_root given, all paths are relative to
# the first nexe passed on the commandline. I believe the assumption
# previously was that all .nexes would be in the same directory.
- arch_dir = {'x86_32': 'x86_32', 'x86_64': 'x86_64', 'arm': 'arm'}
- nmf, _ = self._CreateStatic(arch_dir)
+ nmf, _ = self._CreateStatic(self.arch_dir)
expected_manifest = {
'files': {},
'program': {
@@ -366,14 +389,25 @@ class TestNmfUtils(unittest.TestCase):
'main.nexe': {
'x86-32': {'url': 'test_dynamic_x86_32.nexe'},
'x86-64': {'url': 'test_dynamic_x86_64.nexe'},
+ 'arm': {'url': 'test_dynamic_arm.nexe'},
+ },
+ 'ld-nacl-arm.so.1': {
+ 'arm': {'url': 'libarm/ld-nacl-arm.so.1'},
+ },
+ 'libc.so.0.1': {
+ 'arm': {'url': 'libarm/libc.so.0.1'}
},
'libc.so': {
'x86-32': {'url': 'lib32/libc.so'},
'x86-64': {'url': 'lib64/libc.so'},
},
- 'libgcc_s.so': {
- 'x86-32': {'url': 'lib32/libgcc_s.so'},
- 'x86-64': {'url': 'lib64/libgcc_s.so'},
+ 'libgcc_s.so.1': {
+ 'arm': {'url': 'libarm/libgcc_s.so.1'},
+ 'x86-32': {'url': 'lib32/libgcc_s.so.1'},
+ 'x86-64': {'url': 'lib64/libgcc_s.so.1'},
+ },
+ 'libpthread.so.0': {
+ 'arm': { 'url': 'libarm/libpthread.so.0'}
},
'libpthread.so': {
'x86-32': {'url': 'lib32/libpthread.so'},
@@ -381,6 +415,7 @@ class TestNmfUtils(unittest.TestCase):
},
},
'program': {
+ 'arm': {'url': 'libarm/elf_loader_arm.nexe'},
'x86-32': {'url': 'lib32/runnable-ld.so'},
'x86-64': {'url': 'lib64/runnable-ld.so'},
}
@@ -389,34 +424,50 @@ class TestNmfUtils(unittest.TestCase):
expected_staging = [os.path.basename(f) for f in nexes]
expected_staging.extend([
'lib32/libc.so',
- 'lib32/libgcc_s.so',
+ 'lib32/libgcc_s.so.1',
'lib32/libpthread.so',
'lib32/runnable-ld.so',
'lib64/libc.so',
- 'lib64/libgcc_s.so',
+ 'lib64/libgcc_s.so.1',
'lib64/libpthread.so',
- 'lib64/runnable-ld.so'])
+ 'lib64/runnable-ld.so',
+ 'libarm/elf_loader_arm.nexe',
+ 'libarm/libpthread.so.0',
+ 'libarm/ld-nacl-arm.so.1',
+ 'libarm/libgcc_s.so.1',
+ 'libarm/libc.so.0.1'
+ ])
self.assertManifestEquals(nmf, expected_manifest)
self.assertStagingEquals(expected_staging)
def testDynamicWithPath(self):
- arch_dir = {'x86_64': 'x86_64', 'x86_32': 'x86_32'}
- nmf, nexes = self._CreateDynamicAndStageDeps(arch_dir,
+ nmf, nexes = self._CreateDynamicAndStageDeps(self.arch_dir,
nmf_root=self.tempdir)
expected_manifest = {
'files': {
'main.nexe': {
+ 'arm': {'url': 'arm/test_dynamic_arm.nexe'},
'x86-32': {'url': 'x86_32/test_dynamic_x86_32.nexe'},
'x86-64': {'url': 'x86_64/test_dynamic_x86_64.nexe'},
},
+ 'libc.so.0.1': {
+ 'arm': {'url': 'arm/libarm/libc.so.0.1'}
+ },
+ 'ld-nacl-arm.so.1': {
+ 'arm': {'url': 'arm/libarm/ld-nacl-arm.so.1'},
+ },
'libc.so': {
'x86-32': {'url': 'x86_32/lib32/libc.so'},
'x86-64': {'url': 'x86_64/lib64/libc.so'},
},
- 'libgcc_s.so': {
- 'x86-32': {'url': 'x86_32/lib32/libgcc_s.so'},
- 'x86-64': {'url': 'x86_64/lib64/libgcc_s.so'},
+ 'libgcc_s.so.1': {
+ 'arm': {'url': 'arm/libarm/libgcc_s.so.1'},
+ 'x86-32': {'url': 'x86_32/lib32/libgcc_s.so.1'},
+ 'x86-64': {'url': 'x86_64/lib64/libgcc_s.so.1'},
+ },
+ 'libpthread.so.0': {
+ 'arm': { 'url': 'arm/libarm/libpthread.so.0'}
},
'libpthread.so': {
'x86-32': {'url': 'x86_32/lib32/libpthread.so'},
@@ -424,6 +475,7 @@ class TestNmfUtils(unittest.TestCase):
},
},
'program': {
+ 'arm': {'url': 'arm/libarm/elf_loader_arm.nexe'},
'x86-32': {'url': 'x86_32/lib32/runnable-ld.so'},
'x86-64': {'url': 'x86_64/lib64/runnable-ld.so'},
}
@@ -432,37 +484,53 @@ class TestNmfUtils(unittest.TestCase):
expected_staging = [PosixRelPath(f, self.tempdir) for f in nexes]
expected_staging.extend([
'x86_32/lib32/libc.so',
- 'x86_32/lib32/libgcc_s.so',
+ 'x86_32/lib32/libgcc_s.so.1',
'x86_32/lib32/libpthread.so',
'x86_32/lib32/runnable-ld.so',
'x86_64/lib64/libc.so',
- 'x86_64/lib64/libgcc_s.so',
+ 'x86_64/lib64/libgcc_s.so.1',
'x86_64/lib64/libpthread.so',
- 'x86_64/lib64/runnable-ld.so'])
+ 'x86_64/lib64/runnable-ld.so',
+ 'arm/libarm/elf_loader_arm.nexe',
+ 'arm/libarm/libpthread.so.0',
+ 'arm/libarm/ld-nacl-arm.so.1',
+ 'arm/libarm/libgcc_s.so.1',
+ 'arm/libarm/libc.so.0.1'
+ ])
self.assertManifestEquals(nmf, expected_manifest)
self.assertStagingEquals(expected_staging)
def testDynamicWithRelPath(self):
"""Test that when the nmf root is a relative path that things work."""
- arch_dir = {'x86_64': 'x86_64', 'x86_32': 'x86_32'}
old_path = os.getcwd()
try:
os.chdir(self.tempdir)
- nmf, nexes = self._CreateDynamicAndStageDeps(arch_dir, nmf_root='')
+ nmf, nexes = self._CreateDynamicAndStageDeps(self.arch_dir, nmf_root='')
expected_manifest = {
'files': {
'main.nexe': {
+ 'arm': {'url': 'arm/test_dynamic_arm.nexe'},
'x86-32': {'url': 'x86_32/test_dynamic_x86_32.nexe'},
'x86-64': {'url': 'x86_64/test_dynamic_x86_64.nexe'},
},
+ 'ld-nacl-arm.so.1': {
+ 'arm': {'url': 'arm/libarm/ld-nacl-arm.so.1'},
+ },
+ 'libc.so.0.1': {
+ 'arm': {'url': 'arm/libarm/libc.so.0.1'}
+ },
'libc.so': {
'x86-32': {'url': 'x86_32/lib32/libc.so'},
'x86-64': {'url': 'x86_64/lib64/libc.so'},
},
- 'libgcc_s.so': {
- 'x86-32': {'url': 'x86_32/lib32/libgcc_s.so'},
- 'x86-64': {'url': 'x86_64/lib64/libgcc_s.so'},
+ 'libgcc_s.so.1': {
+ 'arm': {'url': 'arm/libarm/libgcc_s.so.1'},
+ 'x86-32': {'url': 'x86_32/lib32/libgcc_s.so.1'},
+ 'x86-64': {'url': 'x86_64/lib64/libgcc_s.so.1'},
+ },
+ 'libpthread.so.0': {
+ 'arm': { 'url': 'arm/libarm/libpthread.so.0'}
},
'libpthread.so': {
'x86-32': {'url': 'x86_32/lib32/libpthread.so'},
@@ -470,6 +538,7 @@ class TestNmfUtils(unittest.TestCase):
},
},
'program': {
+ 'arm': {'url': 'arm/libarm/elf_loader_arm.nexe'},
'x86-32': {'url': 'x86_32/lib32/runnable-ld.so'},
'x86-64': {'url': 'x86_64/lib64/runnable-ld.so'},
}
@@ -478,13 +547,19 @@ class TestNmfUtils(unittest.TestCase):
expected_staging = [PosixRelPath(f, self.tempdir) for f in nexes]
expected_staging.extend([
'x86_32/lib32/libc.so',
- 'x86_32/lib32/libgcc_s.so',
+ 'x86_32/lib32/libgcc_s.so.1',
'x86_32/lib32/libpthread.so',
'x86_32/lib32/runnable-ld.so',
'x86_64/lib64/libc.so',
- 'x86_64/lib64/libgcc_s.so',
+ 'x86_64/lib64/libgcc_s.so.1',
'x86_64/lib64/libpthread.so',
- 'x86_64/lib64/runnable-ld.so'])
+ 'x86_64/lib64/runnable-ld.so',
+ 'arm/libarm/elf_loader_arm.nexe',
+ 'arm/libarm/libpthread.so.0',
+ 'arm/libarm/ld-nacl-arm.so.1',
+ 'arm/libarm/libgcc_s.so.1',
+ 'arm/libarm/libc.so.0.1'
+ ])
self.assertManifestEquals(nmf, expected_manifest)
self.assertStagingEquals(expected_staging)
@@ -492,23 +567,33 @@ class TestNmfUtils(unittest.TestCase):
os.chdir(old_path)
def testDynamicWithPathNoArchPrefix(self):
- arch_dir = {'x86_64': 'x86_64', 'x86_32': 'x86_32'}
- nmf, nexes = self._CreateDynamicAndStageDeps(arch_dir,
+ nmf, nexes = self._CreateDynamicAndStageDeps(self.arch_dir,
nmf_root=self.tempdir,
no_arch_prefix=True)
expected_manifest = {
'files': {
'main.nexe': {
+ 'arm': {'url': 'arm/test_dynamic_arm.nexe'},
'x86-32': {'url': 'x86_32/test_dynamic_x86_32.nexe'},
'x86-64': {'url': 'x86_64/test_dynamic_x86_64.nexe'},
},
+ 'ld-nacl-arm.so.1': {
+ 'arm': {'url': 'arm/ld-nacl-arm.so.1'},
+ },
+ 'libc.so.0.1': {
+ 'arm': {'url': 'arm/libc.so.0.1'}
+ },
'libc.so': {
'x86-32': {'url': 'x86_32/libc.so'},
'x86-64': {'url': 'x86_64/libc.so'},
},
- 'libgcc_s.so': {
- 'x86-32': {'url': 'x86_32/libgcc_s.so'},
- 'x86-64': {'url': 'x86_64/libgcc_s.so'},
+ 'libgcc_s.so.1': {
+ 'arm': {'url': 'arm/libgcc_s.so.1'},
+ 'x86-32': {'url': 'x86_32/libgcc_s.so.1'},
+ 'x86-64': {'url': 'x86_64/libgcc_s.so.1'},
+ },
+ 'libpthread.so.0': {
+ 'arm': { 'url': 'arm/libpthread.so.0'}
},
'libpthread.so': {
'x86-32': {'url': 'x86_32/libpthread.so'},
@@ -516,6 +601,7 @@ class TestNmfUtils(unittest.TestCase):
},
},
'program': {
+ 'arm': {'url': 'arm/elf_loader_arm.nexe'},
'x86-32': {'url': 'x86_32/runnable-ld.so'},
'x86-64': {'url': 'x86_64/runnable-ld.so'},
}
@@ -524,13 +610,19 @@ class TestNmfUtils(unittest.TestCase):
expected_staging = [PosixRelPath(f, self.tempdir) for f in nexes]
expected_staging.extend([
'x86_32/libc.so',
- 'x86_32/libgcc_s.so',
+ 'x86_32/libgcc_s.so.1',
'x86_32/libpthread.so',
'x86_32/runnable-ld.so',
'x86_64/libc.so',
- 'x86_64/libgcc_s.so',
+ 'x86_64/libgcc_s.so.1',
'x86_64/libpthread.so',
- 'x86_64/runnable-ld.so'])
+ 'x86_64/runnable-ld.so',
+ 'arm/elf_loader_arm.nexe',
+ 'arm/libpthread.so.0',
+ 'arm/ld-nacl-arm.so.1',
+ 'arm/libgcc_s.so.1',
+ 'arm/libc.so.0.1'
+ ])
self.assertManifestEquals(nmf, expected_manifest)
self.assertStagingEquals(expected_staging)
@@ -540,16 +632,27 @@ class TestNmfUtils(unittest.TestCase):
expected_manifest = {
'files': {
'main.nexe': {
+ 'arm': {'url': 'test_dynamic_arm.nexe'},
'x86-32': {'url': 'test_dynamic_x86_32.nexe'},
'x86-64': {'url': 'test_dynamic_x86_64.nexe'},
},
+ 'ld-nacl-arm.so.1': {
+ 'arm': {'url': 'foo/libarm/ld-nacl-arm.so.1'},
+ },
+ 'libc.so.0.1': {
+ 'arm': {'url': 'foo/libarm/libc.so.0.1'}
+ },
'libc.so': {
'x86-32': {'url': 'foo/lib32/libc.so'},
'x86-64': {'url': 'foo/lib64/libc.so'},
},
- 'libgcc_s.so': {
- 'x86-32': {'url': 'foo/lib32/libgcc_s.so'},
- 'x86-64': {'url': 'foo/lib64/libgcc_s.so'},
+ 'libgcc_s.so.1': {
+ 'arm': {'url': 'foo/libarm/libgcc_s.so.1'},
+ 'x86-32': {'url': 'foo/lib32/libgcc_s.so.1'},
+ 'x86-64': {'url': 'foo/lib64/libgcc_s.so.1'},
+ },
+ 'libpthread.so.0': {
+ 'arm': { 'url': 'foo/libarm/libpthread.so.0'}
},
'libpthread.so': {
'x86-32': {'url': 'foo/lib32/libpthread.so'},
@@ -557,6 +660,7 @@ class TestNmfUtils(unittest.TestCase):
},
},
'program': {
+ 'arm': {'url': 'foo/libarm/elf_loader_arm.nexe'},
'x86-32': {'url': 'foo/lib32/runnable-ld.so'},
'x86-64': {'url': 'foo/lib64/runnable-ld.so'},
}
@@ -565,13 +669,19 @@ class TestNmfUtils(unittest.TestCase):
expected_staging = [PosixRelPath(f, self.tempdir) for f in nexes]
expected_staging.extend([
'foo/lib32/libc.so',
- 'foo/lib32/libgcc_s.so',
+ 'foo/lib32/libgcc_s.so.1',
'foo/lib32/libpthread.so',
'foo/lib32/runnable-ld.so',
'foo/lib64/libc.so',
- 'foo/lib64/libgcc_s.so',
+ 'foo/lib64/libgcc_s.so.1',
'foo/lib64/libpthread.so',
- 'foo/lib64/runnable-ld.so'])
+ 'foo/lib64/runnable-ld.so',
+ 'foo/libarm/elf_loader_arm.nexe',
+ 'foo/libarm/libpthread.so.0',
+ 'foo/libarm/ld-nacl-arm.so.1',
+ 'foo/libarm/libgcc_s.so.1',
+ 'foo/libarm/libc.so.0.1'
+ ])
self.assertManifestEquals(nmf, expected_manifest)
self.assertStagingEquals(expected_staging)