summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjasonwkim@google.com <jasonwkim@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-24 21:55:03 +0000
committerjasonwkim@google.com <jasonwkim@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-24 21:55:03 +0000
commitb47b5610b3f710d7e33faa49ccb23968a246f7e9 (patch)
tree329020cfcfe2e19df9e484106aab54739d0bc6f7
parent0c0646cdc7cdb69271edeb11f549526f883003d3 (diff)
downloadchromium_src-b47b5610b3f710d7e33faa49ccb23968a246f7e9.zip
chromium_src-b47b5610b3f710d7e33faa49ccb23968a246f7e9.tar.gz
chromium_src-b47b5610b3f710d7e33faa49ccb23968a246f7e9.tar.bz2
Activate IRT building on ARM for NaCl.
In order for this to be on for real, the PNaCl toolchain still needs to available Since NaCl is still turned off by default on ARM, this code should be a no-op for all other cases. This also moves the compilation a step forward for ARM. There is a bootstrap dependency on memset on ARM - so SYSROOT on the ChromiumOS chroot is required to gain access to libc. R=bradnelson,robertm BUG=http://code.google.com/p/chromium/issues/detail?id=61695 BUG=http://code.google.com/p/chromium/issues/detail?id=38909 BUG=http://code.google.com/p/nativeclient/issues/detail?id=135 Review URL: http://codereview.chromium.org/8364019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106982 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xchrome/build_nacl_irt.py31
-rw-r--r--chrome/nacl.gypi21
2 files changed, 45 insertions, 7 deletions
diff --git a/chrome/build_nacl_irt.py b/chrome/build_nacl_irt.py
index cee7655..6225311 100755
--- a/chrome/build_nacl_irt.py
+++ b/chrome/build_nacl_irt.py
@@ -163,20 +163,37 @@ def BuildIRT(platforms, out_dir):
# Copy out each platform after stripping.
for platform in platforms:
uplatform = platform.replace('-', '_')
- platform2 = {'x86-32': 'i686', 'x86-64': 'x86_64'}.get(platform, platform)
+ # NaCl Trusted code is in thumb2 mode in CrOS, but as yet,
+ # untrusted code is still in classic ARM mode
+ # arm-thumb2 is for the future when untrusted code is in thumb2 as well
+ platform2 = {'arm': 'pnacl',
+ 'arm-thumb2' : 'pnacl',
+ 'x86-32': 'i686',
+ 'x86-64': 'x86_64'}.get(platform, platform)
cplatform = {
'win32': 'win',
'cygwin': 'win',
'darwin': 'mac',
}.get(sys.platform, 'linux')
nexe = os.path.join(out_dir, 'nacl_irt_' + uplatform + '.nexe')
- cmd = [
- '../native_client/toolchain/' + cplatform + '_x86_newlib/bin/' +
+ if platform in ['arm', 'arm-thumb2']:
+ cmd = [
+ '../native_client/toolchain/pnacl_linux_x86_64_newlib/bin/' +
+ platform2 + '-strip',
+ '--strip-debug',
+ '../native_client/scons-out/nacl_irt-' + platform \
+ + '/staging/irt.nexe',
+ '-o', nexe
+ ]
+ else:
+ cmd = [
+ '../native_client/toolchain/' + cplatform + '_x86_newlib/bin/' +
platform2 + '-nacl-strip',
- '--strip-debug',
- '../native_client/scons-out/nacl_irt-' + platform + '/staging/irt.nexe',
- '-o', nexe
- ]
+ '--strip-debug',
+ '../native_client/scons-out/nacl_irt-' + platform \
+ + '/staging/irt.nexe',
+ '-o', nexe
+ ]
print 'Running: ' + ' '.join(cmd)
p = subprocess.Popen(cmd, cwd=SCRIPT_DIR)
p.wait()
diff --git a/chrome/nacl.gypi b/chrome/nacl.gypi
index f5bf28a..1836a27 100644
--- a/chrome/nacl.gypi
+++ b/chrome/nacl.gypi
@@ -135,6 +135,21 @@
},
],
}],
+ ['OS!="win" and target_arch=="arm"', {
+ 'actions': [
+ {
+ 'action_name': 'nacl_irt',
+ 'message': 'Building NaCl IRT',
+ 'inputs': [
+ '<!@(<(irt_inputs_cmd) --platform=arm)',
+ ],
+ 'outputs': ['<(PRODUCT_DIR)/nacl_ir.nexe'],
+ 'action': [
+ '<@(irt_build_cmd)', '--platform', 'arm',
+ ],
+ },
+ ],
+ }],
],
},
],
@@ -312,16 +327,21 @@
['target_arch=="x64"', {
'variables': {
'linker_emulation': 'elf_x86_64',
+ 'bootstrap_extra_lib': '',
}
}],
['target_arch=="ia32"', {
'variables': {
'linker_emulation': 'elf_i386',
+ 'bootstrap_extra_lib': '',
}
}],
['target_arch=="arm"', {
'variables': {
'linker_emulation': 'armelf_linux_eabi',
+ # ARM requires linking against libc due to ABI dependencies on
+ # memset
+ 'bootstrap_extra_lib' : "${SYSROOT}/usr/lib/libc.a",
}
}],
],
@@ -344,6 +364,7 @@
'-z', 'max-page-size=0x1000',
'--whole-archive', '<(bootstrap_lib)',
'--no-whole-archive',
+ '<@(bootstrap_extra_lib)',
],
}
],