Chromium Code Reviews| Index: native_client_sdk/src/tools/create_nmf.py |
| diff --git a/native_client_sdk/src/tools/create_nmf.py b/native_client_sdk/src/tools/create_nmf.py |
| index ba5f1e42342d9ac5a2bee95f6ece591e0a73fb24..dbb64c52802774ee93796defc51c25252b54e6e2 100755 |
| --- a/native_client_sdk/src/tools/create_nmf.py |
| +++ b/native_client_sdk/src/tools/create_nmf.py |
| @@ -36,12 +36,6 @@ ARCH_LOCATION = { |
| 'x86-64': 'lib64', |
| } |
| -NAME_ARCH_MAP = { |
| - '32.nexe': 'x86-32', |
| - '64.nexe': 'x86-64', |
| - 'arm.nexe': 'arm' |
| -} |
| - |
| # 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 |
| @@ -222,43 +216,34 @@ class NmfUtils(object): |
| if self.needed: |
| return self.needed |
| - runnable = (self.toolchain != 'newlib' and self.toolchain != 'pnacl') |
|
binji
2012/09/17 19:12:22
what about pnacl...?
Sam Clegg
2012/09/18 17:48:22
Done.
|
| DebugPrint('GetNeeded(%s)' % self.main_files) |
| - if runnable: |
| - examined = set() |
| - all_files, unexamined = self.GleanFromObjdump( |
| - dict([(f, None) for f in self.main_files])) |
| - for name, arch_file in all_files.items(): |
| - arch_file.url = name |
| - if unexamined: |
| - unexamined.add('/'.join([arch_file.arch, RUNNABLE_LD])) |
| - while unexamined: |
| - files_to_examine = {} |
| - for arch_name in unexamined: |
| - arch, name = arch_name.split('/') |
| - for path in self.FindLibsInPath(name): |
| - files_to_examine.setdefault(path, set()).add(arch) |
| - new_files, needed = self.GleanFromObjdump(files_to_examine) |
| - all_files.update(new_files) |
| - examined |= unexamined |
| - unexamined = needed - examined |
| - # With the runnable-ld.so scheme we have today, the proper name of |
| - # the dynamic linker should be excluded from the list of files. |
| - ldso = [LD_NACL_MAP[arch] for arch in set(FORMAT_ARCH_MAP.values())] |
| - for name, arch_map in all_files.items(): |
| - if arch_map.name in ldso: |
| - del all_files[name] |
| - self.needed = all_files |
| - else: |
| - need = {} |
| - for filename in self.main_files: |
| - arch = filename.split('_')[-1] |
| - arch = NAME_ARCH_MAP[arch] |
| - url = os.path.split(filename)[1] |
| - need[filename] = ArchFile(arch=arch, name=os.path.basename(filename), |
| - path=filename, url=url) |
| - self.needed = need |
| + examined = set() |
| + all_files, unexamined = self.GleanFromObjdump( |
| + dict([(f, None) for f in self.main_files])) |
| + for name, arch_file in all_files.items(): |
| + arch_file.url = name |
| + if unexamined: |
| + unexamined.add('/'.join([arch_file.arch, RUNNABLE_LD])) |
| + while unexamined: |
| + files_to_examine = {} |
| + for arch_name in unexamined: |
| + arch, name = arch_name.split('/') |
| + for path in self.FindLibsInPath(name): |
| + files_to_examine.setdefault(path, set()).add(arch) |
| + new_files, needed = self.GleanFromObjdump(files_to_examine) |
| + all_files.update(new_files) |
| + examined |= unexamined |
| + unexamined = needed - examined |
| + |
| + # With the runnable-ld.so scheme we have today, the proper name of |
| + # the dynamic linker should be excluded from the list of files. |
| + ldso = [LD_NACL_MAP[arch] for arch in set(FORMAT_ARCH_MAP.values())] |
| + for name, arch_map in all_files.items(): |
| + if arch_map.name in ldso: |
| + del all_files[name] |
| + |
| + self.needed = all_files |
| return self.needed |
| def StageDependencies(self, destination_dir): |