Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: native_client_sdk/src/tools/create_nmf.py

Issue 1398883004: [NaCl SDK] Fix create_nmf to include arm/glibc ELF loader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « native_client_sdk/src/test_all.py ('k') | native_client_sdk/src/tools/lib/get_shared_deps.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eabcc1273121e55a2813f8f82ae2cd47cff1d4c8..fe4abb9ff9aac813b671ebb8d103c088c4be67f6 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
« no previous file with comments | « native_client_sdk/src/test_all.py ('k') | native_client_sdk/src/tools/lib/get_shared_deps.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698