Commit b47b5610 authored by jasonwkim@google.com's avatar jasonwkim@google.com

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
parent 0c0646cd
......@@ -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()
......
......@@ -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)',
],
}
],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment