summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/tools
diff options
context:
space:
mode:
authornoelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-15 12:25:23 +0000
committernoelallen@chromium.org <noelallen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-15 12:25:23 +0000
commite5a304e4f53371384442428057e1caa5fc2ca443 (patch)
tree520ab63824090431593d58eb8748ca8068e1aaf5 /native_client_sdk/src/tools
parent5dbecd10facbbf013307c7a7cf07b50d861e632a (diff)
downloadchromium_src-e5a304e4f53371384442428057e1caa5fc2ca443.zip
chromium_src-e5a304e4f53371384442428057e1caa5fc2ca443.tar.gz
chromium_src-e5a304e4f53371384442428057e1caa5fc2ca443.tar.bz2
Re-enable PNaCl
Renable examples disabled to support newlib/glibc combo. Updates template, buildsdk, create_nmf to enable PNaCl. Unifies macro replacement code in generate_make BUG=130618 TBR=binji@chromium.org Review URL: https://chromiumcodereview.appspot.com/10543175 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142382 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk/src/tools')
-rwxr-xr-xnative_client_sdk/src/tools/create_nmf.py29
1 files changed, 24 insertions, 5 deletions
diff --git a/native_client_sdk/src/tools/create_nmf.py b/native_client_sdk/src/tools/create_nmf.py
index 165afe1..da6924c 100755
--- a/native_client_sdk/src/tools/create_nmf.py
+++ b/native_client_sdk/src/tools/create_nmf.py
@@ -36,6 +36,12 @@ ARCH_LOCATION = {
'x86-64': 'lib64',
}
+NAME_ARCH_MAP = {
+ '32.nexe': 'x86-32',
+ '64.nexe': 'x64-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
@@ -195,8 +201,12 @@ class NmfUtils(object):
Includes the input files as well, with arch filled in if absent.
Example: { '/path/to/my.nexe': ArchFile(my.nexe),
'/path/to/libfoo.so': ArchFile(libfoo.so) }'''
- if not self.needed:
- DebugPrint('GetNeeded(%s)' % self.main_files)
+ if self.needed:
+ return self.needed
+
+ runnable = (self.toolchain != 'newlib' and self.toolchain != 'pnacl')
+ DebugPrint('GetNeeded(%s)' % self.main_files)
+ if runnable:
examined = set()
all_files, unexamined = self.GleanFromObjdump(
dict([(file, None) for file in self.main_files]))
@@ -221,6 +231,15 @@ class NmfUtils(object):
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
return self.needed
def StageDependencies(self, destination_dir):
@@ -255,9 +274,9 @@ class NmfUtils(object):
FILES key mapped as 'main.exe' instead of it's original name so that the
loader can find it.'''
manifest = { FILES_KEY: {}, PROGRAM_KEY: {} }
- needed = self.GetNeeded()
+ runnable = (self.toolchain != 'newlib' and self.toolchain != 'pnacl')
- runnable = self.toolchain != 'newlib'
+ needed = self.GetNeeded()
for need in needed:
archinfo = needed[need]
urlinfo = { URL_KEY: archinfo.url }
@@ -352,7 +371,7 @@ def Main(argv):
if not options.toolchain:
options.toolchain = DetermineToolchain(os.path.abspath(options.objdump))
- if options.toolchain not in ['newlib', 'glibc']:
+ if options.toolchain not in ['newlib', 'glibc', 'pnacl']:
ErrorOut('Unknown toolchain: ' + str(options.toolchain))
if len(args) < 1: