summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjvoung@chromium.org <jvoung@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 00:25:12 +0000
committerjvoung@chromium.org <jvoung@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-30 00:25:12 +0000
commita397169facbe431de97afec378e48132391b42f5 (patch)
tree2e2fe25c30bed0346430c9a2ab497dd36f00457c
parent1dbd841e11eb501bf189e635fa724f62e3ccb45e (diff)
downloadchromium_src-a397169facbe431de97afec378e48132391b42f5.zip
chromium_src-a397169facbe431de97afec378e48132391b42f5.tar.gz
chromium_src-a397169facbe431de97afec378e48132391b42f5.tar.bz2
Add a gyp action for laying out the pnacl translator nexes into PRODUCT_DIR.
This may help us include the translators later. The file copying is adapted to follow the naming scheme expected by pnacl_file_host. We will need to adapt the plugin later to actually request files that way. NOTE: The sandboxed translator requires shims always, even if they don't do much (e.g., for x86-32). We rely on the untrusted.gypi building both x86-32 and x86-64 versions, and copy both for Windows. This requires modifying the SDK to copy from the gen/ directory too. Also switch prints to using logging module to avoid printing superfluous stuff during ninja builds, etc., and supress printing unless --verbose is given. BUG= http://code.google.com/p/nativeclient/issues/detail?id=2365 Review URL: https://chromiumcodereview.appspot.com/11411051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170302 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/nacl.gypi1
-rwxr-xr-xnative_client_sdk/src/build_tools/build_sdk.py6
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp10
-rwxr-xr-xppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_component_crx_gen.py188
-rw-r--r--ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp151
5 files changed, 317 insertions, 39 deletions
diff --git a/chrome/nacl.gypi b/chrome/nacl.gypi
index 13d2af1..334b945 100644
--- a/chrome/nacl.gypi
+++ b/chrome/nacl.gypi
@@ -83,6 +83,7 @@
'../ppapi/native_client/native_client.gyp:nacl_irt',
'../ppapi/native_client/native_client.gyp:nacl_irt_srpc',
'../ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:pnacl_irt_shim',
+ '../ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp:pnacl_support_extension',
],
}],
],
diff --git a/native_client_sdk/src/build_tools/build_sdk.py b/native_client_sdk/src/build_tools/build_sdk.py
index 1eb4aef..5a88109 100755
--- a/native_client_sdk/src/build_tools/build_sdk.py
+++ b/native_client_sdk/src/build_tools/build_sdk.py
@@ -528,10 +528,10 @@ def BuildStepBuildToolchains(pepperdir, platform, arch, pepper_ver,
for arch in ('ia32', 'arm'):
# Fill in the latest native pnacl shim library from the chrome build.
GypNinjaBuild_Pnacl('gypbuild-' + arch, arch)
- release_build_dir = os.path.join(OUT_DIR, 'gypbuild-' + arch,
- 'Release')
-
pnacl_libdir_map = { 'ia32': 'x86-64', 'arm': 'arm' }
+ release_build_dir = os.path.join(OUT_DIR, 'gypbuild-' + arch,
+ 'Release', 'gen', 'tc_pnacl_translate',
+ 'lib-' + pnacl_libdir_map[arch])
buildbot_common.CopyFile(
os.path.join(release_build_dir, 'libpnacl_irt_shim.a'),
GetPNaClNativeLib(pnacldir, pnacl_libdir_map[arch]))
diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp
index fc6f743..011c2c2 100644
--- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp
+++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp
@@ -10,10 +10,14 @@
{
'target_name': 'pnacl_irt_shim',
'type': 'none',
+ # TODO(jvoung): should be able to --strip-debug
+ # this archive to reduce the size to 25% of what
+ # it is now.
'variables': {
- 'nlib_target': 'pnacl_irt_shim.a',
- 'out_newlib64': '<(PRODUCT_DIR)/libpnacl_irt_shim.a',
- 'out_newlib_arm': '<(PRODUCT_DIR)/libpnacl_irt_shim.a',
+ 'nlib_target': 'libpnacl_irt_shim.a',
+ 'out_newlib_arm': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-arm/libpnacl_irt_shim.a',
+ 'out_newlib32': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-32/libpnacl_irt_shim.a',
+ 'out_newlib64': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-64/libpnacl_irt_shim.a',
'build_glibc': 0,
'build_newlib': 1,
'sources': [
diff --git a/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_component_crx_gen.py b/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_component_crx_gen.py
index b0f0838..30409a8 100755
--- a/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_component_crx_gen.py
+++ b/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_component_crx_gen.py
@@ -3,18 +3,19 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""
- This script packages the PNaCl translator files as a Chrome Extension (crx),
- which can be used as a straight-forward CRX, or used with the Chrome
- incremental installer (component updater).
+"""This script packages the PNaCl translator files as:
+ (1) a Chrome Extension (crx), which can be used as a straight-forward CRX,
+ or used with the Chrome incremental installer (component updater)
+ (2) a Chrome Extension as a zip for uploading to the CWS.
+ (3) layout files for a normal Chrome installer.
This script depends on and pulls in the translator nexes and libraries
- from the toolchain directory (so that must be downloaded first), fills
- in the CRX manifest files, and zips and signs the CRXes using
- chrome (which must also be downloaded first), etc.
+ from the toolchain directory (so that must be downloaded first) and
+ it depends on the pnacl_irt_shim.
"""
import glob
+import logging
import optparse
import os
import platform
@@ -39,16 +40,20 @@ J = os.path.join
# This is based on the machine "building" this extension.
# We also used this to identify the arch-specific different versions of
# this extension.
-def GetBuildArch():
- arch = platform.machine()
- if arch in ('x86_64', 'amd64'):
+
+def CanonicalArch(arch):
+ if arch in ('x86_64', 'x86-64', 'x64', 'amd64'):
return 'x86-64'
# TODO(jvoung): be more specific about the arm architecture version?
- if arch.startswith('armv7'):
+ if arch in ('arm', 'armv7'):
return 'arm'
- x86_32_re = re.compile('^i.86$')
- if x86_32_re.search(arch) or arch == 'x86_32' or arch == 'x86':
+ if re.match('^i.86$', arch) or arch in ('x86_32', 'x86-32', 'ia32', 'x86'):
return 'x86-32'
+ return None
+
+def GetBuildArch():
+ arch = platform.machine()
+ return CanonicalArch(arch)
BUILD_ARCH = GetBuildArch()
ARCHES = ['x86-32', 'x86-64', 'arm']
@@ -108,6 +113,22 @@ def GetBuildPlatform():
return platform
BUILD_PLATFORM = GetBuildPlatform()
+
+def DetermineInstallerArches(target_arch):
+ arch = CanonicalArch(target_arch)
+ if not IsValidArch(arch):
+ raise Exception('Unknown target_arch %s' % target_arch)
+ # On windows, we need x86-32 and x86-64 (assuming non-windows RT).
+ if BUILD_PLATFORM == 'windows':
+ if arch.startswith('x86'):
+ return ['x86-32', 'x86-64']
+ else:
+ raise Exception('Unknown target_arch on windows w/ target_arch == %s' %
+ target_arch)
+ else:
+ return [arch]
+
+
class CRXGen(object):
""" Generate a CRX file. Can generate a fresh CRX and private key, or
create a version of new CRX with the same AppID, using an existing
@@ -187,8 +208,11 @@ class PnaclPackaging(object):
web_accessible,
all_host_permissions,
manifest_key)
+ # For now, make the ABI version the same as pnacl-version...
+ # It should probably be separate though.
PnaclPackaging.GeneratePnaclInfo(target_dir, version, arch)
+
@staticmethod
def GenerateExtensionManifest(target_dir, version,
web_accessible, all_host_permissions,
@@ -210,12 +234,21 @@ class PnaclPackaging(object):
output_fd.close()
@staticmethod
- def GeneratePnaclInfo(target_dir, version, arch):
+ def GeneratePnaclInfo(target_dir, version, arch, is_installer=False):
pnacl_template_fd = open(PnaclPackaging.pnacl_template, 'r')
pnacl_template = pnacl_template_fd.read()
pnacl_template_fd.close()
- output_fd = open(J(target_dir, PnaclPackaging.pnacl_json), 'w')
- # For now, make the ABI version the same as pnacl-version.
+ if is_installer:
+ out_name = J(target_dir, UseWhitelistedChars(PnaclPackaging.pnacl_json,
+ None))
+ else:
+ out_name = J(target_dir, PnaclPackaging.pnacl_json)
+ output_fd = open(out_name, 'w')
+ if isinstance(arch, list):
+ # FIXME: Handle a list of arches, not just a wildcard "all".
+ # Alternatively, perhaps we shouldn't bother checking what arch is
+ # installed and assume the installer does the right thing.
+ arch = 'all'
output_fd.write(pnacl_template % { "abi-version" : version,
"arch" : arch, })
output_fd.close()
@@ -268,7 +301,7 @@ class PnaclDirs(object):
######################################################################
def StepBanner(short_desc, long_desc):
- print "**** %s\t%s" % (short_desc, long_desc)
+ logging.info("**** %s\t%s", short_desc, long_desc)
def Clean():
@@ -277,7 +310,9 @@ def Clean():
if os.path.isdir(out_dir):
shutil.rmtree(out_dir)
else:
- print 'Clean skipped -- no previous output directory!'
+ logging.info('Clean skipped -- no previous output directory!')
+
+######################################################################
def ZipDirectory(base_dir, zipfile):
@@ -329,11 +364,12 @@ def GeneratePrivateKey(options):
shutil.copy2(J(tempdir, 'dummy_extension.pem'),
PnaclDirs.OutputDir())
shutil.rmtree(tempdir)
- print ('\n<<< Fresh key is now in %s/dummy_extension.pem >>>\n' %
- PnaclDirs.OutputDir())
+ logging.info('\n<<< Fresh key is now in %s/dummy_extension.pem >>>\n' %
+ PnaclDirs.OutputDir())
-def BuildArchCRXForComponentUpdater(version_quad, arch, lib_overrides, options):
+def BuildArchCRXForComponentUpdater(version_quad, arch, lib_overrides,
+ options):
""" Build an architecture specific version for the chrome component
install (an actual CRX, vs a zip file). Though this is a CRX,
it is not used as a chrome extension as the CWS and unpacked version.
@@ -355,16 +391,9 @@ def BuildArchCRXForComponentUpdater(version_quad, arch, lib_overrides, options):
# Also copy files from the list of overrides.
if arch in lib_overrides:
for override in lib_overrides[arch]:
- print 'Copying override %s to %s' % (override, target_dir)
+ logging.info('Copying override %s to %s' % (override, target_dir))
shutil.copy2(override, target_dir)
- # Filter out native libraries related to glibc.
- patterns = ['*nonshared.a', '*.so', '*.so.*']
- for pat in patterns:
- for f in glob.glob(J(target_dir, pat)):
- print 'Filtering out glibc file: %s' % f
- os.remove(f)
-
# Skip the CRX generation if we are only building the unpacked version
# for commandline testing.
if options.unpacked_only:
@@ -434,13 +463,15 @@ def BuildUnpacked(version_quad):
PnaclPackaging.WEBSTORE_PUBLIC_KEY)
-def BuildAll(version_quad, lib_overrides, options):
- """ Package the pnacl components 3 ways.
+def BuildExtensionStyle(version_quad, lib_overrides, options):
+ """ Package the pnacl components 3 ways, all of which are
+ chrome-extension-like.
+
1) Arch-specific CRXes that can be queried by Omaha.
2) A zip containing all arch files for the Chrome Webstore.
3) An unpacked extension with all arch files for offline testing.
"""
- StepBanner("BUILD_ALL", "Packaging for version: %s" % version_quad)
+ StepBanner("BUILD_ALL", "Packaging extension for version: %s" % version_quad)
for arch in ARCHES:
BuildArchCRXForComponentUpdater(version_quad, arch, lib_overrides, options)
LayoutAllDir(version_quad)
@@ -448,6 +479,81 @@ def BuildAll(version_quad, lib_overrides, options):
BuildCWSZip(version_quad)
BuildUnpacked(version_quad)
+######################################################################
+
+def UseWhitelistedChars(orig_basename, arch):
+ """ Make the filename match the pattern expected by pnacl_file_host.
+
+ Currently, this assumes there is prefix "pnacl_public_" and
+ that the allowed chars are in the set [a-zA-Z0-9_].
+ """
+ if arch:
+ target_basename = 'pnacl_public_%s_%s' % (arch, orig_basename)
+ else:
+ target_basename = 'pnacl_public_%s' % orig_basename
+ result = re.sub(r'[^a-zA-Z0-9_]', '_', target_basename)
+ logging.info('UseWhitelistedChars using: %s' % result)
+ return result
+
+def CopyFlattenDirsAndPrefix(src_dir, arch, dest_dir):
+ """ Copy files from src_dir to dest_dir.
+
+ When copying, also rename the files such that they match the white-listing
+ pattern in chrome/browser/nacl_host/pnacl_file_host.cc.
+ """
+ for (root, dirs, files) in os.walk(src_dir, followlinks=True):
+ for f in files:
+ # Assume a flat directory.
+ assert (f == os.path.basename(f))
+ full_name = J(root, f)
+ target_name = UseWhitelistedChars(f, arch)
+ shutil.copy2(full_name, J(dest_dir, target_name))
+
+
+def BuildArchForInstaller(version_quad, arch, lib_overrides, options):
+ """ Build an architecture specific version for the chrome installer.
+ """
+ target_dir = PnaclDirs.OutputDir()
+
+ StepBanner('BUILD INSTALLER',
+ 'Packaging for arch %s in %s' % (arch, target_dir))
+
+ # Copy llc.nexe and ld.nexe, but with some renaming and directory flattening.
+ CopyFlattenDirsAndPrefix(PnaclDirs.SandboxedCompilerDir(arch),
+ arch,
+ target_dir)
+
+ # Copy native libraries, also with renaming and directory flattening.
+ CopyFlattenDirsAndPrefix(PnaclDirs.LibDir(arch), arch, target_dir)
+
+ # Also copy files from the list of overrides.
+ # This needs the arch tagged onto the name too, like the other files.
+ if arch in lib_overrides:
+ for override in lib_overrides[arch]:
+ override_base = os.path.basename(override)
+ target_name = UseWhitelistedChars(override_base, arch)
+ shutil.copy2(override, J(target_dir, target_name))
+
+
+def BuildInstallerStyle(version_quad, lib_overrides, options):
+ """ Package the pnacl component for use within the chrome installer
+ infrastructure. These files need to be named in a special way
+ so that white-listing of files is easy.
+ """
+ StepBanner("BUILD_ALL", "Packaging installer for version: %s" % version_quad)
+ arches = DetermineInstallerArches(options.installer_only)
+ for arch in arches:
+ BuildArchForInstaller(version_quad, arch, lib_overrides, options)
+ # Generate pnacl info manifest.
+ # Hack around the fact that there may be more than one arch, on Windows.
+ if len(arches) == 1:
+ arches = arches[0]
+ PnaclPackaging.GeneratePnaclInfo(PnaclDirs.OutputDir(), version_quad,
+ arches, is_installer=True)
+
+
+######################################################################
+
def Main():
usage = 'usage: %prog [options] version_arg'
@@ -460,6 +566,9 @@ def Main():
parser.add_option('-u', '--unpacked_only', action='store_true',
dest='unpacked_only', default=False,
help='Only generate the unpacked version')
+ parser.add_option('-i', '--installer_only',
+ dest='installer_only', default=None,
+ help='Only generate the chrome installer version for arch')
parser.add_option('-d', '--dest', dest='dest',
help='The destination root for laying out the extension')
parser.add_option('-p', '--priv_key',
@@ -475,8 +584,17 @@ def Main():
help='Generate a fresh private key, and exit.')
parser.add_option('-C', '--chrome_path', dest='chrome_path',
help='Location of chrome.')
+ parser.add_option('-v', '--verbose', dest='verbose', default=False,
+ action='store_true',
+ help='Print verbose debug messages.')
(options, args) = parser.parse_args()
+ if options.verbose:
+ logging.getLogger().setLevel(logging.DEBUG)
+ else:
+ logging.getLogger().setLevel(logging.ERROR)
+ logging.info('pnacl_component_crx_gen w/ options %s and args %s\n'
+ % (options, args))
# Set destination directory before doing any cleaning, etc.
if options.dest:
@@ -492,6 +610,7 @@ def Main():
lib_overrides = {}
for o in options.lib_overrides:
arch, override_lib = o.split(',')
+ arch = CanonicalArch(arch)
if not IsValidArch(arch):
raise Exception('Unknown arch for -L: %s (from %s)' % (arch, o))
if not os.path.isfile(override_lib):
@@ -510,7 +629,10 @@ def Main():
print 'Invalid version format: %s\n' % version_quad
return 1
- BuildAll(version_quad, lib_overrides, options)
+ if options.installer_only:
+ BuildInstallerStyle(version_quad, lib_overrides, options)
+ else:
+ BuildExtensionStyle(version_quad, lib_overrides, options)
return 0
diff --git a/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp b/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp
new file mode 100644
index 0000000..f17fc96
--- /dev/null
+++ b/ppapi/native_client/src/untrusted/pnacl_support_extension/pnacl_support_extension.gyp
@@ -0,0 +1,151 @@
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ # re: untrusted.gypi -- Though this doesn't really use build_nexe.py or
+ # anything, it depends on untrusted nexes from the toolchain and for the shim.
+ 'includes': [
+ '../../../../../build/common_untrusted.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'pnacl_support_extension',
+ 'type': 'none',
+ 'conditions': [
+ ['disable_nacl==0 and disable_nacl_untrusted==0', {
+ 'dependencies': [
+ '../../../../../ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:pnacl_irt_shim',
+ '../../../../../native_client/tools.gyp:prep_toolchain',
+ ],
+ 'sources': [
+ 'pnacl_info_template.json',
+ ],
+ # We could use 'copies', but we want to rename the files
+ # in a white-listed way first. Thus use a script.
+ 'actions': [
+ {
+ 'action_name': 'generate_pnacl_support_extension',
+ 'inputs': [
+ 'pnacl_component_crx_gen.py',
+ ],
+ 'conditions': [
+ # On windows we need both ia32 and x64.
+ ['OS=="win"', {
+ 'outputs': [
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_pnacl_json',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_crtbegin_o',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_crtbeginS_o',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_ld_nexe',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libcrt_platform_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libgcc_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libgcc_eh_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libpnacl_irt_shim_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_llc_nexe',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_crtbegin_o',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_crtbeginS_o',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_ld_nexe',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libcrt_platform_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libgcc_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libgcc_eh_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libpnacl_irt_shim_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_llc_nexe',
+ ],
+ 'inputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-32/libpnacl_irt_shim.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-64/libpnacl_irt_shim.a',
+ ],
+ 'variables': {
+ 'lib_overrides': [
+ # Use the two freshly generated shims.
+ '--lib_override=ia32,<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-32/libpnacl_irt_shim.a',
+ '--lib_override=x64,<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-64/libpnacl_irt_shim.a',
+ ],
+ },
+ }],
+ # Non-windows installers only need the matching architecture.
+ ['OS!="win"', {
+ 'conditions': [
+ ['target_arch=="arm"', {
+ 'outputs': [
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_pnacl_json',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_crtbegin_o',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_crtbeginS_o',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_ld_nexe',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_libcrt_platform_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_libgcc_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_libgcc_eh_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_libpnacl_irt_shim_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_arm_llc_nexe',
+ ],
+ 'inputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-arm/libpnacl_irt_shim.a',
+ ],
+ 'variables': {
+ 'lib_overrides': [
+ # Use the freshly generated shim.
+ '--lib_override=arm,<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-arm/libpnacl_irt_shim.a',
+ ],
+ },
+ }],
+ ['target_arch=="ia32"', {
+ 'outputs': [
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_pnacl_json',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_crtbegin_o',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_crtbeginS_o',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_ld_nexe',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libcrt_platform_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libgcc_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libgcc_eh_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_libpnacl_irt_shim_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_32_llc_nexe',
+ ],
+ 'inputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-32/libpnacl_irt_shim.a',
+ ],
+ 'variables': {
+ 'lib_overrides': [
+ # Use the freshly generated shim.
+ '--lib_override=ia32,<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-32/libpnacl_irt_shim.a',
+ ],
+ },
+ }],
+ ['target_arch=="x64"', {
+ 'outputs': [
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_pnacl_json',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_crtbegin_o',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_crtbeginS_o',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_ld_nexe',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libcrt_platform_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libgcc_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libgcc_eh_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_libpnacl_irt_shim_a',
+ '<(PRODUCT_DIR)/pnacl/pnacl_public_x86_64_llc_nexe',
+ ],
+ 'inputs': [
+ '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-64/libpnacl_irt_shim.a',
+ ],
+ 'variables': {
+ 'lib_overrides': [
+ # Use the freshly generated shim.
+ '--lib_override=x64,<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate/lib-x86-64/libpnacl_irt_shim.a',
+ ],
+ },
+ }],
+ ],
+ }],
+ ],
+ 'action': [
+ 'python', 'pnacl_component_crx_gen.py',
+ '--dest=<(PRODUCT_DIR)/pnacl',
+ '<@(lib_overrides)',
+ '--installer_only=<(target_arch)',
+ # ABI Version Number.
+ '0.0.0.1',
+ ],
+ },
+ ],
+ }],
+ ],
+ }],
+}