summaryrefslogtreecommitdiff
path: root/chromium/native_client
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@digia.com>2013-08-15 21:46:11 +0200
committerZeno Albisser <zeno.albisser@digia.com>2013-08-15 21:46:11 +0200
commit679147eead574d186ebf3069647b4c23e8ccace6 (patch)
treefc247a0ac8ff119f7c8550879ebb6d3dd8d1ff69 /chromium/native_client
downloadqtwebengine-chromium-679147eead574d186ebf3069647b4c23e8ccace6.tar.gz
Initial import.
Diffstat (limited to 'chromium/native_client')
-rw-r--r--chromium/native_client/build/all.gyp51
-rw-r--r--chromium/native_client/build/common.gypi854
-rwxr-xr-xchromium/native_client/build/configs.gypi154
-rwxr-xr-xchromium/native_client/build/external_code.gypi41
-rw-r--r--chromium/native_client/build/nacl_core_sdk.gyp82
-rw-r--r--chromium/native_client/build/standalone_flags.gypi16
-rwxr-xr-xchromium/native_client/build/untrusted.gypi1153
-rw-r--r--chromium/native_client/src/shared/gio/gio.gyp62
-rw-r--r--chromium/native_client/src/shared/imc/imc.gyp126
-rw-r--r--chromium/native_client/src/shared/ldr/ldr.gyp19
-rw-r--r--chromium/native_client/src/shared/platform/platform.gyp218
-rw-r--r--chromium/native_client/src/shared/serialization/serialization.gyp45
-rw-r--r--chromium/native_client/src/shared/srpc/srpc.gyp91
-rw-r--r--chromium/native_client/src/shared/utils/utils.gyp73
-rw-r--r--chromium/native_client/src/third_party_mod/gtest/gtest.gyp96
-rw-r--r--chromium/native_client/src/trusted/cpu_features/cpu_features.gyp86
-rw-r--r--chromium/native_client/src/trusted/debug_stub/debug_stub.gyp136
-rw-r--r--chromium/native_client/src/trusted/desc/desc.gyp258
-rw-r--r--chromium/native_client/src/trusted/fault_injection/fault_injection.gyp61
-rw-r--r--chromium/native_client/src/trusted/generic_container/generic_container.gyp56
-rw-r--r--chromium/native_client/src/trusted/gio/gio_wrapped_desc.gyp70
-rw-r--r--chromium/native_client/src/trusted/gio/gio_wrapped_desc_tests.gyp80
-rw-r--r--chromium/native_client/src/trusted/interval_multiset/interval_multiset.gyp58
-rw-r--r--chromium/native_client/src/trusted/manifest_name_service_proxy/manifest_name_service_proxy.gyp64
-rw-r--r--chromium/native_client/src/trusted/nacl_base/nacl_base.gyp60
-rw-r--r--chromium/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp127
-rw-r--r--chromium/native_client/src/trusted/nonnacl_util/nonnacl_util.gypi35
-rw-r--r--chromium/native_client/src/trusted/perf_counter/perf_counter.gyp45
-rw-r--r--chromium/native_client/src/trusted/perf_counter/perf_counter_tests.gyp47
-rw-r--r--chromium/native_client/src/trusted/platform_qualify/platform_qualify.gyp120
-rw-r--r--chromium/native_client/src/trusted/reverse_service/reverse_service.gyp71
-rw-r--r--chromium/native_client/src/trusted/sel_universal/sel_universal.gyp74
-rw-r--r--chromium/native_client/src/trusted/service_runtime/arch/x86/service_runtime_x86.gyp85
-rw-r--r--chromium/native_client/src/trusted/service_runtime/arch/x86_32/service_runtime_x86_32.gyp75
-rw-r--r--chromium/native_client/src/trusted/service_runtime/arch/x86_64/service_runtime_x86_64.gyp84
-rw-r--r--chromium/native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp217
-rw-r--r--chromium/native_client/src/trusted/service_runtime/service_runtime.gyp445
-rw-r--r--chromium/native_client/src/trusted/simple_service/simple_service.gyp67
-rw-r--r--chromium/native_client/src/trusted/threading/threading.gyp58
-rw-r--r--chromium/native_client/src/trusted/validator/driver/ncval.gyp26
-rw-r--r--chromium/native_client/src/trusted/validator/ncfileutils.gyp71
-rw-r--r--chromium/native_client/src/trusted/validator/validator.gyp72
-rw-r--r--chromium/native_client/src/trusted/validator/x86/32/validator_x86_32.gyp87
-rw-r--r--chromium/native_client/src/trusted/validator/x86/64/validator_x86_64.gyp94
-rw-r--r--chromium/native_client/src/trusted/validator/x86/decoder/ncdis_decode_tables.gyp71
-rw-r--r--chromium/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp181
-rw-r--r--chromium/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp140
-rw-r--r--chromium/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp179
-rw-r--r--chromium/native_client/src/trusted/validator/x86/validate_x86.gyp142
-rw-r--r--chromium/native_client/src/trusted/validator_arm/ncval.gyp42
-rw-r--r--chromium/native_client/src/trusted/validator_arm/validator_arm.gyp72
-rwxr-xr-xchromium/native_client/src/trusted/validator_mips/validator_mips.gyp91
-rw-r--r--chromium/native_client/src/trusted/validator_ragel/dfa_validator_x86_32.gyp31
-rw-r--r--chromium/native_client/src/trusted/validator_ragel/dfa_validator_x86_64.gyp40
-rw-r--r--chromium/native_client/src/trusted/validator_ragel/rdfa_validator.gyp22
-rw-r--r--chromium/native_client/src/trusted/validator_x86/ncval.gyp153
-rw-r--r--chromium/native_client/src/trusted/validator_x86/validator_x86.gyp79
-rw-r--r--chromium/native_client/src/trusted/weak_ref/weak_ref.gyp75
-rw-r--r--chromium/native_client/src/untrusted/irt/check_tls.gypi88
-rw-r--r--chromium/native_client/src/untrusted/irt/irt.gyp110
-rw-r--r--chromium/native_client/src/untrusted/irt/irt_test.gyp14
-rw-r--r--chromium/native_client/src/untrusted/minidump_generator/minidump_generator.gyp32
-rw-r--r--chromium/native_client/src/untrusted/nacl/nacl.gyp214
-rw-r--r--chromium/native_client/src/untrusted/nosys/nosys.gyp97
-rw-r--r--chromium/native_client/src/untrusted/pthread/pthread.gyp58
-rw-r--r--chromium/native_client/src/untrusted/valgrind/valgrind.gyp47
-rw-r--r--chromium/native_client/tests.gyp173
-rw-r--r--chromium/native_client/tests/sel_main_chrome/sel_main_chrome.gyp47
-rw-r--r--chromium/native_client/tools.gyp408
69 files changed, 8516 insertions, 0 deletions
diff --git a/chromium/native_client/build/all.gyp b/chromium/native_client/build/all.gyp
new file mode 100644
index 00000000000..567bef5a1e6
--- /dev/null
+++ b/chromium/native_client/build/all.gyp
@@ -0,0 +1,51 @@
+{
+ 'includes': [
+ 'common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'pull_in_all',
+ 'type': 'none',
+ 'dependencies': [
+ '../src/shared/gio/gio.gyp:*',
+ '../src/shared/imc/imc.gyp:*',
+ '../src/shared/platform/platform.gyp:*',
+ '../src/shared/serialization/serialization.gyp:*',
+ '../src/shared/srpc/srpc.gyp:*',
+ '../src/shared/utils/utils.gyp:*',
+ '../src/trusted/cpu_features/cpu_features.gyp:*',
+ '../src/trusted/debug_stub/debug_stub.gyp:*',
+ '../src/trusted/desc/desc.gyp:*',
+ '../src/trusted/nacl_base/nacl_base.gyp:*',
+ '../src/trusted/nonnacl_util/nonnacl_util.gyp:*',
+ '../src/trusted/perf_counter/perf_counter.gyp:*',
+ '../src/trusted/platform_qualify/platform_qualify.gyp:*',
+ '../src/trusted/sel_universal/sel_universal.gyp:*',
+ '../src/trusted/service_runtime/service_runtime.gyp:*',
+ '../src/untrusted/irt/irt.gyp:irt_core_nexe',
+ '../src/untrusted/irt/irt_test.gyp:*',
+ '../src/untrusted/minidump_generator/minidump_generator.gyp:*',
+ '../src/untrusted/nacl/nacl.gyp:*',
+ '../src/untrusted/nosys/nosys.gyp:*',
+ '../src/untrusted/pthread/pthread.gyp:*',
+ '../tests.gyp:*',
+ '../tests/sel_main_chrome/sel_main_chrome.gyp:*',
+ 'nacl_core_sdk.gyp:*',
+ ],
+ 'conditions': [
+ ['target_arch=="arm"', {
+ 'dependencies': [
+ '../src/trusted/validator_arm/validator_arm.gyp:*',
+ ],
+ }, {
+ 'dependencies': [
+ '../src/trusted/validator/driver/ncval.gyp:*',
+ '../src/trusted/validator_arm/ncval.gyp:*',
+ '../src/trusted/validator_x86/ncval.gyp:*',
+ '../src/trusted/validator_x86/validator_x86.gyp:*',
+ ],
+ }],
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/build/common.gypi b/chromium/native_client/build/common.gypi
new file mode 100644
index 00000000000..665e46e7c57
--- /dev/null
+++ b/chromium/native_client/build/common.gypi
@@ -0,0 +1,854 @@
+# 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.
+
+{
+ 'variables': {
+ # .gyp files should set chromium_code to 1 if they build Chromium-specific
+ # code, as opposed to external code. This variable is used to control
+ # such things as the set of warnings to enable, and whether warnings are
+ # treated as errors.
+ 'chromium_code%': 0,
+
+ # Variables expected to be overriden on the GYP command line (-D) or by
+ # ~/.gyp/include.gypi.
+
+ # Override chromium_mac_pch and set it to 0 to suppress the use of
+ # precompiled headers on the Mac. Prefix header injection may still be
+ # used, but prefix headers will not be precompiled. This is useful when
+ # using distcc to distribute a build to compile slaves that don't
+ # share the same compiler executable as the system driving the compilation,
+ # because precompiled headers rely on pointers into a specific compiler
+ # executable's image. Setting this to 0 is needed to use an experimental
+ # Linux-Mac cross compiler distcc farm.
+ 'chromium_mac_pch%': 1,
+
+ # Enable building with ASAN (Clang's -fsanitize=address option).
+ # -fsanitize=address only works with clang, but asan=1 implies clang=1
+ # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
+ 'asan%': 0,
+
+ # Set this to true when building with Clang.
+ 'clang%': 0,
+
+ # Set to 1 to enable code coverage. In addition to build changes
+ # (e.g. extra CFLAGS), also creates a new target in the src/chrome
+ # project file called "coverage".
+ # Currently ignored on Windows.
+ 'coverage%': 0,
+
+ # TODO(sgk): eliminate this if possible.
+ # It would be nicer to support this via a setting in 'target_defaults'
+ # in chrome/app/locales/locales.gypi overriding the setting in the
+ # 'Debug' configuration in the 'target_defaults' dict below,
+ # but that doesn't work as we'd like.
+ 'msvs_debug_link_incremental%': '2',
+
+ # NOTE: adapted from them chrome common.gypi file for arm
+ 'armv7%': 0,
+
+ # Set Neon compilation flags (only meaningful if armv7==1).
+ 'arm_neon%': 1,
+
+ # Set Thumb compilation flags.
+ 'arm_thumb%': 0,
+
+ # Set ARM fpu compilation flags (only meaningful if armv7==1 and
+ # arm_neon==0).
+ 'arm_fpu%': 'vfpv3',
+
+ # Set ARM float abi compilation flag.
+ 'arm_float_abi%': 'softfp',
+
+ # Version of the mac sdk to use.
+ 'mac_sdk%': '10.6',
+
+ # NOTE: end adapted from them chrome common.gypi file for arm
+
+ # Doing this in a sub-dict so that it can be referred to below.
+ 'variables': {
+ # By default we assume that we are building as part of Chrome
+ 'variables': {
+ 'nacl_standalone%': 0,
+
+ # Override branding to select the desired branding flavor.
+ 'branding%': 'Chromium',
+
+ # Override buildtype to select the desired build flavor.
+ # Dev - everyday build for development/testing
+ # Official - release build (generally implies additional processing)
+ # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
+ # conversion is done), some of the things which are now controlled by
+ # 'branding', such as symbol generation, will need to be refactored
+ # based on 'buildtype' (i.e. we don't care about saving symbols for
+ # non-Official builds).
+ 'buildtype%': 'Dev',
+
+ 'conditions': [
+ # Compute the architecture that we're building for. Default to the
+ # architecture that we're building on.
+ ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
+ # This handles the Linux platforms we generally deal with. Anything
+ # else gets passed through, which probably won't work very well;
+ # such hosts should pass an explicit target_arch to gyp.
+ #
+ # NOTE: currently only nacl is generating gyp files on an arm board.
+ # The arm.* -> arm substitution in chrome's common.gypi isn't
+ # appropriate in that context as we actually use target_arch==arm
+ # to me x86 -> arm cross compile. When actually running on an arm
+ # board, we'll generate ia32 for now, so that the generation
+ # succeeds.
+ 'target_arch%':
+ '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/ia32/")'
+ }, { # OS!="linux"
+ 'target_arch%': 'ia32',
+ }],
+ ]
+ },
+ # These come from the above variable scope.
+ 'nacl_standalone%': '<(nacl_standalone)',
+ 'target_arch%': '<(target_arch)',
+ 'branding%': '<(branding)',
+ 'buildtype%': '<(buildtype)',
+
+ 'conditions': [
+ # The system root for cross-compiles. Default: none.
+ # If we are building in chrome we want to rely on chrome's default, which
+ # means we can't set a default here.
+ ['nacl_standalone!=0', {
+ 'sysroot%': '',
+ }],
+ ],
+
+ # This variable is to allow us to build components as either static
+ # libraries or dynamic shared libraries.
+ 'component%': 'static_library',
+ },
+ # These come from the above variable scope.
+ 'target_arch%': '<(target_arch)',
+ 'sysroot%': '<(sysroot)',
+ 'nacl_standalone%': '<(nacl_standalone)',
+ 'branding%': '<(branding)',
+ 'buildtype%': '<(buildtype)',
+ 'component%': '<(component)',
+
+ 'nacl_strict_warnings%': 1,
+ 'nacl_validator_ragel%': 1,
+
+ 'linux2%': 0,
+ 'conditions': [
+ ['OS=="win"', {
+ 'python_exe': [
+ 'call <(DEPTH)/native_client/tools/win_py.cmd'
+ ],
+ }, {
+ 'python_exe': [
+ 'python'
+ ],
+ }],
+ ],
+ },
+
+ 'target_defaults': {
+ 'include_dirs': [
+ # Putting this first so that people who include "ppapi/..." get the
+ # third_party version instead of any other version (the chrome location
+ # for instance).
+ '../src/third_party',
+ '../..',
+ ],
+ 'variables': {
+ 'win_target': 'x32',
+ },
+ 'target_conditions': [
+ ['win_target=="x64"', {
+ 'target_arch': 'x64',
+ 'defines!': [
+ 'NACL_TARGET_SUBARCH=32',
+ 'NACL_BUILD_SUBARCH=32',
+ ],
+ 'defines': [
+ 'NACL_TARGET_SUBARCH=64',
+ 'NACL_BUILD_SUBARCH=64',
+ ],
+ 'configurations': {
+ 'Common_Base': {
+ 'msvs_target_platform': 'x64',
+ },
+ },
+ }],
+ ],
+ 'conditions': [
+ # TODO(gregoryd): split target and build subarchs
+ ['target_arch=="ia32"', {
+ 'defines': [
+ 'NACL_TARGET_SUBARCH=32',
+ 'NACL_TARGET_ARCH=x86',
+ 'NACL_BUILD_SUBARCH=32',
+ 'NACL_BUILD_ARCH=x86',
+ ],
+ }],
+ ['target_arch=="x64"', {
+ 'defines': [
+ 'NACL_TARGET_SUBARCH=64',
+ 'NACL_TARGET_ARCH=x86',
+ 'NACL_BUILD_SUBARCH=64',
+ 'NACL_BUILD_ARCH=x86',
+ ],
+ }],
+ ['target_arch=="arm"', {
+ 'defines': [
+ 'NACL_BUILD_ARCH=arm',
+ 'NACL_BUILD_SUBARCH=32',
+ 'NACL_TARGET_ARCH=arm',
+ 'NACL_TARGET_SUBARCH=32',
+ ],
+ }],
+ ['linux2==1', {
+ 'defines': ['LINUX2=1'],
+ }],
+ ['OS=="win"', {
+ 'defines': [ 'NOMINMAX' ]
+ }],
+ ['coverage!=0', {
+ 'conditions': [
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES',
+ 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES',
+ },
+ # Add -lgcov for executables, not for static_libraries.
+ # This is a delayed conditional.
+ 'target_conditions': [
+ ['_type=="executable"', {
+ 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
+ }],
+ ],
+ }],
+ # Linux gyp (into scons) doesn't like target_conditions?
+ # TODO(???): track down why 'target_conditions' doesn't work
+ # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
+ ['OS=="linux"', {
+ 'cflags': [ '-ftest-coverage',
+ '-fprofile-arcs'],
+ 'link_settings': { 'libraries': [ '-lgcov' ] },
+ }],
+ ],
+ # TODO(jrg): options for code coverage on Windows
+ }],
+ ['clang==1', {
+ 'cflags': [
+ '-Wheader-hygiene',
+ # Clang spots more unused functions.
+ '-Wno-unused-function',
+ # Don't die on dtoa code that uses a char as an array index.
+ '-Wno-char-subscripts',
+ # Especially needed for gtest macros using enum values from Mac
+ # system headers.
+ # TODO(pkasting): In C++11 this is legal, so this should be
+ # removed when we change to that. (This is also why we don't
+ # bother fixing all these cases today.)
+ '-Wno-unnamed-type-template-args',
+ # Allow 'default' label in switch even when all enumeration
+ # cases have been covered.
+ '-Wno-covered-switch-default',
+ # Allow C++11 extensions (for "override")
+ '-Wno-c++11-extensions',
+ ],
+ 'cflags!': [
+ # Clang doesn't seem to know know this flag.
+ '-mfpmath=sse',
+ ],
+ }],
+ ],
+ },
+ 'conditions': [
+ ['OS=="linux"', {
+ 'target_defaults': {
+ # Enable -Werror by default, but put it in a variable so it can
+ # be disabled in ~/.gyp/include.gypi on the valgrind builders.
+ 'variables': {
+ 'werror%': '-Werror',
+ },
+ 'cflags': [
+ '<(werror)', # See note above about the werror variable.
+ '-pthread',
+ '-fno-exceptions',
+ '-Wall', # TODO(bradnelson): why does this disappear?!?
+ ],
+ 'conditions': [
+ ['nacl_standalone==1 and OS=="linux"', {
+ 'cflags': ['-fPIC'],
+ }],
+ ['nacl_standalone==1 and nacl_strict_warnings==1', {
+ # TODO(gregoryd): remove the condition when the issues in
+ # Chrome code are fixed.
+ 'cflags': [
+ # TODO(bradnelson): This was being masked by key naming
+ # collisions. Track down the items blocking enabling this.
+ #'-pedantic',
+ '-Wextra',
+ '-Wno-long-long',
+ '-Wswitch-enum',
+ '-Wsign-compare',
+ '-Wundef',
+ '-fdiagnostics-show-option',
+ ],
+ 'cflags_c': [
+ # Require defining functions as "foo(void)" rather than
+ # "foo()" because, in C (but not C++), the latter
+ # defines a function with unspecified arguments rather
+ # than no arguments.
+ '-Wstrict-prototypes',
+ ],
+ }],
+ [ 'target_arch=="arm"', {
+ 'cflags': [
+ '-Wno-abi',
+ '-fno-exceptions',
+ '-Wall',
+ '-fPIC',
+ '--sysroot=<(sysroot)',
+ ],
+ 'ldflags': [
+ '--sysroot=<(sysroot)',
+ ],
+ # TODO(mcgrathr): This is copied from the arm section of
+ # chromium/src/build/common.gypi, but these details really
+ # should be more fully harmonized and shared.
+ 'conditions': [
+ ['arm_thumb==1', {
+ 'cflags': [
+ '-mthumb',
+ ]
+ }],
+ ['armv7==1', {
+ 'cflags': [
+ '-march=armv7-a',
+ '-mtune=cortex-a9',
+ '-mfloat-abi=<(arm_float_abi)',
+ ],
+ 'conditions': [
+ ['arm_neon==1', {
+ 'cflags': [ '-mfpu=neon', ],
+ }, {
+ 'cflags': [ '-mfpu=<(arm_fpu)', ],
+ }]
+ ],
+ }],
+ ],
+ }, { # else: target_arch != "arm"
+ 'conditions': [
+ ['target_arch=="x64"', {
+ 'variables': {
+ 'mbits_flag': '-m64',
+ },
+ }, {
+ 'variables': {
+ 'mbits_flag': '-m32',
+ }
+ },],
+ ],
+ 'asflags': [
+ '<(mbits_flag)',
+ ],
+ 'cflags': [
+ '<(mbits_flag)',
+ '-fno-exceptions',
+ '-Wall',
+ ],
+ 'ldflags': [
+ '<(mbits_flag)',
+ ],
+ }],
+ ],
+ 'cflags_cc': [
+ '-fno-rtti',
+ '-fno-threadsafe-statics',
+ ],
+ 'ldflags': [
+ '-pthread',
+ '-Wl,-z,noexecstack',
+ ],
+ 'defines': [
+ 'NACL_LINUX=1',
+ 'NACL_ANDROID=0',
+ 'NACL_OSX=0',
+ 'NACL_WINDOWS=0',
+ '_BSD_SOURCE=1',
+ '_POSIX_C_SOURCE=199506',
+ '_XOPEN_SOURCE=600',
+ '_GNU_SOURCE=1',
+ '__STDC_LIMIT_MACROS=1',
+ ],
+ 'link_settings': {
+ 'libraries': [
+ '-lrt',
+ '-lpthread',
+ ],
+ },
+ 'scons_variable_settings': {
+ 'LIBPATH': ['$LIB_DIR'],
+ # Linking of large files uses lots of RAM, so serialize links
+ # using the handy flock command from util-linux.
+ 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
+ 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
+ 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
+
+ # We have several cases where archives depend on each other in
+ # a cyclic fashion. Since the GNU linker does only a single
+ # pass over the archives we surround the libraries with
+ # --start-group and --end-group (aka -( and -) ). That causes
+ # ld to loop over the group until no more undefined symbols
+ # are found. In an ideal world we would only make groups from
+ # those libraries which we knew to be in cycles. However,
+ # that's tough with SCons, so we bodge it by making all the
+ # archives a group by redefining the linking command here.
+ #
+ # TODO: investigate whether we still have cycles that
+ # require --{start,end}-group. There has been a lot of
+ # refactoring since this was first coded, which might have
+ # eliminated the circular dependencies.
+ #
+ # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
+ # so that we prefer our own built libraries (e.g. -lpng) to
+ # system versions of libraries that pkg-config might turn up.
+ # TODO(sgk): investigate handling this not by re-ordering the
+ # flags this way, but by adding a hook to use the SCons
+ # ParseFlags() option on the output from pkg-config.
+ 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET', '$_LIBDIRFLAGS',
+ '$LINKFLAGS', '$SOURCES', '-Wl,--start-group',
+ '$_LIBFLAGS', '-Wl,--end-group']],
+ 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET', '$_LIBDIRFLAGS',
+ '$SHLINKFLAGS', '$SOURCES', '-Wl,--start-group',
+ '$_LIBFLAGS', '-Wl,--end-group']],
+ 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET', '$_LIBDIRFLAGS',
+ '$LDMODULEFLAGS', '$SOURCES', '-Wl,--start-group',
+ '$_LIBFLAGS', '-Wl,--end-group']],
+ 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
+ # -rpath is only used when building with shared libraries.
+ 'conditions': [
+ [ 'component=="shared_library"', {
+ 'RPATH': '$LIB_DIR',
+ }],
+ ],
+ },
+ 'scons_import_variables': [
+ 'AS',
+ 'CC',
+ 'CXX',
+ 'LINK',
+ ],
+ 'scons_propagate_variables': [
+ 'AS',
+ 'CC',
+ 'CCACHE_DIR',
+ 'CXX',
+ 'DISTCC_DIR',
+ 'DISTCC_HOSTS',
+ 'HOME',
+ 'INCLUDE_SERVER_ARGS',
+ 'INCLUDE_SERVER_PORT',
+ 'LINK',
+ 'CHROME_BUILD_TYPE',
+ 'CHROMIUM_BUILD',
+ 'OFFICIAL_BUILD',
+ ],
+ 'configurations': {
+ 'Debug': {
+ 'variables': {
+ 'debug_optimize%': '0',
+ },
+ 'defines': [
+ '_DEBUG',
+ ],
+ 'cflags': [
+ '-O<(debug_optimize)',
+ '-g',
+ # One can use '-gstabs' to enable building the debugging
+ # information in STABS format for breakpad's dumpsyms.
+ ],
+ 'ldflags': [
+ '-rdynamic', # Allows backtrace to resolve symbols.
+ ],
+ },
+ 'Release': {
+ 'variables': {
+ 'release_optimize%': '2',
+ },
+ 'cflags': [
+ '-O<(release_optimize)',
+ # Don't emit the GCC version ident directives, they just end up
+ # in the .comment section taking up binary size.
+ '-fno-ident',
+ # Put data and code in their own sections, so that unused symbols
+ # can be removed at link time with --gc-sections.
+ '-fdata-sections',
+ '-ffunction-sections',
+ ],
+ 'conditions': [
+ ['clang==1', {
+ 'cflags!': [
+ '-fno-ident',
+ ],
+ }],
+ ],
+ },
+ },
+ 'variants': {
+ 'coverage': {
+ 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
+ 'ldflags': ['-fprofile-arcs'],
+ },
+ 'profile': {
+ 'cflags': ['-pg', '-g'],
+ 'ldflags': ['-pg'],
+ },
+ 'symbols': {
+ 'cflags': ['-g'],
+ },
+ },
+ },
+ }],
+ ['OS=="mac"', {
+ 'target_defaults': {
+ 'variables': {
+ # This should be 'mac_real_dsym%', but there seems to be a bug
+ # with % in variables that are intended to be set to different
+ # values in different targets, like this one.
+ 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
+ },
+ 'mac_bundle': 0,
+ 'xcode_settings': {
+ 'ALWAYS_SEARCH_USER_PATHS': 'NO',
+ 'GCC_C_LANGUAGE_STANDARD': 'gnu99',
+ 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
+ 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
+ # (Equivalent to -fPIC)
+ 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
+ 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
+ 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
+ 'GCC_INLINES_ARE_PRIVATE_EXTERN':
+ 'YES', # -fvisibility-inlines-hidden
+ 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
+ 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
+ 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
+ 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
+ # Don't set GCC_VERSION so that we default to /usr/bin/gcc
+ #'GCC_VERSION': '4.2',
+ 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
+ 'PREBINDING': 'NO', # No -Wl,-prebind
+ 'USE_HEADERMAP': 'NO',
+ # TODO(bradnelson): -Werror ?!?
+ 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels', '-Wno-long-long'],
+ 'conditions': [
+ ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
+ {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}],
+ ['clang==1', {
+ 'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
+ 'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
+ 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
+ 'WARNING_CFLAGS': [
+ '-Wheader-hygiene',
+ # Don't die on dtoa code that uses a char as an array index.
+ # This is required solely for base/third_party/dmg_fp/dtoa.cc.
+ '-Wno-char-subscripts',
+ # Clang spots more unused functions.
+ '-Wno-unused-function',
+ # See comments on this flag higher up in this file.
+ '-Wno-unnamed-type-template-args',
+ # Allow 'default' label in switch even when all enumeration
+ # cases have been covered.
+ '-Wno-covered-switch-default',
+ # Allow C++11 extensions (for "override")
+ '-Wno-c++11-extensions',
+ # TODO(thakis): Reenable once the one instance this warns on
+ # is fixed.
+ '-Wno-parentheses',
+ ],
+ }],
+ ['nacl_standalone==1', {
+ # If part of the Chromium build, use the Chromium default.
+ # Otherwise, when building standalone, use this.
+ 'MACOSX_DEPLOYMENT_TARGET': '<(mac_sdk)', # -mmacosx-version-min
+ 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
+ }],
+ ],
+ },
+ 'conditions': [
+ ['clang==1', {
+ 'variables': {
+ 'clang_dir':
+ '<(DEPTH)/third_party/llvm-build/Release+Asserts/bin',
+ },
+ }],
+ ['nacl_standalone==1 and nacl_strict_warnings==1', {
+ 'xcode_settings': {
+ # TODO(gregoryd): remove the condition when the issues in
+ # Chrome code are fixed.
+ 'WARNING_CFLAGS': [
+ '-pedantic',
+ '-Wextra',
+ '-Wno-long-long',
+ '-Wswitch-enum',
+ '-Wsign-compare',
+ '-Wundef',
+ '-fdiagnostics-show-option',
+ ],
+ },
+ }],
+ ['nacl_standalone==1', {
+ 'target_conditions': [
+ ['_type!="static_library"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
+ }],
+ ['_mac_bundle', {
+ 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
+ }],
+ ['_type=="executable"', {
+ 'target_conditions': [
+ ['mac_real_dsym == 1', {
+ # To get a real .dSYM bundle produced by dsymutil, set the
+ # debug information format to dwarf-with-dsym. Since
+ # strip_from_xcode will not be used, set Xcode to do the
+ # stripping as well.
+ 'configurations': {
+ 'Release': {
+ 'xcode_settings': {
+ 'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
+ 'DEPLOYMENT_POSTPROCESSING': 'YES',
+ 'STRIP_INSTALLED_PRODUCT': 'YES',
+ },
+ },
+ },
+ }, { # mac_real_dsym != 1
+ # To get a fast fake .dSYM bundle, use a post-build step to
+ # produce the .dSYM and strip the executable. strip_from_xcode
+ # only operates in the Release configuration.
+ 'postbuilds': [
+ {
+ 'variables': {
+ # Define strip_from_xcode in a variable ending in _path
+ # so that gyp understands it's a path and performs proper
+ # relativization during dict merging.
+ 'strip_from_xcode_path':
+ 'mac/strip_from_xcode',
+ },
+ 'postbuild_name': 'Strip If Needed',
+ 'action': ['<(strip_from_xcode_path)'],
+ },
+ ],
+ }],
+ ],
+ }],
+ ],
+ }],
+ ],
+ 'defines': [
+ 'NACL_LINUX=0',
+ 'NACL_ANDROID=0',
+ 'NACL_OSX=1',
+ 'NACL_WINDOWS=0',
+ ],
+ },
+ }],
+ ['OS=="win"', {
+ 'target_defaults': {
+ 'variables': {
+ 'windows_asm_rule%': 1,
+ },
+ 'target_conditions': [
+ ['windows_asm_rule==1', {
+ 'rules': [
+ {
+ 'rule_name': 'assembler (gnu-compatible)',
+ 'msvs_cygwin_shell': 0,
+ 'msvs_quote_cmd': 0,
+ 'extension': 'S',
+ 'inputs': [
+ '<(DEPTH)/native_client/tools/win_as.py',
+ '$(InputPath)'
+ ],
+ 'outputs': [
+ '$(IntDir)/$(InputName).obj',
+ ],
+ 'action': [
+ '<@(python_exe)',
+ '<(DEPTH)/native_client/tools/win_as.py',
+ # target architecture: Win32 or x64
+ '-a', '$(PlatformName)',
+ # output path
+ '-o', '$(IntDir)/$(InputName).obj',
+ # path to top of tree, e.g. svn/nacl
+ '-p', '<(DEPTH)',
+ # .S file
+ '$(InputPath)'
+ ],
+ 'message': 'Building assembly language file $(InputPath)',
+ 'process_outputs_as_sources': 1,
+ },
+ ],
+ }],
+ ],
+ 'defines': [
+ '_WIN32_WINNT=0x0600',
+ 'WINVER=0x0600',
+ # WIN32 is used by ppapi
+ 'WIN32',
+ 'NOMINMAX',
+ '_CRT_RAND_S',
+ 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
+ # WIN32_LEAN_AND_MEAN tells windows.h to omit obsolete and rarely
+ # used #include files. This allows use of Winsock 2.0 which otherwise
+ # would conflict with Winsock 1.x included by windows.h.
+ 'WIN32_LEAN_AND_MEAN',
+ '_SECURE_ATL',
+ '__STDC_LIMIT_MACROS=1',
+
+ 'NACL_LINUX=0',
+ 'NACL_ANDROID=0',
+ 'NACL_OSX=0',
+ 'NACL_WINDOWS=1'
+ ],
+ 'conditions': [
+ ['component=="static_library"', {
+ 'defines': [
+ '_HAS_EXCEPTIONS=0',
+ ],
+ }],
+ ['MSVS_VERSION=="2008"', {
+ 'defines': [
+ '_HAS_TR1=0',
+ ],
+ }],
+ ],
+ 'msvs_cygwin_dirs': ['../third_party/cygwin'],
+ # TODO(bsy) remove 4355 once cross-repo
+ # NACL_ALLOW_THIS_IN_INITIALIZER_LIST changes go in.
+ 'msvs_disabled_warnings': [4355, 4396, 4503, 4800, 4819],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'MinimalRebuild': 'false',
+ 'BufferSecurityCheck': 'true',
+ 'EnableFunctionLevelLinking': 'true',
+ 'RuntimeTypeInfo': 'false',
+ 'WarningLevel': '3',
+ 'WarnAsError': 'true',
+ 'DebugInformationFormat': '3',
+
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'ExceptionHandling': '1', # /EHsc
+ }, {
+ 'ExceptionHandling': '0',
+ }],
+ ],
+ },
+ 'VCLibrarianTool': {
+ 'AdditionalOptions': ['/ignore:4221'],
+ },
+ 'VCLinkerTool': {
+ 'AdditionalOptions': [
+ '/safeseh:NO',
+ '/dynamicbase:NO',
+ '/ignore:4199',
+ '/ignore:4221',
+ '/nxcompat',
+ ],
+ 'AdditionalDependencies': [
+ 'wininet.lib',
+ 'version.lib',
+ 'msimg32.lib',
+ 'ws2_32.lib',
+ 'usp10.lib',
+ 'psapi.lib',
+ 'dbghelp.lib',
+ ],
+ 'DelayLoadDLLs': [
+ 'dbghelp.dll',
+ 'dwmapi.dll',
+ 'uxtheme.dll',
+ ],
+ 'GenerateDebugInformation': 'true',
+ 'MapFileName': '$(OutDir)\\$(TargetName).map',
+ 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
+ 'TargetMachine': '1',
+ 'FixedBaseAddress': '1',
+ # SubSystem values:
+ # 0 == not set
+ # 1 == /SUBSYSTEM:CONSOLE
+ # 2 == /SUBSYSTEM:WINDOWS
+ # Most of the executables we'll ever create are tests
+ # and utilities with console output.
+ 'SubSystem': '1',
+ },
+ 'VCMIDLTool': {
+ 'GenerateStublessProxies': 'true',
+ 'TypeLibraryName': '$(InputName).tlb',
+ 'OutputDirectory': '$(IntDir)',
+ 'HeaderFileName': '$(InputName).h',
+ 'DLLDataFileName': 'dlldata.c',
+ 'InterfaceIdentifierFileName': '$(InputName)_i.c',
+ 'ProxyFileName': '$(InputName)_p.c',
+ },
+ 'VCResourceCompilerTool': {
+ 'Culture' : '1033',
+ 'AdditionalIncludeDirectories': ['<(DEPTH)'],
+ },
+ },
+ },
+ }],
+ ['chromium_code==0 and nacl_standalone==0', {
+ # This section must follow the other conditon sections above because
+ # external_code.gypi expects to be merged into those settings.
+ 'includes': [
+ 'external_code.gypi',
+ ],
+ }, {
+ 'target_defaults': {
+ # In Chromium code, we define __STDC_FORMAT_MACROS in order to get the
+ # C99 macros on Mac and Linux.
+ 'defines': [
+ '__STDC_FORMAT_MACROS',
+ ],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'Detect64BitPortabilityProblems': 'false',
+ # TODO(new_hire): above line should go away
+ },
+ },
+ },
+ }],
+ ['clang==1 and nacl_standalone==1', {
+ 'make_global_settings': [
+ ['CC', 'third_party/llvm-build/Release+Asserts/bin/clang'],
+ ['CXX', 'third_party/llvm-build/Release+Asserts/bin/clang++'],
+ ['LINK', '$(CXX)'],
+ ['CC.host', '$(CC)'],
+ ['CXX.host', '$(CXX)'],
+ ['LINK.host', '$(LINK)'],
+ ],
+ }],
+ ],
+ 'scons_settings': {
+ 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
+ },
+ 'xcode_settings': {
+ # The Xcode generator will look for an xcode_settings section at the root
+ # of each dict and use it to apply settings on a file-wide basis. Most
+ # settings should not be here, they should be in target-specific
+ # xcode_settings sections, or better yet, should use non-Xcode-specific
+ # settings in target dicts. SYMROOT is a special case, because many other
+ # Xcode variables depend on it, including variables such as
+ # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
+ # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
+ # files to appear (when present) in the UI as actual files and not red
+ # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
+ # and therefore SYMROOT, needs to be set at the project level.
+ 'SYMROOT': '<(DEPTH)/xcodebuild',
+ },
+ 'includes': [
+ 'untrusted.gypi',
+ ],
+}
diff --git a/chromium/native_client/build/configs.gypi b/chromium/native_client/build/configs.gypi
new file mode 100755
index 00000000000..c3564b4cf80
--- /dev/null
+++ b/chromium/native_client/build/configs.gypi
@@ -0,0 +1,154 @@
+# Copyright (c) 2011 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.
+
+{
+ 'target_defaults': {
+ 'default_configuration': 'Debug',
+ 'configurations': {
+ #
+ # Abstract base configurations to cover common
+ # attributes.
+ #
+ # Currently only implemented for Windows.
+ #
+ 'Common_Base': {
+ 'abstract': 1,
+ 'msvs_configuration_attributes': {
+ 'OutputDirectory':
+ '<(DEPTH)\\native_client\\build\\$(ConfigurationName)',
+ 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
+ 'CharacterSet': '1',
+ },
+ },
+ 'x86_Base': {
+ 'abstract': 1,
+ 'configuration_platform': 'Win32',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'TargetMachine': '1', # x86 - 32
+ },
+ },
+ },
+ 'x64_Base': {
+ 'abstract': 1,
+ 'msvs_configuration_platform': 'x64',
+ 'msvs_settings': {
+ 'VCLinkerTool': {
+ 'TargetMachine': '17', # x86 - 64
+ 'AdditionalLibraryDirectories!':
+ ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
+ 'AdditionalLibraryDirectories':
+ ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
+ },
+ 'VCLibrarianTool': {
+ 'AdditionalLibraryDirectories!':
+ ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
+ 'AdditionalLibraryDirectories':
+ ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
+ },
+ },
+ },
+ 'Debug_Base': {
+ 'abstract': 1,
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'Optimization': '0',
+ 'PreprocessorDefinitions': ['_DEBUG'],
+ 'BasicRuntimeChecks': '3',
+
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'RuntimeLibrary': '3', # 3 = /MDd (debug DLL)
+ }, {
+ 'RuntimeLibrary': '1', # 1 = /MTd (debug static)
+ }],
+ ],
+ },
+ # VCLinkerTool LinkIncremental values below:
+ # 0 == default
+ # 1 == /INCREMENTAL:NO
+ # 2 == /INCREMENTAL
+ # Debug links incremental, Release does not.
+ 'VCLinkerTool': {
+ 'LinkIncremental': '<(msvs_debug_link_incremental)',
+ },
+ 'VCResourceCompilerTool': {
+ 'PreprocessorDefinitions': ['_DEBUG'],
+ },
+ },
+ },
+ 'Release_Base': {
+ 'abstract': 1,
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'PreprocessorDefinitions': ['NDEBUG'],
+ 'Optimization': '2',
+ 'StringPooling': 'true',
+
+ 'conditions': [
+ ['component=="shared_library"', {
+ 'RuntimeLibrary': '2', # 2 = /MD (nondebug DLL)
+ }, {
+ 'RuntimeLibrary': '0', # 0 = /MT (nondebug static)
+ }],
+ ],
+ },
+ 'VCLinkerTool': {
+ 'LinkIncremental': '1',
+ 'OptimizeReferences': '2',
+ 'EnableCOMDATFolding': '2',
+ 'OptimizeForWindows98': '1',
+ },
+ 'VCResourceCompilerTool': {
+ 'PreprocessorDefinitions': ['NDEBUG'],
+ },
+ },
+ },
+ #
+ # Concrete configurations
+ #
+ #
+ 'Debug': {
+ 'conditions': [
+ [ 'OS=="mac"', {
+ 'xcode_settings': {
+ 'COPY_PHASE_STRIP': 'NO',
+ 'GCC_OPTIMIZATION_LEVEL': '0',
+ }
+ }],
+ [ 'OS=="win"', {
+ # On Windows, the default Debug target is x86
+ 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base']
+ }],
+ ],
+ },
+ 'Release': {
+ 'defines': [
+ 'NDEBUG',
+ ],
+ 'conditions': [
+ [ 'OS=="mac"', {
+ 'xcode_settings': {
+ 'DEAD_CODE_STRIPPING': 'YES',
+ }
+ }],
+ [ 'OS=="win"', {
+ # On Windows, the default Release target is x86
+ 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base']
+ }],
+ ],
+ },
+ 'conditions': [
+ ['OS=="win"', {
+ 'Debug_x64': {
+ 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
+ },
+ 'Release_x64': {
+ 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
+ },
+ }],
+ ],
+ },
+ },
+}
diff --git a/chromium/native_client/build/external_code.gypi b/chromium/native_client/build/external_code.gypi
new file mode 100755
index 00000000000..053fb61cfd6
--- /dev/null
+++ b/chromium/native_client/build/external_code.gypi
@@ -0,0 +1,41 @@
+# Copyright (c) 2009 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.
+
+{
+ 'conditions': [
+ [ 'OS=="linux"', {
+ 'target_defaults': {
+ 'cflags!': [
+ '-Wall',
+ '-Werror',
+ ],
+ },
+ }],
+ [ 'OS=="win"', {
+ 'target_defaults': {
+ 'defines': [
+ '_CRT_SECURE_NO_DEPRECATE',
+ '_CRT_NONSTDC_NO_WARNINGS',
+ '_CRT_NONSTDC_NO_DEPRECATE',
+ '_SCL_SECURE_NO_DEPRECATE',
+ ],
+ 'msvs_disabled_warnings': [4800],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'WarnAsError': 'false',
+ 'Detect64BitPortabilityProblems': 'false',
+ },
+ },
+ },
+ }],
+ [ 'OS=="mac"', {
+ 'target_defaults': {
+ 'xcode_settings': {
+ 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
+ 'WARNING_CFLAGS!': ['-Wall'],
+ },
+ },
+ }],
+ ],
+}
diff --git a/chromium/native_client/build/nacl_core_sdk.gyp b/chromium/native_client/build/nacl_core_sdk.gyp
new file mode 100644
index 00000000000..81bca322986
--- /dev/null
+++ b/chromium/native_client/build/nacl_core_sdk.gyp
@@ -0,0 +1,82 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ 'common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'nacl_core_sdk',
+ 'type': 'none',
+ 'dependencies': [
+ '../src/untrusted/minidump_generator/minidump_generator.gyp:minidump_generator_lib',
+ '../src/untrusted/nacl/nacl.gyp:nacl_dynacode_lib',
+ '../src/untrusted/nacl/nacl.gyp:nacl_exception_lib',
+ '../src/untrusted/nacl/nacl.gyp:nacl_lib',
+ '../src/untrusted/nacl/nacl.gyp:nacl_list_mappings_lib',
+ '../src/untrusted/nosys/nosys.gyp:nosys_lib',
+ '../src/untrusted/pthread/pthread.gyp:pthread_lib',
+ ],
+ 'conditions': [
+ ['target_arch!="arm"', {
+ 'dependencies': [
+ # sel_ldr and irt are host-only and not needed when building the
+ # arm components of the SDK.
+ '../src/untrusted/irt/irt.gyp:irt_core_nexe',
+ '../src/trusted/service_runtime/service_runtime.gyp:sel_ldr',
+ # these libraries don't currently exist on arm
+ '../src/untrusted/valgrind/valgrind.gyp:dynamic_annotations_lib',
+ '../src/untrusted/valgrind/valgrind.gyp:valgrind_lib',
+ ],
+ 'copies': [
+ {
+ 'destination': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/x86_64-nacl/lib32',
+ 'files': [
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/crti.o',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/crtn.o',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libnacl_dyncode.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libnacl_list_mappings.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libnosys.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libpthread.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32/libvalgrind.a',
+ ],
+ },
+ {
+ 'destination': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/x86_64-nacl/lib',
+ 'files': [
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/crti.o',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/crtn.o',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libnacl_dyncode.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libnacl_list_mappings.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libnosys.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libpthread.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64/libvalgrind.a',
+ ],
+ },
+ {
+ 'destination': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/x86_64-nacl/lib32',
+ 'files': [
+ '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libnacl_dyncode.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libnacl_list_mappings.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libvalgrind.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32/libdynamic_annotations.a',
+ ],
+ },
+ {
+ 'destination': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/x86_64-nacl/lib',
+ 'files': [
+ '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libnacl_dyncode.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libnacl_list_mappings.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libvalgrind.a',
+ '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64/libdynamic_annotations.a',
+ ],
+ },
+ ],
+ }],
+ ],
+ },
+ ],
+}
+
diff --git a/chromium/native_client/build/standalone_flags.gypi b/chromium/native_client/build/standalone_flags.gypi
new file mode 100644
index 00000000000..dd0f304e6a9
--- /dev/null
+++ b/chromium/native_client/build/standalone_flags.gypi
@@ -0,0 +1,16 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'variables': {
+ # These flags are only included in the NaCl standalone build.
+ # They won't get included when NaCl is built as part of another
+ # project, such as Chrome. We don't necessarily want to enable
+ # these flags for Chrome source that is built as NaCl untrusted
+ # code.
+ 'nacl_default_compile_flags': [
+ '-Wundef',
+ ],
+ },
+}
diff --git a/chromium/native_client/build/untrusted.gypi b/chromium/native_client/build/untrusted.gypi
new file mode 100755
index 00000000000..141abfb2955
--- /dev/null
+++ b/chromium/native_client/build/untrusted.gypi
@@ -0,0 +1,1153 @@
+# Copyright (c) 2011 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.
+
+{
+ 'variables': {
+ 'variables': {
+ # Enable -Werror by default, but put it in a variable so it can
+ # be optionally disabled.
+ 'werror%': '-Werror',
+
+ 'conditions': [
+ ['"<(target_arch)"=="arm"', {
+ # Settings for the newer GCC versions currently used only on ARM.
+ 'NACL_RODATA_FLAG%': '-Trodata-segment',
+ }, {
+ # Settings for the older GCC version used on x86_32 and x86_64.
+ 'NACL_RODATA_FLAG%': '--build-id,--section-start,.note.gnu.build-id',
+ }]
+ ],
+ },
+ # See native_client/Sconstruct for more details.
+ # Expected address for beginning of data in for the IRT.
+ 'NACL_IRT_DATA_START': '0x3ef00000',
+ # Expected address for beginning of code in for the IRT.
+ 'NACL_IRT_TEXT_START': '0x0fa00000',
+ # Flag to pass to linker to set start of RODATA segment.
+ 'NACL_RODATA_FLAG%': '<(NACL_RODATA_FLAG)',
+ # Default C compiler defines.
+ 'nacl_default_defines': [
+ '__linux__',
+ '__STDC_LIMIT_MACROS=1',
+ '__STDC_FORMAT_MACROS=1',
+ '_GNU_SOURCE=1',
+ '_BSD_SOURCE=1',
+ '_POSIX_C_SOURCE=199506',
+ '_XOPEN_SOURCE=600',
+ 'DYNAMIC_ANNOTATIONS_ENABLED=1',
+ 'DYNAMIC_ANNOTATIONS_PREFIX=NACL_',
+ ],
+ 'nacl_default_compile_flags': [
+ #'-std=gnu99', Added by build_nexe
+ '-O2',
+ '-g',
+ '-Wall',
+ '-fdiagnostics-show-option',
+ '<(werror)',
+ ]
+ },
+ 'conditions': [
+ ['target_arch!="arm"', {
+ # Common defaults for all x86 nacl-gcc targets
+ 'target_defaults': {
+ 'conditions': [
+ ['OS=="win"', {
+ 'variables': {
+ # NOTE: Python is invoked differently by the Native Client
+ # builders than the Chromium builders. Invoking using
+ # this python_exe defn won't work in the Chrome tree.
+ 'python_exe': 'call <(DEPTH)/native_client/tools/win_py.cmd',
+ 'nacl_glibc_tc_root': '<(DEPTH)/native_client/toolchain/win_x86',
+ },
+ }],
+ ['OS=="mac"', {
+ 'variables': {
+ 'python_exe': 'python',
+ 'nacl_glibc_tc_root': '<(DEPTH)/native_client/toolchain/mac_x86',
+ },
+ }],
+ ['OS=="linux"', {
+ 'variables': {
+ 'python_exe': 'python',
+ 'nacl_glibc_tc_root': '<(DEPTH)/native_client/toolchain/linux_x86',
+ },
+ }],
+ ],
+ 'defines': [],
+ 'sources': [],
+ 'compile_flags': [],
+ 'link_flags': [],
+ 'include_dirs': [],
+ 'variables': {
+ 'newlib_tls_flags': [ '-mtls-use-call' ],
+ 'nexe_target': '',
+ 'nlib_target': '',
+ 'nso_target': '',
+ 'build_newlib': 0,
+ 'build_glibc': 0,
+ 'build_irt': 0,
+ 'disable_glibc%': 0,
+ 'extra_args': [],
+ 'enable_x86_32': 1,
+ 'enable_x86_64': 1,
+ 'enable_arm': 0,
+ 'tc_lib_dir_newlib32': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32',
+ 'tc_lib_dir_newlib64': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64',
+ 'tc_lib_dir_glibc32': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32',
+ 'tc_lib_dir_glibc64': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64',
+ 'tc_lib_dir_irt32': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/lib32',
+ 'tc_lib_dir_irt64': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/lib64',
+ 'tc_include_dir_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/include',
+ 'tc_include_dir_glibc': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/include',
+ 'extra_deps_newlib64': [],
+ 'extra_deps_newlib32': [],
+ 'extra_deps_glibc64': [],
+ 'extra_deps_glibc32': [],
+ 'include_dirs': ['<(DEPTH)'],
+ 'defines': [
+ '<@(nacl_default_defines)',
+ 'NACL_BUILD_ARCH=x86',
+ ],
+ 'sources': [],
+ 'link_flags': [],
+ 'get_sources': [
+ 'scan_sources',
+ # This is needed to open the .c filenames, which are given
+ # relative to the .gyp file.
+ '-I.',
+ # This is needed to open the .h filenames, which are given
+ # relative to the native_client directory's parent.
+ '-I<(DEPTH)',
+ ],
+ },
+ },
+ }, {
+ # Common defaults for all ARM nacl-gcc targets
+ 'target_defaults': {
+ 'defines': [],
+ 'sources': [],
+ 'compile_flags': [],
+ 'link_flags': [],
+ 'include_dirs': [],
+ 'variables': {
+ 'newlib_tls_flags': [ '-mtp=soft' ],
+ 'python_exe': 'python',
+ 'nexe_target': '',
+ 'nlib_target': '',
+ 'nso_target': '',
+ 'force_arm_pnacl': 0,
+ 'build_newlib': 0,
+ 'build_glibc': 0,
+ 'build_irt': 0,
+ 'disable_glibc%': 1,
+ 'extra_args': [],
+ 'enable_x86_32': 0,
+ 'enable_x86_64': 0,
+ 'enable_arm': 1,
+ 'extra_deps_newlib_arm': [],
+ 'native_sources': [],
+ 'tc_lib_dir_newlib_arm': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm',
+ 'tc_lib_dir_irt_arm': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/libarm',
+ 'tc_include_dir_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/include',
+ 'include_dirs': ['<(DEPTH)'],
+ 'defines': [
+ '<@(nacl_default_defines)',
+ 'NACL_BUILD_ARCH=arm',
+ ],
+ 'sources': [],
+ 'link_flags': [],
+ 'get_sources': [
+ 'scan_sources',
+ # This is needed to open the .c filenames, which are given
+ # relative to the .gyp file.
+ '-I.',
+ # This is needed to open the .h filenames, which are given
+ # relative to the native_client directory's parent.
+ '-I<(DEPTH)',
+ ],
+ },
+ },
+ }],
+ ['target_arch!="arm"', {
+ 'target_defaults': {
+ # x86-64 newlib nexe action
+ 'target_conditions': [
+ ['nexe_target!="" and build_newlib!=0 and enable_x86_64!=0', {
+ 'variables': {
+ 'tool_name': 'newlib',
+ 'out_newlib64%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x64.nexe',
+ 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
+ 'source_list_newlib64%': '<(tool_name)-x86-64.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build newlib x86-64 nexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib64)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_newlib64)',
+ '>(source_list_newlib64)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib64)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-64',
+ '--build', 'newlib_nexe',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib64)',
+ '--objdir', '>(objdir_newlib64)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B>(tc_lib_dir_newlib64) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib64) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-64 newlib library action
+ ['nlib_target!="" and build_newlib!=0 and enable_x86_64!=0', {
+ 'variables': {
+ 'tool_name': 'newlib',
+ 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
+ 'source_list_newlib64%': '<(tool_name)-x86-64.>(_target_name).source_list.gypcmd',
+ 'out_newlib64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nlib_target)',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build newlib x86-64 nlib',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib64)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_newlib64)',
+ '>(source_list_newlib64)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib64)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-64',
+ '--build', 'newlib_nlib',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib64)',
+ '--objdir', '>(objdir_newlib64)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B>(tc_lib_dir_newlib64) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib64) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-64 IRT nexe action
+ ['nexe_target!="" and build_irt!=0 and enable_x86_64!=0', {
+ 'variables': {
+ 'tool_name': 'irt',
+ 'out_newlib64%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x64.nexe',
+ 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
+ 'source_list_newlib64%': '<(tool_name)-x86-64.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build IRT x86-64 nexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib64)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_newlib64)',
+ '>(source_list_newlib64)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib64)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-64',
+ '--build', 'newlib_nexe_pnacl',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib64)',
+ '--objdir', '>(objdir_newlib64)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=--target=x86_64-nacl ^(compile_flags) >(_compile_flags) -gline-tables-only ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=--target=x86_64-nacl -arch x86-64 --pnacl-allow-translate --pnacl-allow-native -Wt,-mtls-use-call -Wn,-Trodata-segment=<(NACL_IRT_DATA_START) -Wn,-Ttext-segment=<(NACL_IRT_TEXT_START) -B>(tc_lib_dir_irt64) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib64) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-64 IRT library action
+ ['nlib_target!="" and build_irt!=0 and enable_x86_64!=0', {
+ 'variables': {
+ 'tool_name': 'irt',
+ 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
+ 'source_list_newlib64%': '<(tool_name)-x86-64.>(_target_name).source_list.gypcmd',
+ 'out_newlib64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nlib_target)',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build irt x86-64 nlib',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib64)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_newlib64)',
+ '>(source_list_newlib64)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib64)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-64',
+ '--build', 'newlib_nlib_pnacl',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib64)',
+ '--objdir', '>(objdir_newlib64)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=--target=x86_64-nacl ^(compile_flags) >(_compile_flags) -gline-tables-only ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=--target=x86_64-nacl -B>(tc_lib_dir_irt64) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib64) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-32 newlib nexe action
+ ['nexe_target!="" and build_newlib!=0 and enable_x86_32!=0', {
+ 'variables': {
+ 'tool_name': 'newlib',
+ 'out_newlib32%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x32.nexe',
+ 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
+ 'source_list_newlib32%': '<(tool_name)-x86-32.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build newlib x86-32 nexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib32)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_newlib32)',
+ '>(source_list_newlib32)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib32)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-32',
+ '--build', 'newlib_nexe',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib32)',
+ '--objdir', '>(objdir_newlib32)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-m32 -B>(tc_lib_dir_newlib32) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib32) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-32 newlib library action
+ ['nlib_target!="" and build_newlib!=0 and enable_x86_32!=0', {
+ 'variables': {
+ 'tool_name': 'newlib',
+ 'out_newlib32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nlib_target)',
+ 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
+ 'source_list_newlib32%': '<(tool_name)-x86-32.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build newlib x86-32 nlib',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib32)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_newlib32)',
+ '>(source_list_newlib32)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib32)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-32',
+ '--build', 'newlib_nlib',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib32)',
+ '--objdir', '>(objdir_newlib32)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-m32 -B>(tc_lib_dir_newlib32) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib32) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-32 IRT nexe build
+ ['nexe_target!="" and build_irt!=0 and enable_x86_32!=0', {
+ 'variables': {
+ 'tool_name': 'irt',
+ 'out_newlib32%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x32.nexe',
+ 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
+ 'source_list_newlib32%': '<(tool_name)-x86-32.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build IRT x86-32 nexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib32)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_newlib32)',
+ '>(source_list_newlib32)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib32)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-32',
+ '--build', 'newlib_nexe',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib32)',
+ '--objdir', '>(objdir_newlib32)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m32 ^(newlib_tls_flags) ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-m32 -B>(tc_lib_dir_irt32) -Wl,--build-id,--section-start,.note.gnu.build-id=<(NACL_IRT_DATA_START) -Wl,-Ttext-segment=<(NACL_IRT_TEXT_START) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib32) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-32 IRT library build
+ ['nlib_target!="" and build_irt!=0 and enable_x86_32!=0', {
+ 'variables': {
+ 'tool_name': 'irt',
+ 'out_newlib32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nlib_target)',
+ 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
+ 'source_list_newlib32%': '<(tool_name)-x86-32.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build IRT x86-32 nlib',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib32)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_newlib32)',
+ '>(source_list_newlib32)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib32)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-32',
+ '--build', 'newlib_nlib',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib32)',
+ '--objdir', '>(objdir_newlib32)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m32 ^(newlib_tls_flags) ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-m32 -B>(tc_lib_dir_irt32) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib32) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ ],
+ },
+ }], # end x86 gcc nexe/nlib actions
+ ['target_arch=="arm"', {
+ 'target_defaults': {
+ 'target_conditions': [
+ # arm newlib nexe action
+ ['force_arm_pnacl==0 and nexe_target!="" and build_newlib!=0', {
+ 'variables': {
+ 'tool_name': 'newlib',
+ 'out_newlib_arm%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_arm.nexe',
+ 'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
+ 'source_list_newlib_arm%': '<(tool_name)-arm.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build newlib arm nexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib_arm)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
+ '>@(extra_deps_newlib_arm)',
+ '>(source_list_newlib_arm)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_arm_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib_arm)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'arm',
+ '--build', 'newlib_nexe',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib_arm)',
+ '--objdir', '>(objdir_newlib_arm)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B>(tc_lib_dir_newlib_arm) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib_arm) ^(_sources) ^(sources) ^(native_sources))',
+ ],
+ },
+ ],
+ }],
+ # arm newlib library action
+ ['force_arm_pnacl==0 and nlib_target!="" and build_newlib!=0', {
+ 'variables': {
+ 'tool_name': 'newlib',
+ 'out_newlib_arm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(nlib_target)',
+ 'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
+ 'source_list_newlib_arm%': '<(tool_name)-arm.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build newlib arm nlib',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib_arm)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
+ '>@(extra_deps_newlib_arm)',
+ '>(source_list_newlib_arm)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_arm_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib_arm)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'arm',
+ '--build', 'newlib_nlib',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib_arm)',
+ '--objdir', '>(objdir_newlib_arm)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B>(tc_lib_dir_newlib_arm) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib_arm) ^(_sources) ^(sources) ^(native_sources))',
+ ],
+ },
+ ],
+ }],
+ # arm irt nexe action
+ ['force_arm_pnacl==0 and nexe_target!="" and build_irt!=0', {
+ 'variables': {
+ 'tool_name': 'irt',
+ 'out_newlib_arm%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_arm.nexe',
+ 'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
+ 'source_list_newlib_arm%': '<(tool_name)-arm.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build IRT arm nexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib_arm)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
+ '>@(extra_deps_newlib_arm)',
+ '>(source_list_newlib_arm)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_arm_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib_arm)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'arm',
+ '--build', 'newlib_nexe',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib_arm)',
+ '--objdir', '>(objdir_newlib_arm)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(newlib_tls_flags) ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B>(tc_lib_dir_irt_arm) -Wl,-Trodata-segment=<(NACL_IRT_DATA_START) -Wl,-Ttext-segment=<(NACL_IRT_TEXT_START) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib_arm) ^(_sources) ^(sources) ^(native_sources))',
+ ],
+ },
+ ],
+ }],
+ # arm IRT library action
+ ['force_arm_pnacl==0 and nlib_target!="" and build_irt!=0', {
+ 'variables': {
+ 'tool_name': 'irt',
+ 'out_newlib_arm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(nlib_target)',
+ 'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
+ 'source_list_newlib_arm%': '<(tool_name)-arm.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build IRT arm nlib',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib_arm)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
+ '>@(extra_deps_newlib_arm)',
+ '>(source_list_newlib_arm)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_arm_newlib/stamp.prep',
+ ],
+ 'outputs': ['>(out_newlib_arm)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'arm',
+ '--build', 'newlib_nlib',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib_arm)',
+ '--objdir', '>(objdir_newlib_arm)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(newlib_tls_flags) ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B>(tc_lib_dir_irt_arm) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib_arm) ^(_sources) ^(sources) ^(native_sources))',
+ ],
+ },
+ ],
+ }],
+ # pnacl ARM library build using biased bitcode. This is currently
+ # used to build the IRT shim. TODO(dschuff): see if this can be
+ # further simplified, perhaps using re-using the plib build below
+ ['force_arm_pnacl==1 and nlib_target!="" and build_newlib!=0', {
+ 'variables': {
+ 'tool_name': 'newlib',
+ 'out_newlib_arm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(nlib_target)',
+ 'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
+ 'source_list_newlib_arm%': '<(tool_name)-arm.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build newlib arm nlib (via pnacl)',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_newlib_arm)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_newlib_arm)',
+ '>(source_list_newlib_arm)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_pnacl/stamp.prep'
+ ],
+ 'outputs': ['>(out_newlib_arm)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'arm',
+ '--build', 'newlib_nlib_pnacl',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_newlib_arm)',
+ '--objdir', '>(objdir_newlib_arm)',
+ '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=--pnacl-frontend-triple=armv7-unknown-nacl-gnueabi -mfloat-abi=hard ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B>(tc_lib_dir_newlib_arm) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_newlib_arm) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ ], # end target_conditions for arm newlib (nexe/nlib, force_arm_pnacl)
+ },
+ }], # end target_arch = arm
+ ['target_arch!="arm"', {
+ 'target_defaults': {
+ # x86-64 glibc nexe action
+ 'target_conditions': [
+ ['nexe_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', {
+ 'variables': {
+ 'tool_name': 'glibc',
+ 'out_glibc64%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x64.nexe',
+ 'objdir_glibc64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
+ 'source_list_glibc64%': '<(tool_name)-x86-64.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build glibc x86-64 nexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_glibc64)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_glibc64)',
+ '>(source_list_glibc64)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
+ ],
+ 'outputs': ['>(out_glibc64)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-64',
+ '--build', 'glibc_nexe',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_glibc64)',
+ '--objdir', '>(objdir_glibc64)',
+ '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B>(tc_lib_dir_glibc64) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_glibc64) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-32 glibc nexe action
+ ['nexe_target!="" and build_glibc!=0 and enable_x86_32!=0 and disable_glibc==0', {
+ 'variables': {
+ 'tool_name': 'glibc',
+ 'out_glibc32%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x32.nexe',
+ 'objdir_glibc32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
+ 'source_list_glibc32%': '<(tool_name)-x86-32.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build glibc x86-32 nexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_glibc32)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_glibc32)',
+ '>(source_list_glibc32)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
+ ],
+ 'outputs': ['>(out_glibc32)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-32',
+ '--build', 'glibc_nexe',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_glibc32)',
+ '--objdir', '>(objdir_glibc32)',
+ '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-m32 -B>(tc_lib_dir_glibc32) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_glibc32) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-64 glibc static library action
+ ['nlib_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', {
+ 'variables': {
+ 'tool_name': 'glibc',
+ 'objdir_glibc64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
+ 'source_list_glibc64%': '<(tool_name)-x86-64.>(_target_name).source_list.gypcmd',
+ 'out_glibc64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nlib_target)',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build glibc x86-64 nlib',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_glibc64)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_glibc64)',
+ '>(source_list_glibc64)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
+ ],
+ 'outputs': ['>(out_glibc64)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-64',
+ '--build', 'glibc_nlib',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_glibc64)',
+ '--objdir', '>(objdir_glibc64)',
+ '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B>(tc_lib_dir_glibc64) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_glibc64) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-32 glibc static library action
+ ['nlib_target!="" and build_glibc!=0 and enable_x86_32!=0 and disable_glibc==0', {
+ 'variables': {
+ 'tool_name': 'glibc',
+ 'out_glibc32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nlib_target)',
+ 'objdir_glibc32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
+ 'source_list_glibc32%': '<(tool_name)-x86-32.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build glibc x86-32 nlib',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_glibc32)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_glibc32)',
+ '>(source_list_glibc32)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
+ ],
+ 'outputs': ['>(out_glibc32)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'x86-32',
+ '--build', 'glibc_nlib',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_glibc32)',
+ '--objdir', '>(objdir_glibc32)',
+ '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-m32 -B>(tc_lib_dir_glibc32) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_glibc32) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-64 glibc shared library action
+ ['nso_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', {
+ 'variables': {
+ 'tool_name': 'glibc',
+ 'objdir_glibc64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64-so/>(_target_name)',
+ 'source_list_glibc64%': '<(tool_name)-x86-64-so.>(_target_name).source_list.gypcmd',
+ 'out_glibc64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nso_target)',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build glibc x86-64 nso',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_glibc64)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_glibc64)',
+ '>(source_list_glibc64)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
+ ],
+ 'outputs': ['>(out_glibc64)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>@(extra_args)',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '--arch', 'x86-64',
+ '--build', 'glibc_nso',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_glibc64)',
+ '--objdir', '>(objdir_glibc64)',
+ '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m64 -fPIC ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B>(tc_lib_dir_glibc64) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_glibc64) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ # x86-32 glibc shared library action
+ ['nso_target!="" and build_glibc!=0 and enable_x86_32!=0 and disable_glibc==0', {
+ 'variables': {
+ 'tool_name': 'glibc',
+ 'out_glibc32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nso_target)',
+ 'objdir_glibc32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32-so/>(_target_name)',
+ 'source_list_glibc32%': '<(tool_name)-x86-32-so.>(_target_name).source_list.gypcmd',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build glibc x86-32 nso',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_glibc32)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_glibc32)',
+ '>(source_list_glibc32)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
+ ],
+ 'outputs': ['>(out_glibc32)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>@(extra_args)',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '--arch', 'x86-32',
+ '--build', 'glibc_nso',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_glibc32)',
+ '--objdir', '>(objdir_glibc32)',
+ '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=-m32 -fPIC ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-m32 -B>(tc_lib_dir_glibc32) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_glibc32) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ ], # end target_conditions for glibc (nexe/nlib/nso, x86-32/64)
+ },
+ }], # end target_arch != arm
+ ],
+ # Common defaults for pnacl targets
+ 'target_defaults': {
+ 'gcc_compile_flags': [],
+ 'pnacl_compile_flags': [],
+ 'variables': {
+ 'disable_pnacl%': 0,
+ 'build_pnacl_newlib': 0,
+ 'nlib_target': '',
+ 'extra_deps_pnacl_newlib': [],
+ 'tc_lib_dir_pnacl_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib',
+ 'tc_lib_dir_pnacl_translate' :'<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate',
+ 'tc_include_dir_pnacl_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/include',
+ 'compile_flags': [
+ '<@(nacl_default_compile_flags)',
+ ],
+ 'gcc_compile_flags': [
+ '-fomit-frame-pointer',
+ # A debugger should be able to unwind IRT call frames. As the IRT is
+ # compiled with high level of optimizations and without debug info,
+ # compiler is requested to generate unwind tables explicitly. This
+ # is the default behavior on x86-64 and when compiling C++ with
+ # exceptions enabled, the change is for the benefit of x86-32 C.
+ # These are only required for the IRT but are here for all
+ # nacl-gcc-compiled binaries because the IRT depends on other libs
+ '-fasynchronous-unwind-tables',
+ ],
+ 'pnacl_compile_flags': [
+ '-Wno-extra-semi',
+ '-Wno-unused-private-field',
+ '-Wno-char-subscripts',
+ '-Wno-unused-function',
+ ],
+ },
+ 'target_conditions': [
+ # pnacl actions for building pexes and translating them
+ ['nexe_target!="" and disable_pnacl==0 and build_pnacl_newlib!=0', {
+ 'variables': {
+ 'out_pnacl_newlib_x86_32_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_x32.nexe',
+ 'out_pnacl_newlib_x86_64_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_x64.nexe',
+ 'out_pnacl_newlib_arm_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_arm.nexe',
+ 'tool_name': 'pnacl_newlib',
+ 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib',
+ 'out_pnacl_newlib%': '<(PRODUCT_DIR)/>(nexe_target)_newlib.pexe',
+ 'objdir_pnacl_newlib%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_name)',
+ 'source_list_pnacl_newlib%': '<(tool_name).>(_target_name).source_list.gypcmd',
+ 'link_flags': [
+ '-O3',
+ ],
+ 'translate_flags': [],
+ },
+ 'actions': [
+ {
+ 'action_name': 'build newlib pexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_pnacl_newlib)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_pnacl_newlib)',
+ '>(source_list_pnacl_newlib)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_pnacl/stamp.prep',
+ ],
+ 'outputs': ['>(out_pnacl_newlib)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'pnacl',
+ '--build', 'newlib_pexe',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_pnacl_newlib)',
+ '--objdir', '>(objdir_pnacl_newlib)',
+ '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_pnacl_newlib) ^(_sources) ^(sources))',
+ ],
+ }],
+ 'target_conditions': [
+ [ 'enable_x86_32!=0', {
+ 'actions': [{
+ 'action_name': 'translate newlib pexe to x86-32 nexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'translating >(out_pnacl_newlib_x86_32_nexe)',
+ 'inputs': [
+ # Having this in the input somehow causes devenv warnings
+ # when building pnacl browser tests.
+ # '<(DEPTH)/native_client/build/build_nexe.py',
+ '>(out_pnacl_newlib)',
+ ],
+ 'outputs': [ '>(out_pnacl_newlib_x86_32_nexe)' ],
+ 'action' : [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '--arch', 'x86-32',
+ '--build', 'newlib_translate',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_pnacl_newlib_x86_32_nexe)',
+ '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-x86-32',
+ '>(out_pnacl_newlib)',
+ ],
+ }],
+ }],
+ [ 'enable_x86_64!=0', {
+ 'actions': [{
+ 'action_name': 'translate newlib pexe to x86-64 nexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'translating >(out_pnacl_newlib_x86_64_nexe)',
+ 'inputs': [
+ # Having this in the input somehow causes devenv warnings
+ # when building pnacl browser tests.
+ # '<(DEPTH)/native_client/build/build_nexe.py',
+ '>(out_pnacl_newlib)',
+ ],
+ 'outputs': [ '>(out_pnacl_newlib_x86_64_nexe)' ],
+ 'action' : [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '--arch', 'x86-64',
+ '--build', 'newlib_translate',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_pnacl_newlib_x86_64_nexe)',
+ '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-x86-64',
+ '>(out_pnacl_newlib)',
+ ],
+ }],
+ }],
+ [ 'enable_arm!=0', {
+ 'actions': [{
+ 'action_name': 'translate newlib pexe to ARM nexe',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'translating >(out_pnacl_newlib_arm_nexe)',
+ 'inputs': [
+ # Having this in the input somehow causes devenv warnings
+ # when building pnacl browser tests.
+ # '<(DEPTH)/native_client/build/build_nexe.py',
+ '>(out_pnacl_newlib)',
+ ],
+ 'outputs': [ '>(out_pnacl_newlib_arm_nexe)' ],
+ 'action' : [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '--arch', 'arm',
+ '--build', 'newlib_translate',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_pnacl_newlib_arm_nexe)',
+ '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-arm',
+ '>(out_pnacl_newlib)',
+ ],
+ }],
+ }],
+ ],
+ }],
+ # pnacl action for building libraries
+ ['nlib_target!="" and disable_pnacl==0 and build_pnacl_newlib!=0', {
+ 'variables': {
+ 'tool_name': 'pnacl_newlib',
+ 'objdir_pnacl_newlib%': '>(INTERMEDIATE_DIR)/<(tool_name)-pnacl/>(_target_name)',
+ 'source_list_pnacl_newlib%': '<(tool_name).>(_target_name).source_list.gypcmd',
+ 'out_pnacl_newlib%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib/>(nlib_target)',
+ },
+ 'actions': [
+ {
+ 'action_name': 'build newlib plib',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'building >(out_pnacl_newlib)',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
+ '>@(extra_deps_pnacl_newlib)',
+ '>(source_list_pnacl_newlib)',
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_pnacl/stamp.prep',
+ ],
+ 'outputs': ['>(out_pnacl_newlib)'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/build_nexe.py',
+ '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
+ '>@(extra_args)',
+ '--arch', 'pnacl',
+ '--build', 'newlib_plib',
+ '--root', '<(DEPTH)',
+ '--name', '>(out_pnacl_newlib)',
+ '--objdir', '>(objdir_pnacl_newlib)',
+ '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
+ '--compile_flags=^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
+ '--defines=^(defines) >(_defines)',
+ '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_flags)',
+ '--source-list=^|(<(source_list_pnacl_newlib) ^(_sources) ^(sources))',
+ ],
+ },
+ ],
+ }],
+ ], # end target_conditions for pnacl pexe/plib
+ },
+}
diff --git a/chromium/native_client/src/shared/gio/gio.gyp b/chromium/native_client/src/shared/gio/gio.gyp
new file mode 100644
index 00000000000..03e60811bb3
--- /dev/null
+++ b/chromium/native_client/src/shared/gio/gio.gyp
@@ -0,0 +1,62 @@
+# Copyright (c) 2011 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.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'variables': {
+ 'common_sources': [
+ 'gio.c',
+ 'gio_mem.c',
+ 'gprintf.c',
+ 'gio_mem_snapshot.c',
+ ],
+ 'trusted_sources': [
+ '<@(common_sources)',
+ 'gio_pio.c',
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'gio',
+ 'type': 'static_library',
+ 'sources': [
+ '<@(trusted_sources)',
+ ],
+ },
+ {
+ 'target_name': 'gio_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libgio.a',
+ 'nso_target': 'libgio.so',
+ 'build_glibc': 1,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 1,
+ 'build_irt': 1,
+ 'sources': ['<@(common_sources)']
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'gio64',
+ 'type': 'static_library',
+ 'sources': [
+ '<@(trusted_sources)',
+ ],
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ }
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/shared/imc/imc.gyp b/chromium/native_client/src/shared/imc/imc.gyp
new file mode 100644
index 00000000000..de1b31fefab
--- /dev/null
+++ b/chromium/native_client/src/shared/imc/imc.gyp
@@ -0,0 +1,126 @@
+# -*- python -*-
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ ######################################################################
+ 'variables': {
+ 'COMMAND_TESTER': '<(DEPTH)/native_client/tools/command_tester.py',
+ 'common_sources': [
+ 'nacl_imc_common.cc',
+ 'nacl_imc_c.h',
+ ],
+ 'conditions': [
+ ['OS=="linux"', {
+ 'common_sources': [
+ 'linux/nacl_imc.cc',
+ 'posix/nacl_imc_posix.cc',
+ ],
+ }],
+ ['OS=="mac"', {
+ 'common_sources': [
+ 'osx/nacl_imc.cc',
+ 'posix/nacl_imc_posix.cc',
+ ],
+ }],
+ ['OS=="win"', {
+ 'common_sources': [
+ 'win/nacl_imc.cc',
+ 'win/nacl_shm.cc',
+ ],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'ExceptionHandling': '2', # /EHsc
+ },
+ },
+ }],
+ ],
+ },
+ ######################################################################
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ ######################################################################
+ 'target_defaults': {
+ },
+ 'targets': [
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'imc',
+ 'type': 'static_library',
+ 'sources': [
+ '<@(common_sources)',
+ ],
+ },
+ # ----------------------------------------------------------------------
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'sigpipe_test',
+ 'type': 'executable',
+ 'sources': [
+ 'sigpipe_test.cc',
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
+ ],
+ },
+ ],
+ 'conditions': [
+ ['target_arch!="arm"', {
+ 'targets': [
+ # NOTE: we do not support untrusted gyp build on arm yet.
+ {
+ 'target_name': 'imc_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libimc.a',
+ 'nso_target': 'libimc.so',
+ 'build_glibc': 1,
+ 'build_newlib': 1,
+ 'sources': ['nacl_imc_common.cc', 'nacl/nacl_imc.cc'],
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ ],
+ }],
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ # ---------------------------------------------------------------------
+ {
+ 'target_name': 'imc64',
+ 'type': 'static_library',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'sources': [
+ '<@(common_sources)',
+ ],
+ },
+ # ---------------------------------------------------------------------
+ {
+ 'target_name': 'sigpipe_test64',
+ 'type': 'executable',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'sources': [
+ 'sigpipe_test.cc',
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc64',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio64',
+ ],
+ },
+ ],
+ }],
+ ],
+}
+
+# TODO: some tests missing, c.f. build.scons
+
diff --git a/chromium/native_client/src/shared/ldr/ldr.gyp b/chromium/native_client/src/shared/ldr/ldr.gyp
new file mode 100644
index 00000000000..3ff169e2b49
--- /dev/null
+++ b/chromium/native_client/src/shared/ldr/ldr.gyp
@@ -0,0 +1,19 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'ldr',
+ 'type': 'static_library',
+ 'sources': [
+ 'nacl_ldr.c',
+ 'nacl_ldr.h',
+ ],
+ }
+ ]
+}
diff --git a/chromium/native_client/src/shared/platform/platform.gyp b/chromium/native_client/src/shared/platform/platform.gyp
new file mode 100644
index 00000000000..160e9d99da9
--- /dev/null
+++ b/chromium/native_client/src/shared/platform/platform.gyp
@@ -0,0 +1,218 @@
+# -*- python -*-
+#
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'variables': {
+ 'common_sources': [
+ 'nacl_check.c',
+ 'nacl_check.h',
+ 'nacl_find_addrsp.h',
+ 'nacl_global_secure_random.c',
+ 'nacl_global_secure_random.h',
+ 'nacl_host_desc.h',
+ 'nacl_host_dir.h',
+ 'nacl_host_desc_common.c',
+ 'nacl_interruptible_condvar.c',
+ 'nacl_interruptible_condvar.h',
+ 'nacl_interruptible_mutex.c',
+ 'nacl_interruptible_mutex.h',
+ 'nacl_log.c',
+ 'nacl_log.h',
+ 'nacl_secure_random.h',
+ 'nacl_secure_random_base.h',
+ 'nacl_secure_random_common.c',
+ 'nacl_semaphore.h',
+ 'nacl_sync.h',
+ 'nacl_sync_checked.c',
+ 'nacl_sync_checked.h',
+ 'nacl_threads.h',
+ 'nacl_time.h',
+ 'nacl_time_common.c',
+ 'nacl_timestamp.h',
+ 'platform_init.c',
+ 'refcount_base.cc',
+ ],
+ 'conditions': [
+ ['OS=="linux"', {
+ 'platform_sources': [
+ 'linux/nacl_clock.c',
+ 'linux/nacl_host_dir.c',
+ 'linux/nacl_semaphore.c',
+ ],
+ }],
+ ['OS=="mac"', {
+ 'platform_sources': [
+ 'osx/nacl_clock.c',
+ 'osx/nacl_host_dir.c',
+ 'osx/nacl_semaphore.c',
+ 'osx/strnlen_osx.c',
+ ],
+ }],
+ ['OS=="linux" or OS=="mac"', {
+ 'platform_sources': [
+ 'posix/aligned_malloc.c',
+ 'posix/condition_variable.c',
+ 'posix/lock.c',
+ 'posix/nacl_exit.c',
+ 'posix/nacl_fast_mutex.c',
+ 'posix/nacl_find_addrsp.c',
+ 'posix/nacl_host_desc.c',
+ 'posix/nacl_secure_random.c',
+ 'posix/nacl_thread_id.c',
+ 'posix/nacl_threads.c',
+ 'posix/nacl_time.c',
+ 'posix/nacl_timestamp.c',
+ ],
+ }],
+ ['OS=="win"', {
+ 'platform_sources': [
+ 'win/aligned_malloc.c',
+ 'win/condition_variable.cc',
+ 'win/lock.cc',
+ 'win/nacl_clock.c',
+ 'win/nacl_exit.c',
+ 'win/nacl_fast_mutex.c',
+ 'win/nacl_find_addrsp.c',
+ 'win/nacl_host_desc.c',
+ 'win/nacl_host_dir.c',
+ 'win/lock_impl_win.cc',
+ 'win/nacl_secure_random.c',
+ 'win/nacl_semaphore.c',
+ 'win/nacl_sync_win.cc',
+ 'win/nacl_threads.c',
+ 'win/nacl_time.c',
+ 'win/nacl_timestamp.c',
+ 'win/port_win.c',
+ 'win/time.cc',
+ 'win/time.h',
+ 'win/time_win.cc',
+ 'win/xlate_system_error.c',
+ ],
+ }],
+ ],
+ },
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['OS=="linux" or OS=="mac"', {
+ 'cflags': [
+ '-Wno-long-long',
+ ],
+ }],
+ ['target_base=="platform_lib"', {
+ 'sources': [
+ '<@(common_sources)',
+ '<@(platform_sources)',
+ ],
+ }],
+ ['target_base=="platform_tests"', {
+ 'sources': [
+ 'platform_tests.cc',
+ ],
+ 'conditions': [[
+ 'OS=="win"', {
+ 'sources': [
+ 'win/port_win_test.c',
+ ],
+ }
+ ]]
+ }
+ ]
+ ],
+ },
+ 'targets': [
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'platform',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'platform_lib',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
+ ],
+ },
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'platform_tests',
+ 'type': 'executable',
+ 'variables': {
+ 'target_base': 'platform_tests',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
+ ],
+ },
+ {
+ 'target_name': 'platform_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libplatform.a',
+ 'nso_target': 'libplatform.so',
+ 'build_glibc': 1,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 1,
+ 'build_irt': 1,
+ 'sources': [
+ 'nacl_check.c',
+ 'nacl_log.c',
+ 'posix/condition_variable.c',
+ 'posix/lock.c',
+ 'posix/nacl_exit.c',
+ 'posix/nacl_thread_id.c',
+ 'posix/nacl_threads.c',
+ 'posix/nacl_timestamp.c',
+ 'nacl_sync_checked.c',
+ 'refcount_base.cc',
+ ]
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ # ----------------------------------------------------------------------
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ # ---------------------------------------------------------------------
+ {
+ 'target_name': 'platform64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'platform_lib',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio64',
+ ],
+ },
+ # ---------------------------------------------------------------------
+ {
+ 'target_name': 'platform_tests64',
+ 'type': 'executable',
+ 'variables': {
+ 'target_base': 'platform_tests',
+ 'win_target': 'x64',
+ },
+ 'sources': [
+ 'win/test_tls.S',
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio64',
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/shared/serialization/serialization.gyp b/chromium/native_client/src/shared/serialization/serialization.gyp
new file mode 100644
index 00000000000..7442f27603e
--- /dev/null
+++ b/chromium/native_client/src/shared/serialization/serialization.gyp
@@ -0,0 +1,45 @@
+# Copyright (c) 2013 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="serialization"', {
+ 'sources': [
+ 'serialization.cc',
+ 'serialization.h',
+ ],
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'serialization',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'serialization',
+ },
+ }
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'serialization64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'serialization',
+ 'win_target': 'x64'
+ },
+ }
+ ]
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/shared/srpc/srpc.gyp b/chromium/native_client/src/shared/srpc/srpc.gyp
new file mode 100644
index 00000000000..d3cbda1ca19
--- /dev/null
+++ b/chromium/native_client/src/shared/srpc/srpc.gyp
@@ -0,0 +1,91 @@
+# Copyright (c) 2008 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="srpc"', {
+ 'sources': [
+ 'invoke.c',
+ 'module_init_fini.c',
+ 'nacl_srpc.c',
+ 'nacl_srpc.h',
+ 'nacl_srpc_internal.h',
+ 'nacl_srpc_message.c',
+ 'rpc_log.c',
+ 'rpc_serialize.c',
+ 'rpc_service.c',
+ 'rpc_server_loop.c',
+ ],
+ 'cflags': [
+ '-fno-strict-aliasing',
+ '-Wno-missing-field-initializers'
+ ],
+ # nacl_srpc_message.c contains an overflow check that produces an error
+ # on 64-bit compiles when -Wextra is used:
+ # 'comparison is always false due to limited range of data type'
+ 'cflags!': [
+ '-Wextra'
+ ],
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'nonnacl_srpc',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'srpc',
+ },
+ },
+ {
+ 'target_name': 'srpc_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libsrpc.a',
+ 'nso_target': 'libsrpc.so',
+ 'build_glibc': 1,
+ 'build_newlib': 1,
+ 'build_irt': 1,
+ 'sources': [
+ 'invoke.c',
+ 'module_init_fini.c',
+ 'nacl_srpc.c',
+ 'nacl_srpc_message.c',
+ 'rpc_log.c',
+ 'rpc_serialize.c',
+ 'rpc_service.c',
+ 'rpc_server_loop.c',
+ 'accept.c',
+ 'accept_threaded.c',
+ 'nacl_srpc_ppapi_plugin_init.c',
+ 'nacl_srpc_ppapi_plugin_internal.c'
+ ],
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'nonnacl_srpc64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'srpc',
+ 'win_target': 'x64',
+ },
+ }
+ ],
+ }],
+ ]
+}
diff --git a/chromium/native_client/src/shared/utils/utils.gyp b/chromium/native_client/src/shared/utils/utils.gyp
new file mode 100644
index 00000000000..aeb9f51eb4b
--- /dev/null
+++ b/chromium/native_client/src/shared/utils/utils.gyp
@@ -0,0 +1,73 @@
+# Copyright 2008, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="utils"', {
+ 'sources': [
+ 'flags.c',
+ 'flags.h',
+ 'formatting.c',
+ 'formatting.h',
+ 'types.h',
+ ],
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'utils',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'utils',
+ },
+ }
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'utils64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'utils',
+ 'win_target': 'x64'
+ },
+ }
+ ]
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/third_party_mod/gtest/gtest.gyp b/chromium/native_client/src/third_party_mod/gtest/gtest.gyp
new file mode 100644
index 00000000000..0d0d979bdc0
--- /dev/null
+++ b/chromium/native_client/src/third_party_mod/gtest/gtest.gyp
@@ -0,0 +1,96 @@
+# -*- python -*-
+# Copyright 2012, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="gtest"', {
+ 'include_dirs': [
+ '<(DEPTH)/testing/gtest/',
+ '<(DEPTH)/testing/gtest/include',
+ ],
+ 'cflags_cc!': [
+ '-fno-rtti',
+ '-Wno-missing-field-initializers'
+ ],
+ 'cflags!': [
+ '-pedantic',
+ '-Wswitch-enum',
+ '-Wno-missing-field-initializers'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-pedantic',
+ '-Wswitch-enum'
+ ]
+ },
+ 'sources': [
+ '<(DEPTH)/testing/gtest/src/gtest-all.cc',
+ ],
+ 'conditions': [
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'GCC_ENABLE_CPP_RTTI': 'YES', # override -fno-rtti
+ },
+ }],
+ ],
+ }]
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'gtest',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'gtest',
+ },
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'gtest64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'gtest',
+ 'win_target': 'x64',
+ },
+ },
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/cpu_features/cpu_features.gyp b/chromium/native_client/src/trusted/cpu_features/cpu_features.gyp
new file mode 100644
index 00000000000..194bcf1baa4
--- /dev/null
+++ b/chromium/native_client/src/trusted/cpu_features/cpu_features.gyp
@@ -0,0 +1,86 @@
+# Copyright 2013 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can
+# be found in the LICENSE file.
+
+{
+ # ----------------------------------------------------------------------
+ # Default settings
+ # ----------------------------------------------------------------------
+
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ # TODO(robertm): move these setting to some global config
+ 'target_defaults': {
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ]
+ },
+ 'include_dirs': ['<(SHARED_INTERMEDIATE_DIR)'],
+ # TODO(robertm): mmentovai does not think this is necessary
+ # When ncvalidate is a dependency, it needs to be a hard dependency
+ # because dependents may rely on ncvalidate to create header files below.
+ 'hard_dependency': 1,
+ },
+ # ----------------------------------------------------------------------
+ # actual targets
+ # ----------------------------------------------------------------------
+ 'targets': [
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'cpu_features',
+ 'type': 'static_library',
+ # TODO(jfb) See TODO in build.scons on why x86 is built this way.
+ 'conditions': [
+ ['target_arch=="ia32" or target_arch=="x64"', {
+ 'sources': [
+ 'arch/arm/cpu_arm.c',
+ 'arch/mips/cpu_mips.c',
+ 'arch/x86/cpu_x86.c',
+ 'arch/x86/cpu_xgetbv.S',
+ ],
+ }],
+ ['target_arch=="arm" or target_arch=="mips"', {
+ 'sources': [
+ 'arch/arm/cpu_arm.c',
+ 'arch/mips/cpu_mips.c',
+ ],
+ }],
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'cpu_features64',
+ 'type': 'static_library',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'sources': [
+ 'arch/arm/cpu_arm.c',
+ 'arch/mips/cpu_mips.c',
+ 'arch/x86/cpu_x86.c',
+ 'arch/x86/cpu_xgetbv.S',
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ ],
+ },
+ ],
+ },
+ ],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/debug_stub/debug_stub.gyp b/chromium/native_client/src/trusted/debug_stub/debug_stub.gyp
new file mode 100644
index 00000000000..5143e5bf040
--- /dev/null
+++ b/chromium/native_client/src/trusted/debug_stub/debug_stub.gyp
@@ -0,0 +1,136 @@
+#
+# Copyright 2010 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can
+# be found in the LICENSE file.
+#
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'variables': {
+ 'common_sources': [
+ 'abi.cc',
+ 'debug_stub.cc',
+ 'nacl_debug.cc',
+ 'packet.cc',
+ 'session.cc',
+ 'target.cc',
+ 'thread_common.cc',
+ 'transport_common.cc',
+ 'util.cc',
+ ],
+ 'test_sources': [
+ 'abi_test.cc',
+ 'packet_test.cc',
+ 'session_test.cc',
+ 'util_test.cc',
+ 'test.cc',
+ ],
+ 'conditions': [
+ ['OS=="linux" or OS=="mac"', {
+ 'platform_sources': [
+ 'posix/debug_stub_posix.cc',
+ 'posix/platform_impl.cc',
+ 'posix/thread_impl.cc',
+ ],
+ }],
+ ['OS=="win"', {
+ 'platform_sources': [
+ 'win/debug_stub_win.cc',
+ 'win/platform_impl.cc',
+ 'win/thread_impl.cc',
+ ],
+ }],
+ ],
+ },
+
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['OS=="linux" or OS=="mac"', {
+ 'cflags': [
+ '-fexceptions',
+ ],
+ 'cflags_cc' : [
+ '-frtti',
+ ]
+ }],
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fexceptions
+ 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti
+ }
+ }],
+ ['OS=="linux" or OS=="mac"', {
+ 'cflags': [
+ '-Wno-long-long',
+ ],
+ }],
+ ['target_base=="debug_stub"', {
+ 'sources': [
+ '<@(common_sources)',
+ '<@(platform_sources)',
+ ],
+ }],
+ ],
+ },
+ 'targets': [
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'debug_stub',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'debug_stub',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ ],
+ },
+ {
+ 'target_name': 'gdb_rsp_test',
+ 'type': 'executable',
+ 'sources': [
+ '<@(test_sources)',
+ ],
+ 'dependencies': [
+ 'debug_stub',
+ ]
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ # ---------------------------------------------------------------------
+ {
+ 'target_name': 'debug_stub64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'debug_stub',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ ],
+ },
+ {
+ 'target_name': 'gdb_rsp_test64',
+ 'type': 'executable',
+ 'sources': [
+ '<@(test_sources)',
+ ],
+ 'configurations': {
+ 'Common_Base': {
+ 'msvs_target_platform': 'x64',
+ },
+ },
+ 'dependencies': [
+ 'debug_stub64',
+ ]
+ },
+ ],
+ }],
+ ],
+}
+
diff --git a/chromium/native_client/src/trusted/desc/desc.gyp b/chromium/native_client/src/trusted/desc/desc.gyp
new file mode 100644
index 00000000000..813f974fe2d
--- /dev/null
+++ b/chromium/native_client/src/trusted/desc/desc.gyp
@@ -0,0 +1,258 @@
+# -*- python -*-
+# Copyright 2008, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+{
+ 'variables': {
+ },
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="nrd_xfer"', {
+ 'sources': [
+ 'nacl_desc_base.c',
+ 'nacl_desc_base.h',
+ 'nacl_desc_cond.c',
+ 'nacl_desc_cond.h',
+ 'nacl_desc_custom.c',
+ 'nacl_desc_custom.h',
+ 'nacl_desc_dir.c',
+ 'nacl_desc_dir.h',
+ 'nacl_desc_effector.h',
+ 'nacl_desc_effector_trusted_mem.c',
+ 'nacl_desc_effector_trusted_mem.h',
+ 'nacl_desc_imc.c',
+ 'nacl_desc_imc.h',
+ 'nacl_desc_imc_shm.c',
+ 'nacl_desc_imc_shm.h',
+ 'nacl_desc_invalid.c',
+ 'nacl_desc_invalid.h',
+ 'nacl_desc_io.c',
+ 'nacl_desc_io.h',
+ 'nacl_desc_mutex.c',
+ 'nacl_desc_mutex.h',
+ 'nacl_desc_null.c',
+ 'nacl_desc_null.h',
+ 'nacl_desc_rng.c',
+ 'nacl_desc_rng.h',
+ 'nacl_desc_quota.c',
+ 'nacl_desc_quota.h',
+ 'nacl_desc_quota_interface.c',
+ 'nacl_desc_quota_interface.h',
+ 'nacl_desc_semaphore.c',
+ 'nacl_desc_semaphore.h',
+ 'nacl_desc_sync_socket.c',
+ 'nacl_desc_sync_socket.h',
+ 'nrd_all_modules.c',
+ 'nrd_all_modules.h',
+ # nrd_xfer_obj = env_no_strict_aliasing.ComponentObject('nrd_xfer.c')
+ 'nrd_xfer.c',
+ 'nrd_xfer.h',
+ 'nrd_xfer_intern.h',
+ ],
+ # TODO(bsy,bradnelson): when gyp can do per-file flags, make
+ # -fno-strict-aliasing and -Wno-missing-field-initializers
+ # apply only to nrd_xfer.c
+ 'cflags': [
+ '-fno-strict-aliasing',
+ '-Wno-missing-field-initializers'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS': [
+ '-fno-strict-aliasing',
+ '-Wno-missing-field-initializers'
+ ]
+ },
+ 'conditions': [
+ ['OS=="linux"', {
+ 'sources': [
+ 'linux/nacl_desc_sysv_shm.c',
+ 'linux/nacl_desc_sysv_shm.h',
+ 'posix/nacl_desc.c',
+ ],
+ }],
+ ['OS=="mac"', {
+ 'sources': [
+ 'posix/nacl_desc.c',
+ ],
+ # Turning -pedantic off is a hack. Without it, clang
+ # complains that macro arguments are empty, which is
+ # only permitted in c99 and c++0x modes. This is true
+ # even when DYNAMIC_ANNOTATIONS_ENABLED is 0 (see
+ # base/third_party/dynamic_annotations/dynamic_annotations.h).
+ # We really should split nacl_desc_wrapper.{cc,h} into its
+ # own library to isolate the build warning relaxation to just
+ # that one file. Of course, any dependent of nacl_desc_wrapper.h
+ # will also need this.
+ 'conditions': [
+ ['clang==1', {
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-pedantic',
+ ]}
+ }]
+ ]
+ }],
+ ['OS=="win"', { 'sources': [
+ 'win/nacl_desc.c',
+ ]}],
+ ['OS=="win"',
+ # String-based bound socket implementation.
+ {'sources': [
+ 'nacl_desc_conn_cap.c',
+ 'nacl_desc_imc_bound_desc.c',
+ 'nacl_makeboundsock.c',
+ ],
+ },
+ # FD-based bound socket implementation.
+ {
+ 'sources': [
+ 'posix/nacl_desc_conn_cap.c',
+ 'posix/nacl_desc_imc_bound_desc.c',
+ 'posix/nacl_makeboundsock.c',
+ ],
+ }
+ ],
+ ],
+ }],
+ ['target_base=="desc_wrapper"', {
+ 'sources': [
+ 'nacl_desc_wrapper.cc',
+ 'nacl_desc_wrapper.h',
+ ],
+ 'cflags': [
+ '-fno-strict-aliasing',
+ '-Wno-missing-field-initializers'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS': [
+ '-fno-strict-aliasing',
+ '-Wno-missing-field-initializers'
+ ]
+ },
+ 'conditions': [
+ ['OS=="mac"', {
+ # Turning -pedantic off is a hack. Without it, clang
+ # complains that macro arguments are empty, which is
+ # only permitted in c99 and c++0x modes. This is true
+ # even when DYNAMIC_ANNOTATIONS_ENABLED is 0 (see
+ # base/third_party/dynamic_annotations/dynamic_annotations.h).
+ # We really should split nacl_desc_wrapper.{cc,h} into its
+ # own library to isolate the build warning relaxation to just
+ # that one file. Of course, any dependent of nacl_desc_wrapper.h
+ # will also need this.
+ 'conditions': [
+ ['clang==1', {
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-pedantic',
+ ]}
+ }]
+ ]
+ }],
+ ],
+ }],
+ ],
+ },
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'nrd_xfer64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'nrd_xfer',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ 'desc_wrapper64',
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc64',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base64',
+ ],
+ },
+ {
+ 'target_name': 'desc_wrapper64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'desc_wrapper',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ # 'nrd_xfer64',
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc64',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base64',
+ ],
+ },
+ ],
+ }],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'nrd_xfer',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'nrd_xfer',
+ },
+ # TODO(bsy): this is a lie. desc_wrapper depends on nrd_xfer, not
+ # the other way around. we need this lie until chrome's plugin.gyp
+ # is updated to depend on desc_wrapper (which requires Cr to roll
+ # DEPS to pick up a new version of NaCl), and then NaCl rolls deps
+ # to pick up the new Cr version of plugin.gyp which depends on
+ # desc_wrapper (as well as nrd_xfer), after which the bogus
+ # dependency of nrd_xfer on desc_wrapper can go away, and the
+ # correct dependency added.
+ 'dependencies': [
+ 'desc_wrapper',
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base',
+ ],
+ },
+ {
+ 'target_name': 'desc_wrapper',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'desc_wrapper',
+ },
+ 'dependencies': [
+ # 'nrd_xfer',
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/fault_injection/fault_injection.gyp b/chromium/native_client/src/trusted/fault_injection/fault_injection.gyp
new file mode 100644
index 00000000000..8f7f3312514
--- /dev/null
+++ b/chromium/native_client/src/trusted/fault_injection/fault_injection.gyp
@@ -0,0 +1,61 @@
+# -*- python -*-
+#
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="nacl_fault_inject"', {
+ 'sources': [
+ 'fault_injection.h',
+ 'fault_injection.c',
+ 'test_injection.h',
+ 'test_injection.c',
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS': [
+ '-fno-strict-aliasing',
+ '-Wno-missing-field-initializers'
+ ]
+ },
+ },
+ ]],
+ },
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'nacl_fault_inject64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'nacl_fault_inject',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ ],
+ },
+ ],
+ }],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'nacl_fault_inject',
+ 'type': 'static_library', # 'dynamic_library', ?!?
+ 'variables': {
+ 'target_base': 'nacl_fault_inject',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/generic_container/generic_container.gyp b/chromium/native_client/src/trusted/generic_container/generic_container.gyp
new file mode 100644
index 00000000000..1a08a6524d6
--- /dev/null
+++ b/chromium/native_client/src/trusted/generic_container/generic_container.gyp
@@ -0,0 +1,56 @@
+# -*- python -*-
+#
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="generic_container"', {
+ 'sources': [
+ 'container.h',
+ 'container_list.c',
+ 'container_list.h',
+ 'container_hash_table.c',
+ 'container_hash_table.h',
+ ],
+ },
+ ]],
+ },
+ 'conditions': [
+ ['OS=="win"', {
+ 'targets': [
+ {
+ 'target_name': 'generic_container64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'generic_container',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ ],
+ },
+ ],
+ }],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'generic_container',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'generic_container',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/gio/gio_wrapped_desc.gyp b/chromium/native_client/src/trusted/gio/gio_wrapped_desc.gyp
new file mode 100644
index 00000000000..8fed9326ae5
--- /dev/null
+++ b/chromium/native_client/src/trusted/gio/gio_wrapped_desc.gyp
@@ -0,0 +1,70 @@
+# -*- python -*-
+# Copyright 2010 The Native Client Authors. All rights reserved. Use
+# of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['OS=="linux" or OS=="mac"', {
+ 'cflags': [
+ '-fexceptions',
+ ],
+ 'cflags_cc' : [
+ '-frtti',
+ ]
+ }],
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES', # -fexceptions
+ 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti
+ }
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'gio_wrapped_desc',
+ 'type': 'static_library',
+ 'sources': [
+ 'gio_shm.c',
+ 'gio_shm_unbounded.c',
+ 'gio_nacl_desc.c',
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer',
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'gio_wrapped_desc64',
+ 'type': 'static_library',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'sources': [
+ 'gio_shm.c',
+ 'gio_shm_unbounded.c',
+ 'gio_nacl_desc.c',
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio64',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer64',
+ ],
+ },
+ ],
+ }],
+ ]
+}
diff --git a/chromium/native_client/src/trusted/gio/gio_wrapped_desc_tests.gyp b/chromium/native_client/src/trusted/gio/gio_wrapped_desc_tests.gyp
new file mode 100644
index 00000000000..e0d071b728e
--- /dev/null
+++ b/chromium/native_client/src/trusted/gio/gio_wrapped_desc_tests.gyp
@@ -0,0 +1,80 @@
+# -*- python -*-
+# Copyright 2010 The Native Client Authors. All rights reserved. Use
+# of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'variables': {
+ 'conditions': [
+ ['OS=="win"', {
+ 'msvs_cygwin_shell': 0,
+ }],
+ ],
+ },
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['OS=="mac"', {
+ 'xcode_settings': {
+ 'GCC_ENABLE_CPP_RTTI': 'YES', # override -fno-rtti
+ },
+ }],
+ ],
+ 'cflags_cc!': ['-fno-rtti'],
+ },
+ 'targets': [
+ {
+ 'target_name': 'gio_shm_test',
+ 'type': 'executable',
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc_c',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer',
+ '<(DEPTH)/native_client/src/trusted/gio/gio_wrapped_desc.gyp:gio_wrapped_desc',
+ '<(DEPTH)/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp:nonnacl_util',
+ ],
+ 'sources': [
+ 'gio_shm_test.c',
+ ],
+ },
+ {
+ 'target_name': 'gio_shm_unbounded_test',
+ 'type': 'executable',
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc_c',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer',
+ '<(DEPTH)/native_client/src/trusted/gio/gio_wrapped_desc.gyp:gio_wrapped_desc',
+ '<(DEPTH)/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp:nonnacl_util',
+ ],
+ 'sources': [
+ 'gio_shm_unbounded_test.c',
+ ],
+ },
+ {
+ 'target_name': 'gio_nacl_desc_test',
+ 'type': 'executable',
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc_c',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer',
+ '<(DEPTH)/native_client/src/trusted/gio/gio_wrapped_desc.gyp:gio_wrapped_desc',
+ '<(DEPTH)/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp:nonnacl_util',
+ ],
+ 'sources': [
+ 'gio_nacl_desc_test.c',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/interval_multiset/interval_multiset.gyp b/chromium/native_client/src/trusted/interval_multiset/interval_multiset.gyp
new file mode 100644
index 00000000000..087753604ad
--- /dev/null
+++ b/chromium/native_client/src/trusted/interval_multiset/interval_multiset.gyp
@@ -0,0 +1,58 @@
+# -*- python -*-
+#
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="nacl_interval"', {
+ 'sources': [
+ 'nacl_interval_multiset_delete.c',
+ 'nacl_interval_multiset_factory.c',
+ 'nacl_interval_multiset.h',
+ 'nacl_interval_list.c',
+ 'nacl_interval_list.h',
+ 'nacl_interval_range_tree.c',
+ 'nacl_interval_range_tree.h',
+ ],
+ },
+ ]],
+ },
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'nacl_interval64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'nacl_interval',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ ],
+ },
+ ],
+ }],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'nacl_interval',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'nacl_interval',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/manifest_name_service_proxy/manifest_name_service_proxy.gyp b/chromium/native_client/src/trusted/manifest_name_service_proxy/manifest_name_service_proxy.gyp
new file mode 100644
index 00000000000..183886d0a2f
--- /dev/null
+++ b/chromium/native_client/src/trusted/manifest_name_service_proxy/manifest_name_service_proxy.gyp
@@ -0,0 +1,64 @@
+# -*- python -*-
+# Copyright 2011 (c) The Native Client Authors. All rights reserved. Use
+# of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="manifest_proxy"', {
+ 'sources': [
+ 'manifest_proxy.h',
+ 'manifest_proxy.c',
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS': [
+ '-Wno-missing-field-initializers'
+ ]
+ },
+ },
+ ]],
+ },
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'manifest_proxy64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'manifest_proxy',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc64',
+ '<(DEPTH)/native_client/src/trusted/threading/threading.gyp:thread_interface64',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer64',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base64',
+ ],
+ },
+ ],
+ }],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'manifest_proxy',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'manifest_proxy',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc',
+ '<(DEPTH)/native_client/src/trusted/threading/threading.gyp:thread_interface',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/nacl_base/nacl_base.gyp b/chromium/native_client/src/trusted/nacl_base/nacl_base.gyp
new file mode 100644
index 00000000000..ccdd4bcaac6
--- /dev/null
+++ b/chromium/native_client/src/trusted/nacl_base/nacl_base.gyp
@@ -0,0 +1,60 @@
+# -*- python -*-
+#
+# Copyright 2010 The Native Client Authors. All rights reserved. Use
+# of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="nacl_base"', {
+ 'sources': [
+ 'nacl_refcount.h',
+ 'nacl_refcount.c',
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS': [
+ '-fno-strict-aliasing',
+ '-Wno-missing-field-initializers'
+ ]
+ },
+ },
+ ]],
+ },
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'nacl_base64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'nacl_base',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc64',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ ],
+ },
+ ],
+ }],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'nacl_base',
+ 'type': 'static_library', # 'dynamic_library', ?!?
+ 'variables': {
+ 'target_base': 'nacl_base',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp b/chromium/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp
new file mode 100644
index 00000000000..51187faf0f2
--- /dev/null
+++ b/chromium/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp
@@ -0,0 +1,127 @@
+# -*- python -*-
+#
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+
+# TODO(sehr): remove need for the warning flag removals below
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="sel_ldr_launcher"', {
+ 'sources': [
+ 'launcher_factory.cc',
+ 'sel_ldr_launcher.h',
+ 'sel_ldr_launcher_base.cc',
+ 'sel_ldr_launcher_standalone.cc',
+ ],
+ 'conditions':[
+ ['OS=="win"', {
+ 'sources': [
+ 'win/sel_ldr_launcher_win.cc',
+ ],
+ }],
+ ['OS=="linux"', {
+ 'sources': [
+ 'posix/sel_ldr_launcher_posix.cc',
+ 'posix/sel_ldr_launcher_zygote_posix.cc',
+ 'posix/get_plugin_dirname.cc',
+ ],
+ }],
+ ['OS=="mac"', {
+ 'sources': [
+ 'posix/sel_ldr_launcher_posix.cc',
+ 'posix/sel_ldr_launcher_zygote_posix.cc',
+ 'osx/get_plugin_dirname.mm',
+ ],
+ }]
+ ],
+ 'cflags!': [
+ '-Wextra',
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-pedantic', # import is a gcc extension
+ '-Wextra',
+ ]
+ },
+ }],
+ ]
+ },
+ 'targets': [
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'sel_ldr_launcher',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'sel_ldr_launcher',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc',
+ '<(DEPTH)/native_client/src/shared/serialization/serialization.gyp:serialization',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer',
+ '<(DEPTH)/native_client/src/trusted/service_runtime/service_runtime.gyp:env_cleanser',
+ '<(DEPTH)/native_client/src/trusted/service_runtime/service_runtime.gyp:nacl_error_code',
+ ],
+ },
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'nonnacl_util',
+ 'type': 'static_library',
+ 'dependencies': [
+ 'sel_ldr_launcher',
+ ],
+ 'includes': [
+ 'nonnacl_util.gypi',
+ ],
+ },
+ ],
+ # ----------------------------------------------------------------------
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ # --------------------------------------------------------------------
+ {
+ 'target_name': 'sel_ldr_launcher64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'sel_ldr_launcher',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio64',
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc64',
+ '<(DEPTH)/native_client/src/shared/serialization/serialization.gyp:serialization64',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc64',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer64',
+ '<(DEPTH)/native_client/src/trusted/service_runtime/service_runtime.gyp:env_cleanser64',
+ '<(DEPTH)/native_client/src/trusted/service_runtime/service_runtime.gyp:nacl_error_code64',
+ ],
+ },
+ # --------------------------------------------------------------------
+ {
+ 'target_name': 'nonnacl_util64',
+ 'type': 'static_library',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ 'sel_ldr_launcher64',
+ ],
+ 'includes': [
+ 'nonnacl_util.gypi',
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/nonnacl_util/nonnacl_util.gypi b/chromium/native_client/src/trusted/nonnacl_util/nonnacl_util.gypi
new file mode 100644
index 00000000000..f8ae3022226
--- /dev/null
+++ b/chromium/native_client/src/trusted/nonnacl_util/nonnacl_util.gypi
@@ -0,0 +1,35 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'conditions': [
+ ['OS=="linux"', {
+ 'sources': [
+ 'posix/get_plugin_dirname.cc',
+ 'posix/sel_ldr_launcher_posix.cc',
+ ],
+ }],
+ ['OS=="mac"', {
+ 'sources': [
+ 'osx/get_plugin_dirname.mm',
+ 'posix/sel_ldr_launcher_posix.cc',
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-pedantic', # import is a gcc extension
+ ],
+ },
+ 'link_settings': {
+ 'libraries': [
+ '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
+ ],
+ },
+ }],
+ ['OS=="win"', {
+ 'sources': [
+ 'win/sel_ldr_launcher_win.cc',
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/perf_counter/perf_counter.gyp b/chromium/native_client/src/trusted/perf_counter/perf_counter.gyp
new file mode 100644
index 00000000000..d3a32d89c57
--- /dev/null
+++ b/chromium/native_client/src/trusted/perf_counter/perf_counter.gyp
@@ -0,0 +1,45 @@
+# Copyright 2011 (c) The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ # ----------------------------------------------------------------------
+ # Default settings
+ # ----------------------------------------------------------------------
+
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+
+
+ # ----------------------------------------------------------------------
+ # actual targets
+ # ----------------------------------------------------------------------
+ 'targets': [
+ {
+ 'target_name': 'nacl_perf_counter',
+ 'type': 'static_library',
+ 'sources': [
+ 'nacl_perf_counter.c',
+ ],
+ },
+ ],
+
+ # Version for windows 64.
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'nacl_perf_counter64',
+ 'type': 'static_library',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'sources': [
+ 'nacl_perf_counter.c',
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/perf_counter/perf_counter_tests.gyp b/chromium/native_client/src/trusted/perf_counter/perf_counter_tests.gyp
new file mode 100644
index 00000000000..0b6ad2ee674
--- /dev/null
+++ b/chromium/native_client/src/trusted/perf_counter/perf_counter_tests.gyp
@@ -0,0 +1,47 @@
+# -*- python -*-
+# Copyright 2010, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+
+# TODO(jasonwkim): [2010/08/19 10:34:54 PDT (Thursday)]
+# Add in the test to gyp.
+# {
+# 'target_name': 'nacl_perf_counter_test',
+# 'type': 'executable',
+# 'dependencies': [
+# 'service_runtime.gyp:nacl_perf_counter',
+# '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+# '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
+# ],
+# 'sources': [
+# 'nacl_perf_counter_test.c',
+# ],
+# },
diff --git a/chromium/native_client/src/trusted/platform_qualify/platform_qualify.gyp b/chromium/native_client/src/trusted/platform_qualify/platform_qualify.gyp
new file mode 100644
index 00000000000..361ece6e336
--- /dev/null
+++ b/chromium/native_client/src/trusted/platform_qualify/platform_qualify.gyp
@@ -0,0 +1,120 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'variables': {
+ },
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="pqlib"', {
+ 'sources': [
+ 'kernel_version.h',
+ 'nacl_dep_qualify.h',
+ 'nacl_os_qualify.h',
+ ],
+ 'conditions': [
+ ['OS=="linux"', {
+ 'sources': [
+ 'linux/nacl_os_qualify.c',
+ 'linux/sysv_shm_and_mmap.c',
+ 'posix/nacl_dep_qualify.c',
+ ],
+ }],
+ ['OS=="mac"', {
+ 'sources': [
+ 'osx/nacl_os_qualify.c',
+ 'posix/nacl_dep_qualify.c',
+ ],
+ }],
+ ['OS=="win"', {
+ 'sources': [
+ 'win/nacl_dep_qualify.c',
+ 'win/nacl_os_qualify.c',
+ ],
+ }],
+ # x86 common sources
+ ['target_arch=="ia32" or target_arch=="x64"', {
+ 'sources': [
+ 'arch/x86/nacl_cpuwhitelist.c',
+ #'arch/x86/vcpuid.h',
+ #'arch/x86/vcpuid.c',
+ ],
+ }],
+ # x86-32 specifics
+ ['target_arch=="ia32"', {
+ 'sources': [
+ 'arch/x86_32/nacl_dep_qualify_arch.c',
+ ],
+ }],
+ # x86-64 specifics
+ ['target_arch=="x64"', {
+ 'sources': [
+ 'arch/x86_64/nacl_dep_qualify_arch.c',
+ ],
+ }],
+ # arm specifics
+ ['target_arch=="arm"', {
+ 'sources': [
+ 'arch/arm/nacl_dep_qualify_arch.c',
+ 'arch/arm/nacl_qualify_fpu.c',
+ 'arch/arm/nacl_qualify_sandbox_instrs.c',
+ 'arch/arm/nacl_qualify_unaligned.c',
+ ],
+ }],
+ ],
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'platform_qual_lib',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'pqlib',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/cpu_features/cpu_features.gyp:cpu_features',
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'platform_qual_lib64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'pqlib',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/cpu_features/cpu_features.gyp:cpu_features64',
+ ],
+ },
+ ],
+ }],
+ ],
+}
+
+# TODO:
+# # Currently, this is only defined for x86, so only compile if x86.
+# if env['TARGET_ARCHITECTURE'] != 'x86':
+# Return()
+#vcpuid_env = env.Clone()
+#if env.Bit('mac'):
+# vcpuid_env.Append(CCFLAGS = ['-mdynamic-no-pic'])
+#if env.Bit('linux'):
+# vcpuid_env.Append(CCFLAGS = ['-msse3'])
+#nacl_vcpuid = vcpuid_env.ComponentLibrary('vcpuid', 'vcpuid.c')
+#env.Append(LIBS = ['vcpuid', 'platform_qual_lib', 'ncvalidate'])
+#
+#env.ComponentProgram('platform_qual_test', 'platform_qual_test.c')
+#env.ComponentProgram('nacl_cpuwhitelist_test', 'nacl_cpuwhitelist_test.c')
+#
diff --git a/chromium/native_client/src/trusted/reverse_service/reverse_service.gyp b/chromium/native_client/src/trusted/reverse_service/reverse_service.gyp
new file mode 100644
index 00000000000..04d6adab539
--- /dev/null
+++ b/chromium/native_client/src/trusted/reverse_service/reverse_service.gyp
@@ -0,0 +1,71 @@
+# -*- python -*-
+# Copyright 2011 (c) The Native Client Authors. All rights reserved. Use
+# of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="reverse_service"', {
+ 'sources': [
+ 'reverse_service_c.h',
+ 'reverse_service.h',
+ 'reverse_service_c.c',
+ 'reverse_service.cc',
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS': [
+ '-Wno-missing-field-initializers'
+ ]
+ },
+ },
+ ]],
+ },
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'reverse_service64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'reverse_service',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc64',
+ '<(DEPTH)/native_client/src/trusted/threading/threading.gyp:thread_interface64',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:desc_wrapper64',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer64',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base64',
+ '<(DEPTH)/native_client/src/trusted/validator/validator.gyp:validation_cache64',
+ ],
+ },
+ ],
+ }],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'reverse_service',
+ 'type': 'static_library', # 'dynamic_library', ?!?
+ 'variables': {
+ 'target_base': 'reverse_service',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc',
+ '<(DEPTH)/native_client/src/trusted/threading/threading.gyp:thread_interface',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:desc_wrapper',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base',
+ '<(DEPTH)/native_client/src/trusted/simple_service/simple_service.gyp:simple_service',
+ '<(DEPTH)/native_client/src/trusted/validator/validator.gyp:validation_cache',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/sel_universal/sel_universal.gyp b/chromium/native_client/src/trusted/sel_universal/sel_universal.gyp
new file mode 100644
index 00000000000..a6a5c821fc5
--- /dev/null
+++ b/chromium/native_client/src/trusted/sel_universal/sel_universal.gyp
@@ -0,0 +1,74 @@
+# -*- python -*-
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'variables': {
+ 'src_files': ['parsing.cc',
+ 'pnacl_emu_coordinator.cc',
+ 'pnacl_emu_handler.cc',
+ 'pnacl_emu_stream.cc',
+ 'reverse_emulate.cc',
+ 'replay_handler.cc',
+ 'rpc_universal_system.cc',
+ 'rpc_universal.cc',
+ 'sel_universal.cc',
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'sel_universal',
+ 'type': 'executable',
+ 'sources': ['<@(src_files)'],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer',
+ '<(DEPTH)/native_client/src/trusted/reverse_service/reverse_service.gyp:reverse_service',
+ '<(DEPTH)/native_client/src/trusted/service_runtime/service_runtime.gyp:nacl_error_code',
+ '<(DEPTH)/native_client/src/trusted/simple_service/simple_service.gyp:simple_service',
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
+ '<(DEPTH)/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp:nonnacl_util',
+ ],
+ 'conditions': [
+ ['OS=="linux"', {
+ 'link_settings': {
+ 'libraries': [
+ '-ldl',
+ ],
+ },
+ }],
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'sel_universal64',
+ 'type': 'executable',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'sources': ['<@(src_files)'],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/imc/imc.gyp:imc64',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc64',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer64',
+ '<(DEPTH)/native_client/src/trusted/reverse_service/reverse_service.gyp:reverse_service64',
+ '<(DEPTH)/native_client/src/trusted/service_runtime/service_runtime.gyp:nacl_error_code64',
+ '<(DEPTH)/native_client/src/trusted/simple_service/simple_service.gyp:simple_service64',
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio64',
+ '<(DEPTH)/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp:nonnacl_util64',
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/service_runtime/arch/x86/service_runtime_x86.gyp b/chromium/native_client/src/trusted/service_runtime/arch/x86/service_runtime_x86.gyp
new file mode 100644
index 00000000000..d75854dfef9
--- /dev/null
+++ b/chromium/native_client/src/trusted/service_runtime/arch/x86/service_runtime_x86.gyp
@@ -0,0 +1,85 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="srt_x86_cmn"', {
+ 'sources': [
+ 'nacl_ldt_x86.c',
+ ],
+ 'include_dirs': [
+ '<(INTERMEDIATE_DIR)',
+ '<(SHARED_INTERMEDIATE_DIR)',
+ ],
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'service_runtime_x86_common',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'srt_x86_cmn',
+ },
+ 'include_dirs': [
+ '<(SHARED_INTERMEDIATE_DIR)',
+ ],
+ 'conditions': [
+ ['nacl_validator_ragel==0 and target_arch=="ia32"', {
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator/x86/32/validator_x86_32.gyp:ncvalidate_x86_32',
+ ],
+ }],
+ ['nacl_validator_ragel!=0 and target_arch=="ia32"', {
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator_ragel/dfa_validator_x86_32.gyp:dfa_validate_x86_32',
+ ],
+ }],
+ ['nacl_validator_ragel==0 and target_arch=="x64"', {
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator/x86/64/validator_x86_64.gyp:ncvalidate_x86_64',
+ ],
+ }],
+ ['nacl_validator_ragel!=0 and target_arch=="x64"', {
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator_ragel/dfa_validator_x86_64.gyp:dfa_validate_x86_64',
+ ],
+ }],
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'service_runtime_x86_common64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'srt_x86_cmn',
+ 'win_target': 'x64',
+ },
+ 'conditions': [
+ ['nacl_validator_ragel==0', {
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator/x86/64/validator_x86_64.gyp:ncvalidate_x86_64',
+ ],
+ }],
+ ['nacl_validator_ragel!=0', {
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator_ragel/dfa_validator_x86_64.gyp:dfa_validate_x86_64',
+ ],
+ }],
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/service_runtime/arch/x86_32/service_runtime_x86_32.gyp b/chromium/native_client/src/trusted/service_runtime/arch/x86_32/service_runtime_x86_32.gyp
new file mode 100644
index 00000000000..d4f3bbbdc56
--- /dev/null
+++ b/chromium/native_client/src/trusted/service_runtime/arch/x86_32/service_runtime_x86_32.gyp
@@ -0,0 +1,75 @@
+# Copyright 2009, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+{
+ 'includes': [
+ '../../../../../build/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'service_runtime_x86_32',
+ 'type': 'static_library',
+ 'sources': [
+ 'nacl_app_32.c',
+ 'nacl_switch_32.S',
+ 'nacl_switch_all_regs_32.c',
+ 'nacl_switch_all_regs_asm_32.S',
+ 'nacl_switch_to_app_32.c',
+ 'nacl_syscall_32.S',
+ 'nacl_tls_32.c',
+ 'sel_addrspace_x86_32.c',
+ 'sel_ldr_x86_32.c',
+ 'sel_rt_32.c',
+ 'springboard.S',
+ 'tramp_32.S',
+ ],
+ # VS2010 does not correctly incrementally link obj files generated from
+ # asm files. This flag disables UseLibraryDependencyInputs to avoid
+ # this problem.
+ 'msvs_2010_disable_uldi_when_referenced': 1,
+ 'conditions': [
+ ['OS=="mac"', {
+ 'sources' : [
+ '../../osx/nacl_signal_32.c',
+ ] },
+ ],
+ ['OS=="linux"', {
+ 'sources' : [
+ '../../linux/nacl_signal_32.c',
+ ] },
+ ],
+ ['OS=="win"', {
+ 'sources' : [
+ '../../win/nacl_signal_32.c',
+ ] },
+ ],
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/service_runtime/arch/x86_64/service_runtime_x86_64.gyp b/chromium/native_client/src/trusted/service_runtime/arch/x86_64/service_runtime_x86_64.gyp
new file mode 100644
index 00000000000..32f6e3ae63c
--- /dev/null
+++ b/chromium/native_client/src/trusted/service_runtime/arch/x86_64/service_runtime_x86_64.gyp
@@ -0,0 +1,84 @@
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../../../build/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'service_runtime_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'sources': [
+ 'nacl_app_64.c',
+ 'nacl_switch_64.S',
+ 'nacl_switch_to_app_64.c',
+ 'nacl_syscall_64.S',
+ 'nacl_tls_64.c',
+ 'sel_ldr_x86_64.c',
+ 'sel_rt_64.c',
+ 'tramp_64.S',
+ ],
+ 'defines': [
+ # For now, we are only supporting the the zero-based sandbox
+ # build in scons.
+ 'NACL_X86_64_ZERO_BASED_SANDBOX=0',
+ ],
+ 'conditions': [
+ ['OS=="mac"', {
+ 'sources' : [
+ '../../osx/nacl_signal_64.c',
+ 'sel_addrspace_posix_x86_64.c',
+ ] },
+ ],
+ ['OS=="linux"', {
+ 'sources' : [
+ '../../linux/nacl_signal_64.c',
+ 'sel_addrspace_posix_x86_64.c',
+ ] },
+ ],
+ ['OS=="win"', {
+ 'sources' : [
+ '../../win/exception_patch/exit_fast.S',
+ '../../win/exception_patch/intercept.S',
+ '../../win/exception_patch/ntdll_patch.c',
+ '../../win/nacl_signal_64.c',
+ 'nacl_switch_unwind_win.asm',
+ 'sel_addrspace_win_x86_64.c',
+ 'fnstcw.S',
+ 'fxsaverstor.S',
+ ] },
+ ],
+ ],
+ # We assemble the .asm assembly file with the Microsoft
+ # assembler because we need to generate x86-64 Windows unwind
+ # info, which the GNU assembler we use elsewhere does not
+ # support.
+ 'rules': [
+ {
+ 'rule_name': 'Assemble',
+ 'msvs_cygwin_shell': 0,
+ 'msvs_quote_cmd': 0,
+ 'extension': 'asm',
+ 'inputs': [],
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).obj',
+ ],
+ 'action': [
+ 'ml64',
+ '/Fo', '<(INTERMEDIATE_DIR)\<(RULE_INPUT_ROOT).obj',
+ '/c', '<(RULE_INPUT_PATH)',
+ ],
+ 'process_outputs_as_sources': 1,
+ 'message':
+ 'Assembling <(RULE_INPUT_PATH) to ' \
+ '<(INTERMEDIATE_DIR)\<(RULE_INPUT_ROOT).obj.',
+ },
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp b/chromium/native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp
new file mode 100644
index 00000000000..784e8fff4cf
--- /dev/null
+++ b/chromium/native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp
@@ -0,0 +1,217 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../../build/common.gypi',
+ ],
+ 'conditions': [
+ ['target_arch=="x64"', {
+ 'variables': {
+ # No extra reservation.
+ 'nacl_reserve_top': '0x0',
+ }
+ }],
+ ['target_arch=="ia32"', {
+ 'variables': {
+ # 1G address space.
+ 'nacl_reserve_top': '0x40000000',
+ }
+ }],
+ ['target_arch=="arm"', {
+ 'variables': {
+ # 1G address space, plus 8K guard area above.
+ 'nacl_reserve_top': '0x40002000',
+ }
+ }],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'nacl_bootstrap_munge_phdr',
+ 'type': 'executable',
+ 'toolsets': ['host'],
+ 'sources': [
+ 'nacl_bootstrap_munge_phdr.c',
+ ],
+ 'libraries': [
+ '-lelf',
+ ],
+ # This is an ugly kludge because gyp doesn't actually treat
+ # host_arch=x64 target_arch=ia32 as proper cross compilation.
+ # It still wants to compile the "host" program with -m32 et
+ # al. Though a program built that way can indeed run on the
+ # x86-64 host, we cannot reliably build this program on such a
+ # host because Ubuntu does not provide the full suite of
+ # x86-32 libraries in packages that can be installed on an
+ # x86-64 host; in particular, libelf is missing. So here we
+ # use the hack of eliding all the -m* flags from the
+ # compilation lines, getting the command close to what they
+ # would be if gyp were to really build properly for the host.
+ # TODO(bradnelson): Clean up with proper cross support.
+ 'cflags/': [['exclude', '-m.*'],
+ ['exclude', '--sysroot=.*']],
+ 'ldflags/': [['exclude', '-m.*'],
+ ['exclude', '--sysroot=.*']],
+ },
+ {
+ 'target_name': 'nacl_bootstrap_lib',
+ 'type': 'static_library',
+ 'product_dir': '<(SHARED_INTERMEDIATE_DIR)/nacl_bootstrap',
+ 'hard_depencency': 1,
+ 'include_dirs': [
+ '..',
+ ],
+ 'sources': [
+ 'nacl_bootstrap.c',
+ ],
+ 'cflags': [
+ # Prevent llvm-opt from replacing my_bzero with a call
+ # to memset.
+ '-fno-builtin',
+ # The tiny standalone bootstrap program is incompatible with
+ # -fstack-protector, which might be on by default. That switch
+ # requires using the standard libc startup code, which we do not.
+ '-fno-stack-protector',
+ # We don't want to compile it PIC (or its cousin PIE), because
+ # it goes at an absolute address anyway, and because any kind
+ # of PIC complicates life for the x86-32 assembly code. We
+ # append -fno-* flags here instead of using a 'cflags!' stanza
+ # to remove -f* flags, just in case some system's compiler
+ # defaults to using PIC for everything.
+ '-fno-pic', '-fno-PIC',
+ '-fno-pie', '-fno-PIE',
+ ],
+ 'cflags!': [
+ '-fsanitize=address',
+ '-w',
+ # We filter these out because release_extra_cflags or another
+ # such thing might be adding them in, and those options wind up
+ # coming after the -fno-stack-protector we added above.
+ '-fstack-protector',
+ '-fstack-protector-all',
+ '-fprofile-generate',
+ '-finstrument-functions',
+ '-funwind-tables',
+ ],
+ 'conditions': [
+ ['clang==1', {
+ 'cflags': [
+ # TODO(bbudge) Remove this when Clang supports -fno-pic.
+ '-Qunused-arguments',
+ ],
+ }],
+ ],
+ },
+ {
+ 'target_name': 'nacl_bootstrap_raw',
+ 'type': 'none',
+ # This magical flag tells Gyp that the dependencies of this target
+ # are nobody else's business and it should not propagate them up
+ # to things that list this as a dependency. Without this, it will
+ # wind up adding the nacl_bootstrap_lib static library into the
+ # link of sel_ldr or chrome just because one executable depends on
+ # the other.
+ # TODO(mcgrathr): Maybe one day Gyp will grow a proper target type
+ # for the use we really want here: custom commands for linking an
+ # executable, and no peeking inside this target just because you
+ # depend on it. Then we could stop using this utterly arcane flag
+ # in favor of something vaguely self-explanatory.
+ # See http://code.google.com/p/gyp/issues/detail?id=239 for the
+ # history of the arcana.
+ 'dependencies_traverse': 0,
+ 'dependencies': [
+ 'nacl_bootstrap_lib',
+ ],
+ 'actions': [
+ {
+ 'action_name': 'link_with_ld_bfd',
+ 'variables': {
+ 'bootstrap_lib': '<(SHARED_INTERMEDIATE_DIR)/nacl_bootstrap/<(STATIC_LIB_PREFIX)nacl_bootstrap_lib<(STATIC_LIB_SUFFIX)',
+ 'linker_script': 'nacl_bootstrap.x',
+ },
+ 'inputs': [
+ '<(linker_script)',
+ '<(bootstrap_lib)',
+ 'ld_bfd.py',
+ ],
+ 'outputs': [
+ '<(PRODUCT_DIR)/nacl_bootstrap_raw',
+ ],
+ 'message': 'Linking nacl_bootstrap_raw',
+ 'conditions': [
+ ['target_arch=="x64"', {
+ 'variables': {
+ 'linker_emulation': 'elf_x86_64',
+ }
+ }],
+ ['target_arch=="ia32"', {
+ 'variables': {
+ 'linker_emulation': 'elf_i386',
+ }
+ }],
+ ['target_arch=="arm"', {
+ 'variables': {
+ 'linker_emulation': 'armelf_linux_eabi',
+ }
+ }],
+ ],
+ 'action': ['python', 'ld_bfd.py',
+ # ld_bfd.py needs to know the target compiler used for the
+ # build but the $CXX environment variable might only be
+ # set at gyp time. This is a hacky way to bake the correct
+ # CXX into the build at gyp time.
+ # TODO(sbc): Do this better by providing some gyp syntax
+ # for accessing the name of the configured compiler, or
+ # even a better way to access gyp time environment
+ # variables from within a gyp file.
+ '--compiler', '<!(echo ${CXX:=g++})',
+ '-m', '<(linker_emulation)',
+ '--build-id',
+ # This program is (almost) entirely
+ # standalone. It has its own startup code, so
+ # no crt1.o for it. It is statically linked,
+ # and on x86 it does not use libc at all.
+ # However, on ARM it needs a few (safe) things
+ # from libc.
+ '-static',
+ # Link with custom linker script for special
+ # layout. The script uses the symbol RESERVE_TOP.
+ '--defsym', 'RESERVE_TOP=<(nacl_reserve_top)',
+ '--script=<(linker_script)',
+ '-o', '<@(_outputs)',
+ # On x86-64, the default page size with some
+ # linkers is 2M rather than the real Linux page
+ # size of 4K. A larger page size is incompatible
+ # with our custom linker script's special layout.
+ '-z', 'max-page-size=0x1000',
+ '--whole-archive', '<(bootstrap_lib)',
+ '--no-whole-archive',
+ ],
+ }
+ ],
+ },
+ {
+ 'target_name': 'nacl_helper_bootstrap',
+ 'dependencies': [
+ 'nacl_bootstrap_raw',
+ 'nacl_bootstrap_munge_phdr#host',
+ ],
+ 'type': 'none',
+ # See above about this magical flag.
+ # It's actually redundant in practice to have it here as well.
+ # But it expresses the intent: that anything that depends on
+ # this target has no interest in what goes into building it.
+ 'dependencies_traverse': 0,
+ 'actions': [{
+ 'action_name': 'munge_phdr',
+ 'inputs': ['nacl_bootstrap_munge_phdr.py',
+ '<(PRODUCT_DIR)/nacl_bootstrap_munge_phdr',
+ '<(PRODUCT_DIR)/nacl_bootstrap_raw'],
+ 'outputs': ['<(PRODUCT_DIR)/nacl_helper_bootstrap'],
+ 'message': 'Munging ELF program header',
+ 'action': ['python', '<@(_inputs)', '<@(_outputs)']
+ }],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/service_runtime/service_runtime.gyp b/chromium/native_client/src/trusted/service_runtime/service_runtime.gyp
new file mode 100644
index 00000000000..f102438b9e9
--- /dev/null
+++ b/chromium/native_client/src/trusted/service_runtime/service_runtime.gyp
@@ -0,0 +1,445 @@
+# -*- gyp -*-
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'variables': {
+ 'conditions': [
+ ['OS=="linux"', {
+ 'syscall_handler': [
+ 'posix/nacl_syscall_impl.c'
+ ],
+ }],
+ ['OS=="mac"', {
+ 'syscall_handler': [
+ 'posix/nacl_syscall_impl.c'
+ ],
+ }],
+ ['OS=="win"', {
+ 'syscall_handler': [
+ 'win/nacl_syscall_impl.c'
+ ],
+ 'msvs_cygwin_shell': 0,
+ }],
+ ],
+ },
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="sel"', {
+ 'sources': [
+ 'dyn_array.c',
+ 'elf_util.c',
+ 'load_file.c',
+ 'nacl_all_modules.c',
+ 'nacl_app_thread.c',
+ 'nacl_bootstrap_channel_error_reporter.c',
+ 'nacl_copy.c',
+ 'nacl_desc_effector_ldr.c',
+ 'nacl_desc_postmessage.c',
+ 'nacl_error_gio.c',
+ 'nacl_error_log_hook.c',
+ 'nacl_globals.c',
+ 'nacl_kernel_service.c',
+ 'nacl_resource.c',
+ 'nacl_reverse_quota_interface.c',
+ 'nacl_secure_service.c',
+ 'nacl_signal_common.c',
+ 'nacl_stack_safety.c',
+ 'nacl_syscall_common.c',
+ 'nacl_syscall_hook.c',
+ 'nacl_text.c',
+ 'nacl_valgrind_hooks.c',
+ 'name_service/default_name_service.c',
+ 'name_service/name_service.c',
+ 'sel_addrspace.c',
+ 'sel_ldr.c',
+ 'sel_ldr_standard.c',
+ 'sel_ldr_thread_interface.c',
+ # TODO(mseaborn): Move sel_main_chrome.c to the
+ # "sel_main_chrome" library once Chromium is changed to
+ # depend on that rather than on "sel".
+ 'sel_main_chrome.c',
+ 'sel_mem.c',
+ 'sel_qualify.c',
+ 'sel_validate_image.c',
+ 'sys_list_mappings.c',
+ 'thread_suspension_common.c',
+ 'thread_suspension_unwind.c',
+ ],
+ 'include_dirs': [
+ # For generated header files from the x86-64 validator,
+ # e.g. nacl_disallows.h.
+ '<(SHARED_INTERMEDIATE_DIR)',
+ ],
+ 'sources!': [
+ '<(syscall_handler)',
+ ],
+ 'actions': [
+ {
+ 'action_name': 'nacl_syscall_handler',
+ 'inputs': [
+ 'nacl_syscall_handlers_gen.py',
+ '<(syscall_handler)',
+ ],
+ 'action':
+ # TODO(gregoryd): find out how to generate a file
+ # in such a location that can be found in both
+ # NaCl and Chrome builds.
+ ['<@(python_exe)', 'nacl_syscall_handlers_gen.py',
+ '-i', '<@(syscall_handler)',
+ '-o', '<@(_outputs)'],
+
+ 'msvs_cygwin_shell': 0,
+ 'msvs_quote_cmd': 0,
+ 'outputs': [
+ '<(INTERMEDIATE_DIR)/nacl_syscall_handlers.c',
+ ],
+ 'process_outputs_as_sources': 1,
+ 'message': 'Creating nacl_syscall_handlers.c',
+ },
+ ],
+ 'conditions': [
+ ['OS=="mac"', {
+ 'sources': [
+ 'osx/crash_filter.c',
+ 'osx/mach_exception_handler.c',
+ 'osx/mach_thread_map.c',
+ 'osx/nacl_ldt.c',
+ 'osx/nacl_thread_nice.c',
+ 'osx/outer_sandbox.c',
+ 'osx/thread_suspension.c',
+ 'posix/addrspace_teardown.c',
+ 'posix/sel_memory.c',
+ 'posix/x86/sel_segments.c',
+ ],
+ 'actions': [
+ {
+ 'action_name': 'mig_exc_generation',
+ 'variables': {
+ 'gen_dir': '<(INTERMEDIATE_DIR)/native_client/src/trusted/service_runtime',
+ },
+ 'inputs': [
+ 'osx/run_mig.py',
+ '$(SDKROOT)/usr/include/mach/exc.defs',
+ ],
+ 'outputs': [
+ '<(gen_dir)/nacl_exc.h',
+ '<(gen_dir)/nacl_exc_server.c',
+ ],
+ 'process_outputs_as_sources': 1,
+ 'action': [
+ '<(python_exe)', '<@(_inputs)', '<@(_outputs)',
+ ],
+ 'message': 'Generating mig plumbing for exc.defs',
+ },
+ ],
+ 'include_dirs': [
+ '<(INTERMEDIATE_DIR)',
+ ],
+ }],
+ ['OS=="win"', {
+ 'sources': [
+ 'win/addrspace_teardown.c',
+ 'win/debug_exception_handler.c',
+ 'win/debug_exception_handler_standalone.c',
+ 'win/nacl_ldt.c',
+ 'win/nacl_thread_nice.c',
+ 'win/sel_memory.c',
+ 'win/sel_segments.c',
+ 'win/thread_handle_map.c',
+ ],
+ }],
+ # TODO(gregoryd): move arm-specific stuff into a separate gyp file.
+ ['target_arch=="arm"', {
+ 'sources': [
+ 'arch/arm/nacl_app.c',
+ 'arch/arm/nacl_switch_to_app_arm.c',
+ 'arch/arm/sel_rt.c',
+ 'arch/arm/nacl_tls.c',
+ 'arch/arm/sel_ldr_arm.c',
+ 'arch/arm/sel_addrspace_arm.c',
+ 'arch/arm/nacl_switch.S',
+ 'arch/arm/nacl_syscall.S',
+ 'arch/arm/tramp_arm.S',
+ 'linux/nacl_signal_arm.c',
+ ],
+ }],
+ ['OS=="linux"', {
+ 'sources': [
+ 'linux/nacl_bootstrap_args.c',
+ 'linux/nacl_thread_nice.c',
+ 'linux/r_debug.c',
+ 'linux/reserved_at_zero.c',
+ 'linux/thread_suspension.c',
+ 'posix/addrspace_teardown.c',
+ 'posix/sel_memory.c',
+ ],
+ 'conditions': [
+ ['target_arch=="ia32" or target_arch=="x64"', {
+ 'sources': [
+ 'linux/x86/nacl_ldt.c',
+ 'posix/x86/sel_segments.c',
+ ],
+ }],
+ ['target_arch=="arm"', {
+ 'sources': [
+ 'linux/arm/sel_segments.c',
+ ],
+ }],
+ ],
+ }],
+ ['OS=="linux" or OS=="mac" or OS=="FreeBSD"', {
+ 'sources': [
+ 'posix/nacl_signal_stack.c',
+ 'posix/sel_addrspace_posix.c',
+ ],
+ }],
+ ['OS=="win"', {
+ 'sources': [
+ 'win/nacl_signal_stack.c',
+ 'win/sel_addrspace_win.c',
+ 'win/thread_suspension.c',
+ 'win/vm_hole.c',
+ ],
+ }],
+ ['OS!="win"', {
+ 'sources': [
+ 'generic/vm_hole.c',
+ ],
+ }],
+ ],
+ }],
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'sel',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'sel',
+ },
+ 'dependencies': [
+ 'env_cleanser',
+ 'nacl_error_code',
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc',
+ '<(DEPTH)/native_client/src/trusted/debug_stub/debug_stub.gyp:debug_stub',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer',
+ '<(DEPTH)/native_client/src/trusted/fault_injection/fault_injection.gyp:nacl_fault_inject',
+ '<(DEPTH)/native_client/src/trusted/gio/gio_wrapped_desc.gyp:gio_wrapped_desc',
+ '<(DEPTH)/native_client/src/trusted/interval_multiset/interval_multiset.gyp:nacl_interval',
+ '<(DEPTH)/native_client/src/trusted/perf_counter/perf_counter.gyp:nacl_perf_counter',
+ '<(DEPTH)/native_client/src/trusted/platform_qualify/platform_qualify.gyp:platform_qual_lib',
+ '<(DEPTH)/native_client/src/trusted/manifest_name_service_proxy/manifest_name_service_proxy.gyp:manifest_proxy',
+ '<(DEPTH)/native_client/src/trusted/simple_service/simple_service.gyp:simple_service',
+ '<(DEPTH)/native_client/src/trusted/threading/threading.gyp:thread_interface',
+ '<(DEPTH)/native_client/src/trusted/validator/validator.gyp:validation_cache',
+ '<(DEPTH)/native_client/src/trusted/validator/validator.gyp:validators',
+ ],
+ 'conditions': [
+ ['target_arch=="arm"', {
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator_arm/validator_arm.gyp:ncvalidate_arm_v2',
+ ],
+ }],
+ ['target_arch=="ia32" or target_arch=="x64"', {
+ 'dependencies': [
+ 'arch/x86/service_runtime_x86.gyp:service_runtime_x86_common',
+ ],
+ }],
+ ['target_arch == "ia32"', {
+ 'dependencies': [
+ 'arch/x86_32/service_runtime_x86_32.gyp:service_runtime_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator_x86/validator_x86.gyp:nccopy_x86_32',
+ ],
+ }],
+ ['target_arch == "x64"', {
+ 'dependencies': [
+ 'arch/x86_64/service_runtime_x86_64.gyp:service_runtime_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator_x86/validator_x86.gyp:nccopy_x86_64',
+ ],
+ }],
+ ['OS=="linux" or OS=="FreeBSD"', {
+ 'dependencies': [
+ 'nacl_signal',
+ ],
+ }],
+ ],
+ }, {
+ 'target_name': 'nacl_error_code',
+ 'type': 'static_library',
+ 'sources': [
+ 'nacl_error_code.c',
+ ],
+ }, {
+ 'target_name': 'env_cleanser',
+ 'type': 'static_library',
+ 'sources': [
+ 'env_cleanser.c',
+ ],
+ }, {
+ 'target_name': 'sel_main_chrome',
+ 'type': 'none',
+ 'dependencies': [
+ 'sel',
+ ],
+ }, {
+ 'target_name': 'sel_main',
+ 'type': 'static_library',
+ 'sources': [
+ 'sel_main.c',
+ ],
+ 'dependencies': [
+ 'sel',
+ ],
+ }, {
+ 'target_name': 'sel_ldr',
+ 'type': 'executable',
+ 'dependencies': [
+ 'sel_main',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/trusted/gio/gio_wrapped_desc.gyp:gio_wrapped_desc',
+ ],
+ 'sources': [
+ 'nacl_test_injection_main.c',
+ ],
+ 'conditions': [
+ ['OS=="linux"', {
+ 'dependencies': [
+ 'linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
+ ],
+ 'ldflags': [
+ '-pie',
+ ],
+ }],
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'sel64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'sel',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ 'env_cleanser64',
+ 'nacl_error_code64',
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio64',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:nonnacl_srpc64',
+ '<(DEPTH)/native_client/src/trusted/debug_stub/debug_stub.gyp:debug_stub64',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer64',
+ '<(DEPTH)/native_client/src/trusted/fault_injection/fault_injection.gyp:nacl_fault_inject64',
+ '<(DEPTH)/native_client/src/trusted/gio/gio_wrapped_desc.gyp:gio_wrapped_desc64',
+ '<(DEPTH)/native_client/src/trusted/interval_multiset/interval_multiset.gyp:nacl_interval64',
+ '<(DEPTH)/native_client/src/trusted/perf_counter/perf_counter.gyp:nacl_perf_counter64',
+ '<(DEPTH)/native_client/src/trusted/platform_qualify/platform_qualify.gyp:platform_qual_lib64',
+ '<(DEPTH)/native_client/src/trusted/manifest_name_service_proxy/manifest_name_service_proxy.gyp:manifest_proxy64',
+ '<(DEPTH)/native_client/src/trusted/simple_service/simple_service.gyp:simple_service64',
+ '<(DEPTH)/native_client/src/trusted/threading/threading.gyp:thread_interface64',
+ '<(DEPTH)/native_client/src/trusted/validator_x86/validator_x86.gyp:nccopy_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/validator.gyp:validation_cache64',
+ '<(DEPTH)/native_client/src/trusted/validator/validator.gyp:validators64',
+ 'arch/x86/service_runtime_x86.gyp:service_runtime_x86_common64',
+ 'arch/x86_64/service_runtime_x86_64.gyp:service_runtime_x86_64',
+ ],
+ }, {
+ 'target_name': 'nacl_error_code64',
+ 'type': 'static_library',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'sources': [
+ 'nacl_error_code.c',
+ ],
+ },
+ {
+ 'target_name': 'env_cleanser64',
+ 'type': 'static_library',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'sources': [
+ 'env_cleanser.c',
+ ],
+ },
+ {
+ 'target_name': 'sel_main_chrome64',
+ 'type': 'none',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ 'sel64',
+ ],
+ },
+ {
+ 'target_name': 'sel_main64',
+ 'type': 'static_library',
+ 'sources': [
+ 'sel_main.c',
+ ],
+ 'dependencies': [
+ 'sel64',
+ ],
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ },
+ {
+ 'target_name': 'sel_ldr64',
+ 'type': 'executable',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ 'sel_main64',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/trusted/gio/gio_wrapped_desc.gyp:gio_wrapped_desc64',
+ ],
+ 'sources': [
+ 'nacl_test_injection_main.c',
+ ],
+ },
+ ],
+ }],
+ ['OS=="linux" or OS=="FreeBSD"', {
+ 'targets': [
+ {
+ # This has to be an independent target in order to benefit from
+ # specific flags.
+ 'target_name': 'nacl_signal',
+ 'type': 'static_library',
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ # nacl_signal.c needs to be compiled without the stack
+ # protector on i386.
+ # See https://code.google.com/p/nativeclient/issues/detail?id=3581.
+ 'cflags!': [
+ '-fstack-protector',
+ '-fstack-protector-all',
+ ],
+ 'cflags': [
+ '-fno-stack-protector',
+ ],
+ }],
+ ],
+ 'sources': [
+ 'linux/nacl_signal.c',
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/simple_service/simple_service.gyp b/chromium/native_client/src/trusted/simple_service/simple_service.gyp
new file mode 100644
index 00000000000..778ca67017c
--- /dev/null
+++ b/chromium/native_client/src/trusted/simple_service/simple_service.gyp
@@ -0,0 +1,67 @@
+# -*- python -*-
+# Copyright 2011 (c) The Native Client Authors. All rights reserved. Use
+# of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="simple_service"', {
+ 'sources': [
+ 'nacl_simple_ltd_service.h',
+ 'nacl_simple_rservice.h',
+ 'nacl_simple_service.h',
+
+ 'nacl_simple_ltd_service.c',
+ 'nacl_simple_rservice.c',
+ 'nacl_simple_service.c',
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS': [
+ '-Wno-missing-field-initializers'
+ ]
+ },
+ },
+ ]],
+ },
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'simple_service64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'simple_service',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/threading/threading.gyp:thread_interface64',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer64',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base64',
+ ],
+ },
+ ],
+ }],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'simple_service',
+ 'type': 'static_library', # 'dynamic_library', ?!?
+ 'variables': {
+ 'target_base': 'simple_service',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/threading/threading.gyp:thread_interface',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/trusted/desc/desc.gyp:nrd_xfer',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/threading/threading.gyp b/chromium/native_client/src/trusted/threading/threading.gyp
new file mode 100644
index 00000000000..fb5275d72aa
--- /dev/null
+++ b/chromium/native_client/src/trusted/threading/threading.gyp
@@ -0,0 +1,58 @@
+# -*- python -*-
+# Copyright 2011 (c) The Native Client Authors. All rights reserved. Use
+# of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="thread_interface"', {
+ 'sources': [
+ 'nacl_thread_interface.h',
+ 'nacl_thread_interface.c',
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS': [
+ '-Wno-missing-field-initializers'
+ ]
+ },
+ },
+ ]],
+ },
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'thread_interface64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'thread_interface',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base64',
+ ],
+ },
+ ],
+ }],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'thread_interface',
+ 'type': 'static_library', # 'dynamic_library', ?!?
+ 'variables': {
+ 'target_base': 'thread_interface',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/trusted/nacl_base/nacl_base.gyp:nacl_base',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator/driver/ncval.gyp b/chromium/native_client/src/trusted/validator/driver/ncval.gyp
new file mode 100644
index 00000000000..239b5607cf8
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator/driver/ncval.gyp
@@ -0,0 +1,26 @@
+# Copyright (c) 2013 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../../build/common.gypi',
+ ],
+ 'conditions': [
+ ['target_arch=="ia32" or target_arch=="x64"', {
+ 'targets': [
+ {
+ 'target_name': 'ncval_new',
+ 'type': 'executable',
+ 'sources': ['ncval.cc', 'elf_load.cc'],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/trusted/validator_arm/validator_arm.gyp:arm_validator_core',
+ '<(DEPTH)/native_client/src/trusted/validator_arm/validator_arm.gyp:arm_validator_reporters',
+ '<(DEPTH)/native_client/src/trusted/validator_ragel/rdfa_validator.gyp:rdfa_validator',
+ ],
+ },
+ ]
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator/ncfileutils.gyp b/chromium/native_client/src/trusted/validator/ncfileutils.gyp
new file mode 100644
index 00000000000..ae35f061b11
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator/ncfileutils.gyp
@@ -0,0 +1,71 @@
+# -*- gyp -*-
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="ncfileutils"', {
+ 'sources': ['ncfileutil.c'],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ],
+ },
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'ncfileutils_x86_32',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'ncfileutils',
+ },
+ }],
+ }],
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'ncfileutils_x86_64',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'ncfileutils',
+ 'win_target': 'x64',
+ },
+ }],
+ }],
+ ['target_arch=="x64"', {
+ 'targets': [
+ {
+ 'target_name': 'ncfileutils_x86_64',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'ncfileutils',
+ },
+ }],
+ }],
+ ['target_arch=="arm"', {
+ 'targets': [],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator/validator.gyp b/chromium/native_client/src/trusted/validator/validator.gyp
new file mode 100644
index 00000000000..f73a0f687f6
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator/validator.gyp
@@ -0,0 +1,72 @@
+# -*- gyp -*-
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'validators',
+ 'type': 'static_library',
+ 'sources' : [
+ 'validator_init.c',
+ ],
+ 'conditions': [
+ ['nacl_validator_ragel!=0', {
+ 'defines': [
+ 'NACL_VALIDATOR_RAGEL=1',
+ ],
+ }],
+ ],
+ },
+ {
+ 'target_name': 'validation_cache',
+ 'type': 'static_library',
+ 'sources' : [
+ 'validation_cache.c',
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'validators64',
+ 'type': 'static_library',
+ 'sources' : [
+ 'validator_init.c',
+ ],
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'conditions': [
+ ['nacl_validator_ragel!=0', {
+ 'defines': [
+ 'NACL_VALIDATOR_RAGEL=1',
+ ],
+ }],
+ ],
+ },
+ {
+ 'target_name': 'validation_cache64',
+ 'type': 'static_library',
+ 'sources' : [
+ 'validation_cache.c',
+ ],
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator/x86/32/validator_x86_32.gyp b/chromium/native_client/src/trusted/validator/x86/32/validator_x86_32.gyp
new file mode 100644
index 00000000000..8618fc71b65
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator/x86/32/validator_x86_32.gyp
@@ -0,0 +1,87 @@
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Build the specific library dependencies for validating on x86-32
+{
+ 'includes': [
+ '../../../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="ncvalidate_x86_32"', {
+ 'sources': [
+ 'ncvalidate.c',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'defines': [ 'NACL_TRUSTED_BUT_NOT_TCB' ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ['target_base=="ncvalidate_verbose_x86_32"', {
+ 'sources': [
+ 'ncvalidate_verbose.c',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'defines': [ 'NACL_TRUSTED_BUT_NOT_TCB' ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ],
+ },
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'targets': [
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'ncvalidate_x86_32',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncvalidate_x86_32',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncval_seg_sfi_x86_32',
+ ],
+ 'hard_dependency': 1,
+ },
+ {
+ 'target_name': 'ncvalidate_verbose_x86_32',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncvalidate_verbose_x86_32',
+ },
+ 'dependencies': [
+ 'ncvalidate_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncdis_seg_sfi_verbose_x86_32',
+ ],
+ 'hard_dependency': 1,
+ },
+ ],
+ }],
+ [ 'target_arch=="arm" or target_arch=="x64"', {
+ 'targets': []
+ }],
+ ],
+}
+
diff --git a/chromium/native_client/src/trusted/validator/x86/64/validator_x86_64.gyp b/chromium/native_client/src/trusted/validator/x86/64/validator_x86_64.gyp
new file mode 100644
index 00000000000..0d063a4b7a5
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator/x86/64/validator_x86_64.gyp
@@ -0,0 +1,94 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Build the specific library dependencies for validating on x86-64
+{
+ 'includes': [
+ '../../../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="ncvalidate_x86_64"', {
+ 'sources': [
+ 'ncvalidate.c',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'defines': [ 'NACL_TRUSTED_BUT_NOT_TCB' ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ['target_base=="ncvalidate_verbose_x86_64"', {
+ 'sources': [
+ 'ncvalidate_verbose.c',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'defines': [ 'NACL_TRUSTED_BUT_NOT_TCB' ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ }],
+ ],
+ },
+ 'conditions': [
+ ['OS=="win" or target_arch=="x64"', {
+ 'targets': [
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'ncvalidate_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncvalidate_x86_64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_x86_64'
+ ],
+ 'hard_dependency': 1,
+ },
+ {
+ 'target_name': 'ncvalidate_verbose_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncvalidate_verbose_x86_64',
+ },
+ 'dependencies': [
+ 'ncvalidate_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_verbose_x86_64'
+ ],
+ 'hard_dependency': 1,
+ },
+ ],
+ }],
+ [ 'target_arch=="arm" or target_arch=="ia32"', {
+ 'targets': []
+ }],
+ ],
+}
+
diff --git a/chromium/native_client/src/trusted/validator/x86/decoder/ncdis_decode_tables.gyp b/chromium/native_client/src/trusted/validator/x86/decoder/ncdis_decode_tables.gyp
new file mode 100644
index 00000000000..9b8cb881b64
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator/x86/decoder/ncdis_decode_tables.gyp
@@ -0,0 +1,71 @@
+# -*- gyp -*-
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="ncdis_decode_tables"', {
+ 'sources': ['ncdis_decode_tables.c'],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ],
+ },
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'ncdis_decode_tables_x86_32',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'ncdis_decode_tables',
+ },
+ }],
+ }],
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'ncdis_decode_tables_x86_64',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'ncdis_decode_tables',
+ 'win_target': 'x64',
+ },
+ }],
+ }],
+ ['target_arch=="x64"', {
+ 'targets': [
+ {
+ 'target_name': 'ncdis_decode_tables_x86_64',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'ncdis_decode_tables',
+ },
+ }],
+ }],
+ ['target_arch=="arm"', {
+ 'targets': [],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp b/chromium/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp
new file mode 100644
index 00000000000..92e70c1dc72
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp
@@ -0,0 +1,181 @@
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Build the specific library dependencies for decoding x86 instructions.
+# Used to define a "full" decoder (used by ncdis). Currently used to decode
+# instructions for the x86-64 validator. Future plans is to encorporate the
+# decoder into the x86-32 validator.
+{
+ 'includes': [
+ '../../../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="nc_opcode_modeling"', {
+ 'sources': ['ncopcode_desc.c'],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ['target_base=="nc_opcode_modeling_verbose"', {
+ 'sources': ['ncopcode_desc_verbose.c'],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ]
+ },
+ }],
+ ['target_base=="nc_decoder"', {
+ 'sources': [
+ 'nc_inst_iter.c',
+ 'nc_inst_state.c',
+ 'nc_inst_trans.c',
+ 'ncop_exps.c',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ],
+ },
+ # ----------------------------------------------------------------------
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'nc_opcode_modeling_x86_32',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'nc_opcode_modeling',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_32',
+ ],
+ }, {
+ 'target_name': 'nc_opcode_modeling_verbose_x86_32',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'nc_opcode_modeling_verbose',
+ },
+ 'dependencies': [
+ 'nc_opcode_modeling_x86_32',
+ ],
+ }, {
+ 'target_name': 'nc_decoder_x86_32',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'nc_decoder',
+ },
+ 'dependencies': [
+ 'nc_opcode_modeling_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_32',
+ ],
+ }],
+ }],
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'nc_opcode_modeling_x86_64',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'nc_opcode_modeling',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_64',
+ ],
+ }, {
+ 'target_name': 'nc_opcode_modeling_verbose_x86_64',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'nc_opcode_modeling_verbose',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ 'nc_opcode_modeling_x86_64',
+ ],
+ }, {
+ 'target_name': 'nc_decoder_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'nc_decoder',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ 'nc_opcode_modeling_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_64',
+ ],
+ }],
+ }],
+ ['target_arch=="x64"', {
+ 'targets': [
+ {
+ 'target_name': 'nc_opcode_modeling_x86_64',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'nc_opcode_modeling',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_64',
+ ],
+ }, {
+ 'target_name': 'nc_opcode_modeling_verbose_x86_64',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'nc_opcode_modeling_verbose',
+ },
+ 'dependencies': [
+ 'nc_opcode_modeling_x86_64',
+ ],
+ }, {
+ 'target_name': 'nc_decoder_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'nc_decoder',
+ },
+ 'dependencies': [
+ 'nc_opcode_modeling_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_64',
+ ],
+ }],
+ }],
+ [ 'target_arch=="arm"', {
+ 'targets': []
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp b/chromium/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp
new file mode 100644
index 00000000000..9db4c892ac6
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp
@@ -0,0 +1,140 @@
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# TODO(bradchen): eliminate need for the warning flag removals below
+{
+ 'includes': [
+ '../../../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="ncval_reg_sfi"', {
+ # we depend on ncvalidate build to generate the headers
+ 'sources': [ 'ncvalidate_iter.c',
+ 'ncvalidate_iter_detailed.c',
+ 'nc_cpu_checks.c',
+ 'nc_illegal.c',
+ 'nc_jumps.c',
+ 'address_sets.c',
+ 'nc_jumps_detailed.c',
+ 'nc_opcode_histogram.c',
+ 'nc_protect_base.c',
+ 'nc_memory_protect.c',
+ 'ncvalidate_utils.c',
+ 'ncval_decode_tables.c',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ]
+ },
+ }],
+ ['target_base=="ncval_reg_sfi_verbose"', {
+ 'sources': ['ncvalidate_iter_verbose.c'],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ]
+ },
+ }],
+ ],
+ },
+ # ----------------------------------------------------------------------
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'ncval_reg_sfi_x86_32',
+ 'type': 'static_library',
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator_x86/validator_x86.gyp:nccopy_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp:nc_decoder_x86_32',
+ ],
+ 'variables': {
+ 'target_base': 'ncval_reg_sfi',
+ },
+ }, {
+ 'target_name': 'ncval_reg_sfi_verbose_x86_32',
+ 'type': 'static_library',
+ 'dependencies': [
+ 'ncval_reg_sfi_x86_32',
+ ],
+ 'variables': {
+ 'target_base': 'ncval_reg_sfi_verbose',
+ },
+ }],
+ }],
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'ncval_reg_sfi_x86_64',
+ 'type': 'static_library',
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator_x86/validator_x86.gyp:nccopy_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp:nc_decoder_x86_64',
+ ],
+ 'variables': {
+ 'target_base': 'ncval_reg_sfi',
+ 'win_target': 'x64',
+ },
+ }, {
+ 'target_name': 'ncval_reg_sfi_verbose_x86_64',
+ 'type': 'static_library',
+ 'dependencies': [
+ 'ncval_reg_sfi_x86_64',
+ ],
+ 'variables': {
+ 'target_base': 'ncval_reg_sfi_verbose',
+ 'win_target': 'x64',
+ },
+ }],
+ }],
+ ['target_arch=="x64"', {
+ 'targets': [
+ {
+ 'target_name': 'ncval_reg_sfi_x86_64',
+ 'type': 'static_library',
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator_x86/validator_x86.gyp:nccopy_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp:nc_decoder_x86_64',
+ ],
+ 'variables': {
+ 'target_base': 'ncval_reg_sfi',
+ },
+ }, {
+ 'target_name': 'ncval_reg_sfi_verbose_x86_64',
+ 'type': 'static_library',
+ 'dependencies': [
+ 'ncval_reg_sfi_x86_64',
+ ],
+ 'variables': {
+ 'target_base': 'ncval_reg_sfi_verbose',
+ },
+ }],
+ }],
+ [ 'target_arch=="arm"', {
+ 'targets': []
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp b/chromium/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp
new file mode 100644
index 00000000000..ce72d749d1c
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp
@@ -0,0 +1,179 @@
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# TODO(bradchen): eliminate need for the warning flag removals below
+{
+ 'includes': [
+ '../../../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="ncdis_seg_sfi"', {
+ 'sources': [
+ 'ncdecode.c',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ['target_base=="ncdis_seg_sfi_verbose"', {
+ 'sources': [
+ 'ncdecode_verbose.c',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ['target_base=="ncval_seg_sfi"', {
+ 'sources': [
+ 'ncvalidate.c',
+ 'ncvalidate_detailed.c',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ],
+ },
+ # ----------------------------------------------------------------------
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'ncdis_seg_sfi_x86_32',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncdis_seg_sfi',
+ },
+ }, {
+ 'target_name': 'ncdis_seg_sfi_verbose_x86_32',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncdis_seg_sfi_verbose',
+ },
+ 'dependencies': [
+ 'ncdis_seg_sfi_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_verbose_x86_32'
+ ],
+ 'hard_dependency': 1,
+ }, {
+ 'target_name': 'ncval_seg_sfi_x86_32',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncval_seg_sfi',
+ },
+ 'dependencies': [
+ 'ncdis_seg_sfi_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator_x86/validator_x86.gyp:nccopy_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_32'
+ ],
+ 'hard_dependency': 1,
+ # VS2010 does not correctly incrementally link obj files generated
+ # from asm files. This flag disables UseLibraryDependencyInputs to
+ # avoid this problem.
+ 'msvs_2010_disable_uldi_when_referenced': 1,
+ }],
+ }],
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'ncdis_seg_sfi_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncdis_seg_sfi',
+ 'win_target': 'x64',
+ },
+ }, {
+ 'target_name': 'ncdis_seg_sfi_verbose_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncdis_seg_sfi_verbose',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ 'ncval_seg_sfi_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_verbose_x86_64'
+ ],
+ 'hard_dependency': 1,
+ }, {
+ 'target_name': 'ncval_seg_sfi_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncval_seg_sfi',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ 'ncdis_seg_sfi_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator_x86/validator_x86.gyp:nccopy_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_64'
+ ],
+ 'hard_dependency': 1,
+ }],
+ }],
+ ['target_arch=="x64"', {
+ 'targets': [
+ {
+ 'target_name': 'ncdis_seg_sfi_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncdis_seg_sfi',
+ },
+ }, {
+ 'target_name': 'ncdis_seg_sfi_verbose_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncdis_seg_sfi_verbose',
+ },
+ 'dependencies': [
+ 'ncval_seg_sfi_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_verbose_x86_64' ],
+ 'hard_dependency': 1,
+ }, {
+ 'target_name': 'ncval_seg_sfi_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncval_seg_sfi',
+ },
+ 'dependencies': [
+ 'ncdis_seg_sfi_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator_x86/validator_x86.gyp:nccopy_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_x86_64' ],
+ 'hard_dependency': 1,
+ }],
+ }],
+ [ 'target_arch=="arm"', {
+ 'targets': []
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator/x86/validate_x86.gyp b/chromium/native_client/src/trusted/validator/x86/validate_x86.gyp
new file mode 100644
index 00000000000..d3e4f47bcb2
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator/x86/validate_x86.gyp
@@ -0,0 +1,142 @@
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Build the specific library dependencies for validating x86 code, used
+# by both the x86-32 and x86-64 validators.
+# Note: Would like to name this file validator_x86.gyp, but that name is
+# already used, and on mac's, this is not allowed.
+{
+ 'includes': [
+ '../../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="ncval_base"', {
+ 'sources': [
+ 'error_reporter.c',
+ 'halt_trim.c',
+ 'ncinstbuffer.c',
+ 'x86_insts.c',
+ 'nc_segment.c',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ # VS2010 does not correctly incrementally link obj files generated
+ # from asm files. This flag disables UseLibraryDependencyInputs to
+ # avoid this problem.
+ 'msvs_2010_disable_uldi_when_referenced': 1,
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ['target_base=="ncval_base_verbose"', {
+ 'sources': [
+ 'error_reporter_verbose.c',
+ 'x86_insts_verbose.c',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ],
+ },
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'targets': [
+ { 'target_name': 'ncval_base_x86_32',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncval_base',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/trusted/cpu_features/cpu_features.gyp:cpu_features',
+ '<(DEPTH)/native_client/src/trusted/validator/validator.gyp:validation_cache',
+ ],
+ },
+ { 'target_name': 'ncval_base_verbose_x86_32',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncval_base_verbose',
+ },
+ 'dependencies': [
+ 'ncval_base_x86_32',
+ ],
+ },
+ ],
+ }],
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ { 'target_name': 'ncval_base_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncval_base',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ '<(DEPTH)/native_client/src/trusted/cpu_features/cpu_features.gyp:cpu_features64',
+ '<(DEPTH)/native_client/src/trusted/validator/validator.gyp:validation_cache64',
+ ],
+ },
+ { 'target_name': 'ncval_base_verbose_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncval_base_verbose',
+ 'win_target': 'x64',
+ 'dependencies': [
+ 'ncval_base_x86_64',
+ ],
+ },
+ },
+ ],
+ }],
+ ['target_arch=="x64"', {
+ 'targets': [
+ { 'target_name': 'ncval_base_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncval_base',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ '<(DEPTH)/native_client/src/trusted/cpu_features/cpu_features.gyp:cpu_features',
+ '<(DEPTH)/native_client/src/trusted/validator/validator.gyp:validation_cache',
+ ],
+ },
+ { 'target_name': 'ncval_base_verbose_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncval_base_verbose',
+ },
+ 'dependencies': [
+ 'ncval_base_x86_64',
+ ],
+ },
+ ],
+ }],
+ [ 'target_arch=="arm"', {
+ 'targets': []
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator_arm/ncval.gyp b/chromium/native_client/src/trusted/validator_arm/ncval.gyp
new file mode 100644
index 00000000000..18ccd98c0ad
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator_arm/ncval.gyp
@@ -0,0 +1,42 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'ncval_arm',
+ 'type': 'executable',
+ 'sources': [ 'ncval.cc' ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator/ncfileutils.gyp:ncfileutils_x86_32',
+ 'validator_arm.gyp:arm_validator_core',
+ 'validator_arm.gyp:arm_validator_reporters',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ ],
+ }],
+ }],
+ ['target_arch=="x64"', {
+ 'targets': [
+ {
+ 'target_name': 'ncval_arm',
+ 'type': 'executable',
+ 'sources': [ 'ncval.cc' ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/validator/ncfileutils.gyp:ncfileutils_x86_64',
+ 'validator_arm.gyp:arm_validator_core',
+ 'validator_arm.gyp:arm_validator_reporters',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ ],
+ }],
+ }],
+ ['target_arch=="arm"', {
+ 'targets': [],
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator_arm/validator_arm.gyp b/chromium/native_client/src/trusted/validator_arm/validator_arm.gyp
new file mode 100644
index 00000000000..b22b2f9b721
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator_arm/validator_arm.gyp
@@ -0,0 +1,72 @@
+# Copyright 2010, Google Inc.
+# Copyright 2009 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can
+# be found in the LICENSE file.
+
+{
+ # ----------------------------------------------------------------------
+ # Default settings
+ # ----------------------------------------------------------------------
+
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ # TODO(robertm): move these setting to some global config
+ 'target_defaults': {
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ]
+ },
+ 'include_dirs': ['<(SHARED_INTERMEDIATE_DIR)'],
+ # TODO(robertm): mmentovai does not think this is necessary
+ # When ncvalidate is a dependency, it needs to be a hard dependency
+ # because dependents may rely on ncvalidate to create header files below.
+ 'hard_dependency': 1,
+ },
+ # ----------------------------------------------------------------------
+ # actual targets
+ # ----------------------------------------------------------------------
+ 'targets': [
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'arm_validator_core',
+ 'type': 'static_library',
+ 'sources': [
+ 'address_set.cc',
+ 'inst_classes.cc',
+ 'model.cc',
+ 'arm_helpers.cc',
+ 'validator.cc',
+ 'gen/arm32_decode.cc',
+ 'gen/arm32_decode_actuals_1.cc',
+ 'gen/arm32_decode_actuals_2.cc'
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/cpu_features/cpu_features.gyp:cpu_features'
+ ],
+ },
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'ncvalidate_arm_v2',
+ 'type': 'static_library',
+ 'sources': [ 'ncvalidate.cc' ],
+ 'dependencies': [
+ 'arm_validator_core'
+ ],
+ },
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'arm_validator_reporters',
+ 'type': 'static_library',
+ 'sources': [ 'problem_reporter.cc' ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator_mips/validator_mips.gyp b/chromium/native_client/src/trusted/validator_mips/validator_mips.gyp
new file mode 100755
index 00000000000..02635f0bfb1
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator_mips/validator_mips.gyp
@@ -0,0 +1,91 @@
+# Copyright 2012, Google Inc.
+# Copyright 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can
+# be found in the LICENSE file.
+
+{
+ # ----------------------------------------------------------------------
+ # Default settings
+ # ----------------------------------------------------------------------
+
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'variables': {
+ 'validate_gen_out':
+ '<(SHARED_INTERMEDIATE_DIR)/gen/native_client/src/trusted/validator_mips',
+ },
+ # TODO(robertm): move these setting to some global config
+ 'target_defaults': {
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ]
+ },
+ 'include_dirs': ['<(SHARED_INTERMEDIATE_DIR)'],
+ # TODO(robertm): mmentovai does not think this is necessary
+ # When ncvalidate is a dependency, it needs to be a hard dependency
+ # because dependents may rely on ncvalidate to create header files below.
+ 'hard_dependency': 1,
+ },
+ # ----------------------------------------------------------------------
+ # actual targets
+ # ----------------------------------------------------------------------
+ 'targets': [
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'mips_validator_core',
+ 'type': 'static_library',
+ 'sources': [
+ 'address_set.cc',
+ 'inst_classes.cc',
+ 'validator.cc',
+ '<(validate_gen_out)/decode.cc'
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/cpu_features/cpu_features.gyp:cpu_features',
+ 'decode_gen'
+ ],
+ },
+ # ----------------------------------------------------------------------
+ {
+ 'target_name': 'decode_gen',
+ 'type': 'none',
+ 'direct_dependent_settings': {
+ 'include_dirs': ['<(SHARED_INTERMEDIATE_DIR)'],
+ },
+ 'actions': [
+ {
+ 'action_name': 'decode_gen_action',
+ 'msvs_cygwin_shell': 0,
+ 'inputs': [
+ 'mips-opt.table',
+ 'generate_decoder.py',
+ 'dgen_core.py',
+ 'dgen_input.py',
+ 'dgen_opt.py',
+ 'dgen_output.py',
+ ],
+ 'outputs': [
+ '<(validate_gen_out)/decode.cc',
+ ],
+ 'action': [
+ '<@(python_exe)',
+ 'generate_decoder.py',
+ 'mips-opt.table',
+ '<@(_outputs)',
+ ],
+ 'process_outputs_as_sources': 1,
+ 'message': 'generate decoder.cc',
+ },
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator_ragel/dfa_validator_x86_32.gyp b/chromium/native_client/src/trusted/validator_ragel/dfa_validator_x86_32.gyp
new file mode 100644
index 00000000000..e108509ed73
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator_ragel/dfa_validator_x86_32.gyp
@@ -0,0 +1,31 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Build the specific library dependencies for validating on x86-32 using the
+# DFA-based validator.
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'dfa_validate_x86_32',
+ 'type': 'static_library',
+ 'sources' : [
+ 'dfa_validate_32.c',
+ 'dfa_validate_common.c',
+ 'validator_features_validator.c',
+ 'gen/validator_x86_32.c',
+ ],
+ },
+ ],
+ }],
+ [ 'target_arch=="arm" or target_arch=="x64"', {
+ 'targets': []
+ }],
+ ],
+}
+
diff --git a/chromium/native_client/src/trusted/validator_ragel/dfa_validator_x86_64.gyp b/chromium/native_client/src/trusted/validator_ragel/dfa_validator_x86_64.gyp
new file mode 100644
index 00000000000..a6a4f19887b
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator_ragel/dfa_validator_x86_64.gyp
@@ -0,0 +1,40 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Build the specific library dependencies for validating on x86-64 using the
+# DFA-based validator.
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ }],
+ ],
+ },
+ 'conditions': [
+ ['OS=="win" or target_arch=="x64"', {
+ 'targets': [
+ {
+ 'target_name': 'dfa_validate_x86_64',
+ 'type': 'static_library',
+ 'sources' : [
+ 'dfa_validate_64.c',
+ 'dfa_validate_common.c',
+ 'validator_features_validator.c',
+ 'gen/validator_x86_64.c',
+ ],
+ },
+ ],
+ }],
+ [ 'target_arch=="arm" or target_arch=="ia32"', {
+ 'targets': []
+ }],
+ ],
+}
+
diff --git a/chromium/native_client/src/trusted/validator_ragel/rdfa_validator.gyp b/chromium/native_client/src/trusted/validator_ragel/rdfa_validator.gyp
new file mode 100644
index 00000000000..4c4b3d336ed
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator_ragel/rdfa_validator.gyp
@@ -0,0 +1,22 @@
+# Copyright (c) 2013 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'targets': [
+ {
+ 'target_name': 'rdfa_validator',
+ 'type': 'static_library',
+ 'sources': [
+ 'validator_features_all.c',
+ 'validator_features_validator.c',
+ 'gen/validator_x86_32.c',
+ 'gen/validator_x86_64.c',
+ ],
+ },
+ ],
+}
+
diff --git a/chromium/native_client/src/trusted/validator_x86/ncval.gyp b/chromium/native_client/src/trusted/validator_x86/ncval.gyp
new file mode 100644
index 00000000000..e3d838b354d
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator_x86/ncval.gyp
@@ -0,0 +1,153 @@
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# TODO(bradchen): eliminate need for the warning flag removals below
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="ncdis_util"', {
+ 'sources': [
+ 'ncdis_segments.c',
+ 'nc_read_segment.c',
+ ],
+ 'defines': [
+ 'NACL_TRUSTED_BUT_NOT_TCB',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ['target_base=="ncval"', {
+ 'sources': [
+ 'ncval.c',
+ ],
+ 'defines': [
+ 'NACL_TRUSTED_BUT_NOT_TCB',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ],
+ },
+ # ----------------------------------------------------------------------
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'ncdis_util_x86_32',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncdis_util',
+ },
+ 'sources': ['ncenuminsts_x86_32.c'],
+ }, {
+ 'target_name': 'ncval_x86_32',
+ 'type': 'executable',
+ 'variables': {
+ 'target_base': 'ncval',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/utils/utils.gyp:utils',
+ '<(DEPTH)/native_client/src/trusted/validator/ncfileutils.gyp:ncfileutils_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncdis_decode_tables.gyp:ncdis_decode_tables_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp:nc_opcode_modeling_verbose_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_verbose_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncdis_seg_sfi_verbose_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncval_seg_sfi_x86_32',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_verbose_x86_32',
+ 'ncdis_util_x86_32',
+ ],
+ }],
+ }],
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'ncdis_util_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncdis_util',
+ 'win_target': 'x64',
+ },
+ 'sources': ['ncenuminsts_x86_64.c'],
+ }, {
+ 'target_name': 'ncval_x86_64',
+ 'type': 'executable',
+ 'variables': {
+ 'target_base': 'ncval',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/utils/utils.gyp:utils64',
+ '<(DEPTH)/native_client/src/trusted/validator/ncfileutils.gyp:ncfileutils_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncdis_decode_tables.gyp:ncdis_decode_tables_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp:nc_opcode_modeling_verbose_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_verbose_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncdis_seg_sfi_verbose_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncval_seg_sfi_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_verbose_x86_64',
+ 'ncdis_util_x86_64',
+ ],
+ }],
+ }],
+ ['target_arch=="x64"', {
+ 'targets': [
+ {
+ 'target_name': 'ncdis_util_x86_64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'ncdis_util',
+ },
+ 'sources': ['ncenuminsts_x86_64.c'],
+ }, {
+ 'target_name': 'ncval_x86_64',
+ 'type': 'executable',
+ 'variables': {
+ 'target_base': 'ncval',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/utils/utils.gyp:utils',
+ '<(DEPTH)/native_client/src/trusted/validator/ncfileutils.gyp:ncfileutils_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncdis_decode_tables.gyp:ncdis_decode_tables_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/decoder/ncval_x86_decoder.gyp:nc_opcode_modeling_verbose_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_verbose_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_reg_sfi/ncval_reg_sfi.gyp:ncval_reg_sfi_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncdis_seg_sfi_verbose_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/ncval_seg_sfi/ncval_seg_sfi.gyp:ncval_seg_sfi_x86_64',
+ '<(DEPTH)/native_client/src/trusted/validator/x86/validate_x86.gyp:ncval_base_verbose_x86_64',
+ 'ncdis_util_x86_64',
+ ],
+ }],
+ }],
+ [ 'target_arch=="arm"', {
+ 'targets': []
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/validator_x86/validator_x86.gyp b/chromium/native_client/src/trusted/validator_x86/validator_x86.gyp
new file mode 100644
index 00000000000..27a5b0f9ac5
--- /dev/null
+++ b/chromium/native_client/src/trusted/validator_x86/validator_x86.gyp
@@ -0,0 +1,79 @@
+# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# TODO(bradchen): eliminate need for the warning flag removals below
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables': {
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="nccopy"', {
+ 'sources': [
+ 'nccopycode.c',
+ 'nccopycode_stores.S',
+ ],
+ 'cflags!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS!': [
+ '-Wextra',
+ '-Wswitch-enum',
+ '-Wsign-compare'
+ ],
+ },
+ }],
+ ],
+ },
+ # ----------------------------------------------------------------------
+ 'conditions': [
+ ['target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'nccopy_x86_32',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'nccopy',
+ },
+ # VS2010 does not correctly incrementally link obj files generated
+ # from asm files. This flag disables UseLibraryDependencyInputs to
+ # avoid this problem.
+ 'msvs_2010_disable_uldi_when_referenced': 1,
+ }],
+ }],
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'nccopy_x86_64',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'nccopy',
+ 'win_target': 'x64',
+ },
+ }],
+ }],
+ ['target_arch=="x64"', {
+ 'targets': [
+ {
+ 'target_name': 'nccopy_x86_64',
+ 'type': 'static_library',
+ 'hard_dependency': 1,
+ 'variables': {
+ 'target_base': 'nccopy',
+ },
+ }],
+ }],
+ [ 'target_arch=="arm"', {
+ 'targets': []
+ }],
+ ],
+}
diff --git a/chromium/native_client/src/trusted/weak_ref/weak_ref.gyp b/chromium/native_client/src/trusted/weak_ref/weak_ref.gyp
new file mode 100644
index 00000000000..cdd52acfb51
--- /dev/null
+++ b/chromium/native_client/src/trusted/weak_ref/weak_ref.gyp
@@ -0,0 +1,75 @@
+# -*- python -*-
+# Copyright 2011 (c) The Native Client Authors. All rights reserved. Use
+# of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'target_defaults': {
+ 'variables':{
+ 'target_base': 'none',
+ },
+ 'target_conditions': [
+ ['target_base=="weak_ref"', {
+ 'sources': [
+ 'weak_ref.cc',
+ 'weak_ref.h',
+ ],
+ 'xcode_settings': {
+ 'WARNING_CFLAGS': [
+ '-Wno-missing-field-initializers'
+ ]
+ },
+ },
+ ]],
+ },
+ 'conditions': [
+ # NOTE: We do not support untrusted gyp build on arm yet.
+ ['target_arch!="arm"', {
+ 'targets': [
+ {
+ 'target_name': 'weak_ref_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libweak_ref.a',
+ 'nso_target': 'libweak_ref.so',
+ 'build_glibc': 1,
+ 'build_newlib': 1,
+ 'sources': ['weak_ref.cc'],
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ ],
+ }],
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ 'target_name': 'weak_ref64',
+ 'type': 'static_library',
+ 'variables': {
+ 'target_base': 'weak_ref',
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform64',
+ ],
+ },
+ ],
+ }],
+ ],
+ 'targets': [
+ {
+ 'target_name': 'weak_ref',
+ 'type': 'static_library', # 'dynamic_library', ?!?
+ 'variables': {
+ 'target_base': 'weak_ref',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/untrusted/irt/check_tls.gypi b/chromium/native_client/src/untrusted/irt/check_tls.gypi
new file mode 100644
index 00000000000..e8fe5653fee
--- /dev/null
+++ b/chromium/native_client/src/untrusted/irt/check_tls.gypi
@@ -0,0 +1,88 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This file is used via 'includes' by an irt_test.gyp both here and in
+# chromium/src/ppapi/native_client. The including file must first include
+# build/common.gypi to get 'python_exe' set. The including file must first
+# set the variable 'irt_test_nexe' (e.g. to 'irt_core'); setting that to ''
+# (the empty string) instructs this file to run the test on the
+# nacl_irt_*.nexe file instead of a named one. The including file must
+# also set the variable 'irt_test_dep' to the 'foo.gyp:bar' Gyp target that
+# builds the nexe to be tested.
+
+{
+ 'conditions': [
+ ['irt_test_nexe==""', {
+ 'variables': {
+ 'check_tls_nexe': '>(nacl_irt_name).nexe',
+ 'check_tls_target': 'nacl_irt',
+ },
+ }, {
+ 'variables': {
+ 'check_tls_nexe': '<(irt_test_nexe)_>(nexe_suffix).nexe',
+ 'check_tls_target': '<(irt_test_nexe)',
+ },
+ }]
+ ],
+ 'targets': [
+ {
+ 'target_name': '<(check_tls_target)_tls_check',
+ 'type': 'none',
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:untar_toolchains',
+ '<(irt_test_dep)',
+ ],
+ 'actions': [
+ {
+ 'action_name': 'run_tls_check',
+ 'msvs_cygwin_shell': 0,
+ 'inputs': [
+ '<(PRODUCT_DIR)/<(check_tls_nexe)',
+ ],
+ 'outputs': ['<(PRODUCT_DIR)/<(_target_name).out'],
+ 'message': 'Sanity-checking TLS usage in <(check_tls_nexe)',
+ 'conditions': [
+ ['target_arch=="arm"', {
+ 'variables': {
+ 'nacl_objdump':
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_pnacl/host_x86_32/bin/le32-nacl-objdump',
+ },
+ }, {
+ # target_arch!="arm", so it's x86.
+ 'variables': {
+ 'nacl_objdump':
+ '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/bin/x86_64-nacl-objdump',
+ },
+ }],
+ ['target_arch=="x64"', {
+ 'variables': {
+ 'check_tls_arch': 'x86-64',
+ 'nexe_suffix': 'newlib_x64',
+ 'nacl_irt_name': 'nacl_irt_x86_64',
+ },
+ }],
+ ['target_arch=="ia32"', {
+ 'variables': {
+ 'check_tls_arch': 'x86-32',
+ 'nexe_suffix': 'newlib_x32',
+ 'nacl_irt_name': 'nacl_irt_x86_32',
+ },
+ }],
+ ['target_arch=="arm"', {
+ 'variables': {
+ 'check_tls_arch': 'arm',
+ 'nexe_suffix': 'newlib_arm',
+ 'nacl_irt_name': 'nacl_irt_arm',
+ },
+ }],
+ ],
+ 'action': ['>(python_exe)',
+ '<(DEPTH)/native_client/src/untrusted/irt/check_tls.py',
+ '<(check_tls_arch)', '<(nacl_objdump)',
+ '<@(_inputs)', '<@(_outputs)'],
+ },
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/untrusted/irt/irt.gyp b/chromium/native_client/src/untrusted/irt/irt.gyp
new file mode 100644
index 00000000000..ef24b3f0190
--- /dev/null
+++ b/chromium/native_client/src/untrusted/irt/irt.gyp
@@ -0,0 +1,110 @@
+# 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.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'variables': {
+ 'irt_sources': [
+# irt_support_sources
+ 'irt_entry.c',
+ 'irt_malloc.c',
+ 'irt_private_pthread.c',
+ 'irt_private_tls.c',
+# irt_common_interfaces
+ 'irt_basic.c',
+ 'irt_fdio.c',
+ 'irt_filename.c',
+ 'irt_memory.c',
+ 'irt_dyncode.c',
+ 'irt_thread.c',
+ 'irt_futex.c',
+ 'irt_mutex.c',
+ 'irt_cond.c',
+ 'irt_sem.c',
+ 'irt_tls.c',
+ 'irt_blockhook.c',
+ 'irt_clock.c',
+ 'irt_dev_getpid.c',
+ 'irt_exception_handling.c',
+ 'irt_dev_list_mappings.c',
+ 'irt_nameservice.c',
+ 'irt_random.c',
+# support_srcs
+ # We also get nc_init_private.c, nc_thread.c and nc_tsd.c via
+ # #includes of .c files.
+ '../pthread/nc_mutex.c',
+ '../pthread/nc_condvar.c',
+ '../nacl/sys_private.c',
+ '../valgrind/dynamic_annotations.c',
+ ],
+ 'irt_nonbrowser': [
+ 'irt_interfaces.c',
+ 'irt_core_resource.c',
+ ],
+ 'irt_browser': [
+ 'irt_interfaces_ppapi.c',
+ 'irt_ppapi.c',
+ 'irt_manifest.c',
+ ],
+ },
+ 'targets': [
+ {
+ 'target_name': 'irt_core_nexe',
+ 'type': 'none',
+ 'variables': {
+ 'nexe_target': 'irt_core',
+ 'build_glibc': 0,
+ 'build_newlib': 0,
+ 'build_irt': 1,
+ },
+ 'sources': ['<@(irt_sources)', '<@(irt_nonbrowser)'],
+ 'link_flags': [
+ '-lsrpc',
+ '-limc_syscalls',
+ '-lplatform',
+ '-lgio',
+ '-lm',
+ ],
+ 'conditions': [
+ # See comment in native_client/src/untrusted/irt/nacl.scons
+ # regarding -Ttext-segment.
+ ['target_arch=="arm"', {
+ 'sources': ['<@(irt_sources)',
+ 'aeabi_read_tp.S'],
+ }],
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/shared/gio/gio.gyp:gio_lib',
+ '<(DEPTH)/native_client/src/shared/platform/platform.gyp:platform_lib',
+ '<(DEPTH)/native_client/src/shared/srpc/srpc.gyp:srpc_lib',
+ '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:imc_syscalls_lib',
+ '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib_newlib',
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ {
+ 'target_name': 'irt_browser_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libirt_browser.a',
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_irt': 1,
+ },
+ 'sources': ['<@(irt_sources)', '<@(irt_browser)'],
+ 'include_dirs': ['../../../../ppapi'],
+ 'conditions': [
+ ['target_arch=="arm"', {
+ 'sources': [ 'aeabi_read_tp.S' ],
+ }],
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib_newlib',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/untrusted/irt/irt_test.gyp b/chromium/native_client/src/untrusted/irt/irt_test.gyp
new file mode 100644
index 00000000000..85238b4937f
--- /dev/null
+++ b/chromium/native_client/src/untrusted/irt/irt_test.gyp
@@ -0,0 +1,14 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'variables': {
+ 'irt_test_nexe': 'irt_core',
+ 'irt_test_dep': 'irt.gyp:irt_core_nexe',
+ },
+ 'includes': [
+ '../../../build/common.gypi',
+ 'check_tls.gypi',
+ ],
+}
diff --git a/chromium/native_client/src/untrusted/minidump_generator/minidump_generator.gyp b/chromium/native_client/src/untrusted/minidump_generator/minidump_generator.gyp
new file mode 100644
index 00000000000..6496aba00ae
--- /dev/null
+++ b/chromium/native_client/src/untrusted/minidump_generator/minidump_generator.gyp
@@ -0,0 +1,32 @@
+# -*- gyp -*-
+# Copyright (c) 2013 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'targets' : [
+ {
+ 'target_name': 'minidump_generator_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libminidump_generator.a',
+ 'nso_target': 'libminidump_generator.so',
+ 'build_glibc': 1,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 1,
+ # Allow Breakpad headers to #include other Breakpad headers.
+ 'include_dirs': ['<(DEPTH)/breakpad/src'],
+ },
+ 'sources': [
+ 'build_id.cc',
+ 'minidump_generator.cc',
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/untrusted/nacl/nacl.gyp b/chromium/native_client/src/untrusted/nacl/nacl.gyp
new file mode 100644
index 00000000000..72617ad7f33
--- /dev/null
+++ b/chromium/native_client/src/untrusted/nacl/nacl.gyp
@@ -0,0 +1,214 @@
+# Copyright (c) 2011 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.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'variables': {
+ 'sources_for_standard_interfaces': [
+ 'chdir.c',
+ 'clock.c',
+ 'clock_getres.c',
+ 'clock_gettime.c',
+ 'close.c',
+ 'dup.c',
+ '_exit.c',
+ 'fstat.c',
+ 'getcwd.c',
+ 'getdents.c',
+ 'getpagesize.c',
+ 'getpid.c',
+ 'gettimeofday.c',
+ 'lock.c',
+ 'lseek.c',
+ 'malloc.c',
+ 'mkdir.c',
+ 'mmap.c',
+ 'mprotect.c',
+ 'munmap.c',
+ 'nanosleep.c',
+ 'nacl_irt_filename.c',
+ 'nacl_interface_query.c',
+ 'nacl_read_tp.c',
+ 'nacl_add_tp.c',
+ 'open.c',
+ 'read.c',
+ 'rmdir.c',
+ 'pthread_initialize_minimal.c',
+ 'pthread_stubs.c',
+ 'sbrk.c',
+ 'sched_yield.c',
+ 'stacktrace.c',
+ 'start.c',
+ 'stat.c',
+ 'sysconf.c',
+ 'tls.c',
+ 'unlink.c',
+ 'write.c',
+ ],
+ 'sources_for_nacl_extensions': [
+ 'gc_hooks.c',
+ 'nacl_irt.c',
+ 'nacl_tls_get.c',
+ 'nacl_tls_init.c',
+ ],
+ 'imc_syscalls': [
+ 'imc_accept.c',
+ 'imc_connect.c',
+ 'imc_makeboundsock.c',
+ 'imc_mem_obj_create.c',
+ 'imc_recvmsg.c',
+ 'imc_sendmsg.c',
+ 'imc_socketpair.c',
+ 'nameservice.c',
+ ],
+ },
+
+ 'targets' : [
+ {
+ 'target_name': 'nacl_lib',
+ 'type': 'none',
+ 'dependencies': [
+ 'nacl_lib_newlib',
+ ],
+ 'conditions': [
+ # NOTE: We do not support glibc on arm yet.
+ ['target_arch!="arm"', {
+ 'dependencies': [
+ 'nacl_lib_glibc'
+ ]
+ }],
+ ],
+ },
+
+ {
+ 'target_name': 'nacl_lib_glibc',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libnacl.a',
+ 'build_glibc': 1,
+ 'build_newlib': 0,
+ },
+ 'sources': ['<@(sources_for_nacl_extensions)'],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ {
+ 'target_name': 'nacl_lib_newlib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libnacl.a',
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_irt': 1,
+ 'build_pnacl_newlib': 1,
+ },
+ 'sources': [
+ '<@(sources_for_nacl_extensions)',
+ '<@(sources_for_standard_interfaces)',
+ ],
+ 'conditions': [
+ ['target_arch=="arm"', {
+ 'variables': {
+ 'native_sources': [
+ 'aeabi_read_tp.S'
+ ]
+ }
+ }],
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ {
+ 'target_name': 'nacl_dynacode_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libnacl_dyncode.a',
+ 'nso_target': 'libnacl_dyncode.so',
+ 'build_glibc': 1,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 1,
+ },
+ 'sources': ['dyncode.c'],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ {
+ 'target_name': 'nacl_dyncode_private_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libnacl_dyncode_private.a',
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 1,
+ },
+ 'sources': ['dyncode_private.c'],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ {
+ 'target_name': 'nacl_exception_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libnacl_exception.a',
+ 'nso_target': 'libnacl_exception.so',
+ 'build_glibc': 1,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 1,
+ },
+ 'sources': ['nacl_exception.c'],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ {
+ 'target_name': 'nacl_list_mappings_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libnacl_list_mappings.a',
+ 'nso_target': 'libnacl_list_mappings.so',
+ 'build_glibc': 1,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 1,
+ },
+ 'sources': ['list_mappings.c'],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ {
+ 'target_name': 'nacl_list_mappings_private_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libnacl_list_mappings_private.a',
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ },
+ 'sources': ['list_mappings_private.c'],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ {
+ 'target_name': 'imc_syscalls_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libimc_syscalls.a',
+ 'nso_target': 'libimc_syscalls.so',
+ 'build_glibc': 1,
+ 'build_newlib': 1,
+ 'build_irt': 1,
+ },
+ 'sources': ['<@(imc_syscalls)'],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/untrusted/nosys/nosys.gyp b/chromium/native_client/src/untrusted/nosys/nosys.gyp
new file mode 100644
index 00000000000..8b5df97195a
--- /dev/null
+++ b/chromium/native_client/src/untrusted/nosys/nosys.gyp
@@ -0,0 +1,97 @@
+# Copyright (c) 2011 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.
+
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'variables': {
+ 'common_sources': [
+ ],
+ },
+ 'targets' : [
+ {
+ 'target_name': 'nosys_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libnosys.a',
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 1,
+ },
+ 'sources': [
+ 'access.c',
+ 'chmod.c',
+ 'chown.c',
+ 'endpwent.c',
+ 'environ.c',
+ 'execve.c',
+ '_execve.c',
+ 'fcntl.c',
+ 'fchdir.c',
+ 'fchmod.c',
+ 'fchown.c',
+ 'fdatasync.c',
+ 'fork.c',
+ 'fsync.c',
+ 'ftruncate.c',
+ 'get_current_dir_name.c',
+ 'getegid.c',
+ 'geteuid.c',
+ 'getgid.c',
+ 'getlogin.c',
+ 'getrusage.c',
+ 'getppid.c',
+ 'getpwent.c',
+ 'getpwnam.c',
+ 'getpwnam_r.c',
+ 'getpwuid.c',
+ 'getpwuid_r.c',
+ 'getuid.c',
+ 'getwd.c',
+ 'ioctl.c',
+ 'issetugid.c',
+ 'isatty.c',
+ 'kill.c',
+ 'lchown.c',
+ 'link.c',
+ 'llseek.c',
+ 'lstat.c',
+ 'pclose.c',
+ 'pipe.c',
+ 'popen.c',
+ 'pselect.c',
+ 'readlink.c',
+ 'remove.c',
+ 'rename.c',
+ 'select.c',
+ 'setegid.c',
+ 'seteuid.c',
+ 'setgid.c',
+ 'setpwent.c',
+ 'settimeofday.c',
+ 'setuid.c',
+ 'signal.c',
+ 'sigprocmask.c',
+ 'symlink.c',
+ 'system.c',
+ 'times.c',
+ 'tmpfile.c',
+ 'truncate.c',
+ 'ttyname.c',
+ 'ttyname_r.c',
+ 'umask.c',
+ 'utime.c',
+ 'utimes.c',
+ 'vfork.c',
+ 'wait.c',
+ 'waitpid.c',
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/untrusted/pthread/pthread.gyp b/chromium/native_client/src/untrusted/pthread/pthread.gyp
new file mode 100644
index 00000000000..212ebaa8d80
--- /dev/null
+++ b/chromium/native_client/src/untrusted/pthread/pthread.gyp
@@ -0,0 +1,58 @@
+# Copyright (c) 2011 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.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'variables': {
+ 'common_sources': [
+ 'nc_thread.c',
+ 'nc_mutex.c',
+ 'nc_condvar.c',
+ 'nc_semaphore.c',
+ 'nc_init_irt.c',
+ 'stack_end.c',
+ '../valgrind/dynamic_annotations.c',
+ ],
+ },
+ 'targets' : [
+ {
+ 'target_name': 'pthread_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libpthread.a',
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 1,
+ },
+ 'sources': ['<@(common_sources)'],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ },
+ {
+ 'target_name': 'pthread_private_lib',
+ 'type': 'none',
+ 'variables': {
+ 'nlib_target': 'libpthread_private.a',
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 1,
+ },
+ 'sources': [
+ '<@(common_sources)',
+ 'nc_init_private.c',
+ '../irt/irt_blockhook.c',
+ '../irt/irt_cond.c',
+ '../irt/irt_mutex.c',
+ '../irt/irt_sem.c',
+ ],
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ 'pthread_lib'
+ ],
+ },
+ ],
+}
diff --git a/chromium/native_client/src/untrusted/valgrind/valgrind.gyp b/chromium/native_client/src/untrusted/valgrind/valgrind.gyp
new file mode 100644
index 00000000000..57cea67b1d7
--- /dev/null
+++ b/chromium/native_client/src/untrusted/valgrind/valgrind.gyp
@@ -0,0 +1,47 @@
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../../build/common.gypi',
+ ],
+ 'conditions': [
+ ['target_arch!="arm"', {
+ 'targets' : [
+ {
+ 'target_name': 'valgrind_lib',
+ 'type': 'none',
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ 'variables': {
+ 'nlib_target': 'libvalgrind.a',
+ 'nso_target': 'libvalgrind.so',
+ 'build_glibc': 1,
+ 'build_newlib': 1,
+ },
+ 'sources': [
+ 'valgrind_interceptors.c',
+ ],
+ },
+ {
+ 'target_name': 'dynamic_annotations_lib',
+ 'type': 'none',
+ 'dependencies': [
+ '<(DEPTH)/native_client/tools.gyp:prep_toolchain',
+ ],
+ 'variables': {
+ 'nlib_target': 'libdynamic_annotations.a',
+ 'nso_target': 'libdynamic_annotations.so',
+ 'build_glibc': 1,
+ 'build_newlib': 0,
+ },
+ 'sources': [
+ 'dynamic_annotations.c',
+ ],
+ }
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/tests.gyp b/chromium/native_client/tests.gyp
new file mode 100644
index 00000000000..aaeee7988f5
--- /dev/null
+++ b/chromium/native_client/tests.gyp
@@ -0,0 +1,173 @@
+# Copyright (c) 2011 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.
+
+{
+ ######################################################################
+ 'includes': [
+ 'build/common.gypi',
+ ],
+ ######################################################################
+ 'targets': [
+ {
+ 'target_name': 'hello_world_nexe',
+ 'type': 'none',
+ 'dependencies': [
+ 'tools.gyp:prep_toolchain',
+ 'src/untrusted/nacl/nacl.gyp:nacl_lib',
+ 'src/untrusted/irt/irt.gyp:irt_core_nexe'
+ ],
+ 'variables': {
+ 'nexe_target': 'hello_world',
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 1,
+ 'extra_args': [
+ '--strip-all',
+ ],
+ },
+ 'sources': [
+ 'tests/hello_world/hello_world.c',
+ ],
+ },
+ # Build simple_thread_test to verify that __thread linkage works
+ # correctly with gyp-built libraries:
+ # https://code.google.com/p/chromium/issues/detail?id=3461
+ {
+ 'target_name': 'simple_thread_test',
+ 'type': 'none',
+ 'dependencies': [
+ 'tools.gyp:prep_toolchain',
+ 'src/untrusted/nacl/nacl.gyp:nacl_lib',
+ 'src/untrusted/irt/irt.gyp:irt_core_nexe'
+ ],
+ 'link_flags': ['-lpthread'],
+ # Bug 3461 only occurs when linking -fPIC objects so we use
+ # -fPIC here even though it isn't strictly necessary.
+ 'compile_flags': ['-fPIC'],
+ 'variables': {
+ 'nexe_target': 'simple_thread_test',
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_pnacl_newlib': 0,
+ },
+ 'sources': [
+ 'tests/threads/simple_thread_test.c',
+ ],
+ },
+ ],
+ 'conditions': [
+ ['target_arch!="arm"', {
+ 'targets': [
+ # Only build the tests on arm, but don't try to run them
+ {
+ 'target_name': 'test_hello_world_nexe',
+ 'type': 'none',
+ 'dependencies': [
+ 'hello_world_nexe',
+ 'src/trusted/service_runtime/service_runtime.gyp:sel_ldr',
+ ],
+ 'variables': {
+ 'arch': '--arch=<(target_arch)',
+ 'name': '--name=hello_world',
+ 'path': '--path=<(PRODUCT_DIR)',
+ 'script': '<(DEPTH)/native_client/build/test_build.py',
+ 'disable_glibc%': 0,
+ },
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'dependencies': [
+ 'src/trusted/service_runtime/service_runtime.gyp:sel_ldr64',
+ ],
+ }],
+ ['disable_glibc==0',{
+ 'variables': {
+ 'tools': '--tools=newlib',
+ },
+ }, {
+ 'variables': {
+ 'tools': '--tools=newlib',
+ },
+ }],
+ ],
+ 'actions': [
+ {
+ 'action_name': 'test build',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'Testing NACL build',
+ 'inputs': [
+ '<!@(<(python_exe) <(script) -i <(arch) <(name) <(tools))',
+ ],
+ # Add a bogus output file, to cause this step to always fire.
+ 'outputs': [
+ '<(PRODUCT_DIR)/test-output/dont_create_hello_world.out'
+ ],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/test_build.py',
+ '-r',
+ '<(arch)',
+ '<(name)',
+ # TODO(bradnelson): Hack here to prevent gyp path ending with \"
+ # being passed to python which incorrectly
+ # interprets this as escaped quote.
+ # http://code.google.com/p/chromium/issues/detail?id=141463
+ '<(path)/hack',
+ '<(tools)'
+ ],
+ },
+ ],
+ },
+ { # Test the hello world translated from pexe to nexe
+ 'target_name': 'test_hello_world_pnacl_x86_64_nexe',
+ 'type': 'none',
+ 'dependencies': [
+ 'hello_world_nexe',
+ 'src/trusted/service_runtime/service_runtime.gyp:sel_ldr',
+ ],
+ 'variables': {
+ 'arch': '--arch=<(target_arch)',
+ 'name': '--name=hello_world',
+ 'path': '--path=<(PRODUCT_DIR)',
+ 'tools': '--tools=pnacl_newlib',
+ 'script': '<(DEPTH)/native_client/build/test_build.py',
+ },
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'dependencies': [
+ 'src/trusted/service_runtime/service_runtime.gyp:sel_ldr64',
+ ],
+ }],
+ ],
+ 'actions': [
+ {
+ 'action_name': 'test pnacl nexe build',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'Testing PNaCl translated Nexe build',
+ 'inputs': [
+ '<!@(<(python_exe) <(script) -i <(arch) <(name) <(tools))',
+ ],
+ # Add a bogus output file, to cause this step to always fire.
+ 'outputs': [
+ '<(PRODUCT_DIR)/test-output/dont_create_hello_world_pnacl.out'
+ ],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/test_build.py',
+ '-r',
+ '<(arch)',
+ '<(name)',
+ # TODO(bradnelson): Hack here to prevent gyp path ending with \"
+ # being passed to python which incorrectly
+ # interprets this as escaped quote.
+ # http://code.google.com/p/chromium/issues/detail?id=141463
+ '<(path)/hack',
+ '<(tools)'
+ ],
+ },
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/tests/sel_main_chrome/sel_main_chrome.gyp b/chromium/native_client/tests/sel_main_chrome/sel_main_chrome.gyp
new file mode 100644
index 00000000000..a8810d52513
--- /dev/null
+++ b/chromium/native_client/tests/sel_main_chrome/sel_main_chrome.gyp
@@ -0,0 +1,47 @@
+# -*- gyp -*-
+# Copyright (c) 2012 The Native Client Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'includes': [
+ '../../build/common.gypi',
+ ],
+ 'targets': [
+ {
+ # This tests linking of sel_main_chrome.c in the Gyp build. We
+ # do not run this Gyp-built executable.
+ 'target_name': 'sel_main_chrome_test',
+ 'type': 'executable',
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp:sel_ldr_launcher',
+ '<(DEPTH)/native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome',
+ ],
+ 'sources': [
+ 'sel_main_chrome_test.cc',
+ ],
+ },
+ ],
+ 'conditions': [
+ ['OS=="win" and target_arch=="ia32"', {
+ 'targets': [
+ {
+ # This tests linking of sel_main_chrome.c in the Gyp build. We
+ # do not run this Gyp-built executable.
+ 'target_name': 'sel_main_chrome_test64',
+ 'type': 'executable',
+ 'variables': {
+ 'win_target': 'x64',
+ },
+ 'dependencies': [
+ '<(DEPTH)/native_client/src/trusted/nonnacl_util/nonnacl_util.gyp:sel_ldr_launcher64',
+ '<(DEPTH)/native_client/src/trusted/service_runtime/service_runtime.gyp:sel_main_chrome64',
+ ],
+ 'sources': [
+ 'sel_main_chrome_test.cc',
+ ],
+ },
+ ],
+ }],
+ ],
+}
diff --git a/chromium/native_client/tools.gyp b/chromium/native_client/tools.gyp
new file mode 100644
index 00000000000..d51be136384
--- /dev/null
+++ b/chromium/native_client/tools.gyp
@@ -0,0 +1,408 @@
+# Copyright (c) 2011 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.
+
+{
+ ######################################################################
+ 'includes': [
+ 'build/common.gypi',
+ ],
+ ######################################################################
+ 'variables': {
+ 'disable_glibc%': 0,
+ 'disable_newlib%': 0,
+ 'disable_pnacl%': 0,
+ 'disable_arm%': 0,
+ 'disable_glibc_untar%': 0,
+ 'disable_newlib_untar%': 0,
+ 'disable_arm_untar%': 0,
+ 'disable_pnacl_untar%': 0,
+ },
+ 'targets' : [
+ {
+ 'target_name': 'prep_toolchain',
+ 'type': 'none',
+ 'dependencies': [
+ 'untar_toolchains',
+ 'prep_nacl_sdk',
+ ],
+ 'conditions': [
+ ['target_arch=="ia32" or target_arch=="x64"', {
+ 'dependencies': [
+ 'crt_init_32',
+ 'crt_fini_32',
+ 'crt_init_64',
+ 'crt_fini_64',
+ ],
+ }],
+ ['target_arch=="arm"', {
+ 'dependencies': [
+ 'crt_init_arm',
+ 'crt_fini_arm',
+ ]
+ }],
+ ],
+ },
+ {
+ 'target_name': 'untar_toolchains',
+ 'type': 'none',
+ 'variables': {
+ 'newlib_dir': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib',
+ 'glibc_dir': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc',
+ 'pnacl_dir': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_pnacl',
+ 'arm_dir': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_arm_newlib',
+ },
+ 'conditions': [
+ ['disable_newlib==0 and disable_newlib_untar==0', {
+ 'actions': [
+ {
+ 'action_name': 'Untar x86 newlib toolchain',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'Untar x86 newlib toolchain',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/cygtar.py',
+ '<(DEPTH)/native_client/toolchain/.tars/naclsdk_<(OS)_x86.tgz',
+ ],
+ 'outputs': ['>(newlib_dir)/stamp.untar'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/untar_toolchain.py',
+ '--tool', 'x86_newlib',
+ '--tmp', '<(SHARED_INTERMEDIATE_DIR)/untar',
+ '--sdk', '<(SHARED_INTERMEDIATE_DIR)/sdk',
+ '--os', '<(OS)',
+ '<(DEPTH)/native_client/toolchain/.tars/naclsdk_<(OS)_x86.tgz',
+ ],
+ },
+ ]
+ }],
+ ['disable_glibc==0 and disable_glibc_untar==0', {
+ 'actions': [
+ {
+ 'action_name': 'Untar x86 glibc toolchain',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'Untar x86 glibc toolchain',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/cygtar.py',
+ '<(DEPTH)/native_client/toolchain/.tars/toolchain_<(OS)_x86.tar.bz2',
+ ],
+ 'outputs': ['>(glibc_dir)/stamp.untar'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/untar_toolchain.py',
+ '--tool', 'x86_glibc',
+ '--tmp', '<(SHARED_INTERMEDIATE_DIR)/untar',
+ '--sdk', '<(SHARED_INTERMEDIATE_DIR)/sdk',
+ '--os', '<(OS)',
+ '<(DEPTH)/native_client/toolchain/.tars/toolchain_<(OS)_x86.tar.bz2',
+ ],
+ },
+ ]
+ }],
+ ['disable_pnacl==0 and disable_pnacl_untar==0', {
+ 'actions': [
+ {
+ 'action_name': 'Untar pnacl toolchain',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'Untar pnacl toolchain',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/cygtar.py',
+ '<(DEPTH)/native_client/toolchain/.tars/naclsdk_pnacl_<(OS)_x86.tgz',
+ ],
+ 'outputs': ['>(pnacl_dir)/stamp.untar'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/untar_toolchain.py',
+ '--tool', 'x86_pnacl',
+ '--tmp', '<(SHARED_INTERMEDIATE_DIR)/untar',
+ '--sdk', '<(SHARED_INTERMEDIATE_DIR)/sdk',
+ '--os', '<(OS)',
+ '<(DEPTH)/native_client/toolchain/.tars/naclsdk_pnacl_<(OS)_x86.tgz',
+ ],
+ },
+ ]
+ }],
+ ['target_arch=="arm" and disable_arm==0 and disable_arm_untar==0', {
+ 'actions': [
+ {
+ 'action_name': 'Untar arm toolchain',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'Untar arm toolchain',
+ 'inputs': [
+ '<(DEPTH)/native_client/build/cygtar.py',
+ '<(DEPTH)/native_client/toolchain/.tars/gcc_arm.tgz',
+ '<(DEPTH)/native_client/toolchain/.tars/binutils_arm.tgz',
+ '<(DEPTH)/native_client/toolchain/.tars/newlib_arm.tgz',
+ '<(DEPTH)/native_client/toolchain/.tars/gcc_libs_arm.tgz',
+ ],
+ 'outputs': ['>(arm_dir)/stamp.untar'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/untar_toolchain.py',
+ '--tool', 'arm_newlib',
+ '--tmp', '<(SHARED_INTERMEDIATE_DIR)/untar',
+ '--sdk', '<(SHARED_INTERMEDIATE_DIR)/sdk',
+ '--os', '<(OS)',
+ '<(DEPTH)/native_client/toolchain/.tars/gcc_arm.tgz',
+ '<(DEPTH)/native_client/toolchain/.tars/binutils_arm.tgz',
+ '<(DEPTH)/native_client/toolchain/.tars/newlib_arm.tgz',
+ '<(DEPTH)/native_client/toolchain/.tars/gcc_libs_arm.tgz',
+ ],
+ },
+ ]
+ }],
+ ]
+ },
+ {
+ 'target_name': 'prep_nacl_sdk',
+ 'type': 'none',
+ 'dependencies': [
+ 'untar_toolchains',
+ ],
+ 'variables': {
+ 'newlib_dir': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib',
+ 'glibc_dir': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc',
+ 'arm_dir': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_arm_newlib',
+ 'pnacl_dir': '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_pnacl',
+ },
+ 'conditions': [
+ ['disable_newlib==0', {
+ 'actions': [
+ {
+ 'action_name': 'Prep x86 newlib toolchain',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'Prep x86 newlib toolchain',
+ 'inputs': [
+ '<(newlib_dir)/stamp.untar',
+ '>!@pymod_do_main(prep_nacl_sdk --inputs --tool x86_newlib)',
+ ],
+ 'outputs': ['<(newlib_dir)/stamp.prep'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/prep_nacl_sdk.py',
+ '--tool', 'x86_newlib',
+ '--path', '<(newlib_dir)',
+ ],
+ },
+ ]
+ }],
+ ['disable_glibc==0', {
+ 'actions': [
+ {
+ 'action_name': 'Prep x86 glibc toolchain',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'Prep x86 glibc toolchain',
+ 'inputs': [
+ '<(glibc_dir)/stamp.untar',
+ '>!@pymod_do_main(prep_nacl_sdk --inputs --tool x86_glibc)',
+ ],
+ 'outputs': ['<(glibc_dir)/stamp.prep'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/prep_nacl_sdk.py',
+ '--tool', 'x86_glibc',
+ '--path', '<(glibc_dir)',
+ ],
+ },
+ ]
+ }],
+ ['target_arch=="arm" and disable_arm==0', {
+ 'actions': [
+ {
+ 'action_name': 'Prep arm toolchain',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'Prep arm toolchain',
+ 'inputs': [
+ '<(arm_dir)/stamp.untar',
+ '>!@pymod_do_main(prep_nacl_sdk --inputs --tool arm_newlib)',
+ ],
+ 'outputs': ['<(arm_dir)/stamp.prep'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/prep_nacl_sdk.py',
+ '--tool', 'arm_newlib',
+ '--path', '<(arm_dir)',
+ ],
+ },
+ ]
+ }],
+ ['disable_pnacl==0', {
+ 'actions': [
+ {
+ 'action_name': 'Prep pnacl toolchain',
+ 'msvs_cygwin_shell': 0,
+ 'description': 'Prep pnacl toolchain',
+ 'inputs': [
+ '<(pnacl_dir)/stamp.untar',
+ '>!@pymod_do_main(prep_nacl_sdk --inputs --tool x86_pnacl)',
+ ],
+ 'outputs': ['<(pnacl_dir)/stamp.prep'],
+ 'action': [
+ '>(python_exe)',
+ '<(DEPTH)/native_client/build/prep_nacl_sdk.py',
+ '--tool', 'x86_pnacl',
+ '--path', '<(pnacl_dir)',
+ ],
+ },
+ ]
+ }],
+ ]
+ },
+ ],
+ 'conditions': [
+ ['target_arch=="ia32" or target_arch=="x64"', {
+ 'targets' : [
+ {
+ 'target_name': 'crt_init_64',
+ 'type': 'none',
+ 'dependencies': [
+ 'untar_toolchains',
+ 'prep_nacl_sdk'
+ ],
+ 'variables': {
+ 'nlib_target': 'crti.o',
+ 'windows_asm_rule': 0,
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_irt': 0,
+ 'enable_x86_32': 0,
+ 'extra_args': [
+ '--compile',
+ '--no-suffix',
+ '--strip=_x86_64'
+ ],
+ },
+ 'sources': [
+ 'src/untrusted/stubs/crti_x86_64.S',
+ ]
+ },
+ {
+ 'target_name': 'crt_fini_64',
+ 'type': 'none',
+ 'dependencies': [
+ 'untar_toolchains',
+ 'prep_nacl_sdk'
+ ],
+ 'variables': {
+ 'nlib_target': 'crtn.o',
+ 'windows_asm_rule': 0,
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_irt': 0,
+ 'enable_x86_32': 0,
+ 'extra_args': [
+ '--compile',
+ '--no-suffix',
+ '--strip=_x86_64'
+ ],
+ },
+ 'sources': [
+ 'src/untrusted/stubs/crtn_x86_64.S'
+ ],
+ }
+ ],
+ }],
+ ['target_arch=="ia32" or target_arch=="x64"', {
+ 'targets' : [
+ {
+ 'target_name': 'crt_init_32',
+ 'type': 'none',
+ 'dependencies': [
+ 'untar_toolchains',
+ 'prep_nacl_sdk'
+ ],
+ 'variables': {
+ 'nlib_target': 'crti.o',
+ 'windows_asm_rule': 0,
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_irt': 1,
+ 'enable_x86_64': 0,
+ 'extra_args': [
+ '--compile',
+ '--no-suffix',
+ '--strip=_x86_32'
+ ],
+ },
+ 'sources': [
+ 'src/untrusted/stubs/crti_x86_32.S',
+ ],
+ },
+ {
+ 'target_name': 'crt_fini_32',
+ 'type': 'none',
+ 'dependencies': [
+ 'untar_toolchains',
+ 'prep_nacl_sdk'
+ ],
+ 'variables': {
+ 'nlib_target': 'crtn.o',
+ 'windows_asm_rule': 0,
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_irt': 1,
+ 'enable_x86_64': 0,
+ 'extra_args': [
+ '--compile',
+ '--no-suffix',
+ '--strip=_x86_32'
+ ],
+ },
+ 'sources': [
+ 'src/untrusted/stubs/crtn_x86_32.S'
+ ],
+ }
+ ],
+ }],
+ ['target_arch=="arm"', {
+ 'targets' : [
+ {
+ 'target_name': 'crt_init_arm',
+ 'type': 'none',
+ 'dependencies': [
+ 'untar_toolchains',
+ 'prep_nacl_sdk'
+ ],
+ 'variables': {
+ 'nlib_target': 'crti.o',
+ 'windows_asm_rule': 0,
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_irt': 1,
+ 'extra_args': [
+ '--compile',
+ '--no-suffix',
+ '--strip=_arm'
+ ],
+ },
+ 'sources': [
+ 'src/untrusted/stubs/crti_arm.S',
+ ],
+ },
+ {
+ 'target_name': 'crt_fini_arm',
+ 'type': 'none',
+ 'dependencies': [
+ 'untar_toolchains',
+ 'prep_nacl_sdk'
+ ],
+ 'variables': {
+ 'nlib_target': 'crtn.o',
+ 'windows_asm_rule': 0,
+ 'build_glibc': 0,
+ 'build_newlib': 1,
+ 'build_irt': 1,
+ 'extra_args': [
+ '--compile',
+ '--no-suffix',
+ '--strip=_arm'
+ ],
+ },
+ 'sources': [
+ 'src/untrusted/stubs/crtn_arm.S'
+ ],
+ }
+ ],
+ }],
+ ],
+}