2012-01-05 12:17:08 +00:00
|
|
|
# Copyright 2012 the V8 project authors. All rights reserved.
|
2011-08-25 14:50:09 +00:00
|
|
|
# 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.
|
|
|
|
|
|
|
|
# Definitions to be used when building stand-alone V8 binaries.
|
|
|
|
|
|
|
|
{
|
2013-07-10 11:15:16 +00:00
|
|
|
# We need to include toolchain.gypi here for third-party sources that don't
|
|
|
|
# directly include it themselves.
|
|
|
|
'includes': ['toolchain.gypi'],
|
2011-08-25 14:50:09 +00:00
|
|
|
'variables': {
|
|
|
|
'component%': 'static_library',
|
2015-01-22 07:21:35 +00:00
|
|
|
'clang_dir%': 'third_party/llvm-build/Release+Asserts',
|
2014-11-27 17:18:03 +00:00
|
|
|
'clang_xcode%': 0,
|
2015-04-27 13:20:05 +00:00
|
|
|
# Track where uninitialized memory originates from. From fastest to
|
|
|
|
# slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
|
|
|
|
# - track the chain of stores leading from allocation site to use site.
|
|
|
|
'msan_track_origins%': 1,
|
2011-08-25 14:50:09 +00:00
|
|
|
'visibility%': 'hidden',
|
2012-12-14 14:39:18 +00:00
|
|
|
'v8_enable_backtrace%': 0,
|
2013-09-19 12:07:03 +00:00
|
|
|
'v8_enable_i18n_support%': 1,
|
2013-11-22 10:57:55 +00:00
|
|
|
'v8_deprecation_warnings': 1,
|
2011-08-25 14:50:09 +00:00
|
|
|
'msvs_multi_core_compile%': '1',
|
2012-07-02 14:58:43 +00:00
|
|
|
'mac_deployment_target%': '10.5',
|
2015-04-15 15:20:14 +00:00
|
|
|
'release_extra_cflags%': '',
|
2011-08-25 14:50:09 +00:00
|
|
|
'variables': {
|
|
|
|
'variables': {
|
2011-09-15 08:16:07 +00:00
|
|
|
'variables': {
|
|
|
|
'conditions': [
|
2012-05-11 13:52:16 +00:00
|
|
|
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or \
|
2015-01-30 08:01:53 +00:00
|
|
|
OS=="netbsd" or OS=="mac" or OS=="qnx" or OS=="aix"', {
|
2012-05-11 13:52:16 +00:00
|
|
|
# This handles the Unix platforms we generally deal with.
|
2012-01-05 12:17:08 +00:00
|
|
|
# Anything else gets passed through, which probably won't work
|
|
|
|
# very well; such hosts should pass an explicit target_arch
|
|
|
|
# to gyp.
|
2014-06-24 07:12:48 +00:00
|
|
|
'host_arch%': '<!pymod_do_main(detect_v8_host_arch)',
|
2012-01-05 12:17:08 +00:00
|
|
|
}, {
|
2012-05-11 13:52:16 +00:00
|
|
|
# OS!="linux" and OS!="freebsd" and OS!="openbsd" and
|
2015-01-30 08:01:53 +00:00
|
|
|
# OS!="netbsd" and OS!="mac" and OS!="aix"
|
2011-09-15 08:16:07 +00:00
|
|
|
'host_arch%': 'ia32',
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'host_arch%': '<(host_arch)',
|
|
|
|
'target_arch%': '<(host_arch)',
|
2011-08-25 14:50:09 +00:00
|
|
|
},
|
|
|
|
'host_arch%': '<(host_arch)',
|
2011-09-15 08:16:07 +00:00
|
|
|
'target_arch%': '<(target_arch)',
|
2011-08-25 14:50:09 +00:00
|
|
|
'v8_target_arch%': '<(target_arch)',
|
2015-04-17 08:13:20 +00:00
|
|
|
'asan%': 0,
|
|
|
|
'lsan%': 0,
|
|
|
|
'msan%': 0,
|
|
|
|
'tsan%': 0,
|
2015-01-21 15:30:18 +00:00
|
|
|
|
|
|
|
# goma settings.
|
|
|
|
# 1 to use goma.
|
|
|
|
# If no gomadir is set, it uses the default gomadir.
|
|
|
|
'use_goma%': 0,
|
|
|
|
'gomadir%': '',
|
|
|
|
'conditions': [
|
|
|
|
# Set default gomadir.
|
|
|
|
['OS=="win"', {
|
|
|
|
'gomadir': 'c:\\goma\\goma-win',
|
|
|
|
}, {
|
|
|
|
'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
|
|
|
|
}],
|
|
|
|
],
|
2011-08-25 14:50:09 +00:00
|
|
|
},
|
|
|
|
'host_arch%': '<(host_arch)',
|
|
|
|
'target_arch%': '<(target_arch)',
|
|
|
|
'v8_target_arch%': '<(v8_target_arch)',
|
2011-10-06 11:08:41 +00:00
|
|
|
'werror%': '-Werror',
|
2015-01-21 15:30:18 +00:00
|
|
|
'use_goma%': '<(use_goma)',
|
|
|
|
'gomadir%': '<(gomadir)',
|
2015-04-17 08:13:20 +00:00
|
|
|
'asan%': '<(asan)',
|
|
|
|
'lsan%': '<(lsan)',
|
|
|
|
'msan%': '<(msan)',
|
|
|
|
'tsan%': '<(tsan)',
|
2013-06-28 15:22:46 +00:00
|
|
|
|
|
|
|
# .gyp files or targets should set v8_code to 1 if they build V8 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.
|
|
|
|
'v8_code%': 0,
|
|
|
|
|
2013-10-14 13:07:41 +00:00
|
|
|
# Speeds up Debug builds:
|
|
|
|
# 0 - Compiler optimizations off (debuggable) (default). This may
|
|
|
|
# be 5x slower than Release (or worse).
|
2015-01-12 09:58:29 +00:00
|
|
|
# 1 - Turn on optimizations and disable slow DCHECKs, but leave
|
|
|
|
# V8_ENABLE_CHECKS and most other assertions enabled. This may cause
|
|
|
|
# some v8 tests to fail in the Debug configuration. This roughly
|
|
|
|
# matches the performance of a Release build and can be used by
|
|
|
|
# embedders that need to build their own code as debug but don't want
|
|
|
|
# or need a debug version of V8. This should produce near-release
|
|
|
|
# speeds.
|
2013-10-14 13:07:41 +00:00
|
|
|
'v8_optimized_debug%': 0,
|
|
|
|
|
2014-12-11 15:27:38 +00:00
|
|
|
# Use external files for startup data blobs:
|
|
|
|
# the JS builtins sources and the start snapshot.
|
|
|
|
# Embedders that don't use standalone.gypi will need to add
|
|
|
|
# their own default value.
|
|
|
|
'v8_use_external_startup_data%': 0,
|
|
|
|
|
2013-09-17 08:31:56 +00:00
|
|
|
# Relative path to icu.gyp from this file.
|
|
|
|
'icu_gyp_path': '../third_party/icu/icu.gyp',
|
|
|
|
|
2011-08-25 14:50:09 +00:00
|
|
|
'conditions': [
|
|
|
|
['(v8_target_arch=="arm" and host_arch!="arm") or \
|
2014-03-21 08:47:03 +00:00
|
|
|
(v8_target_arch=="arm64" and host_arch!="arm64") or \
|
2012-07-11 15:15:04 +00:00
|
|
|
(v8_target_arch=="mipsel" and host_arch!="mipsel") or \
|
2014-07-09 11:08:26 +00:00
|
|
|
(v8_target_arch=="mips64el" and host_arch!="mips64el") or \
|
2012-07-18 11:43:44 +00:00
|
|
|
(v8_target_arch=="x64" and host_arch!="x64") or \
|
2014-01-02 07:04:05 +00:00
|
|
|
(OS=="android" or OS=="qnx")', {
|
2011-08-25 14:50:09 +00:00
|
|
|
'want_separate_host_toolset': 1,
|
|
|
|
}, {
|
|
|
|
'want_separate_host_toolset': 0,
|
|
|
|
}],
|
2013-06-28 15:22:46 +00:00
|
|
|
['OS == "win"', {
|
|
|
|
'os_posix%': 0,
|
|
|
|
}, {
|
|
|
|
'os_posix%': 1,
|
|
|
|
}],
|
2015-01-21 15:30:18 +00:00
|
|
|
['OS=="win" and use_goma==1', {
|
|
|
|
# goma doesn't support pch yet.
|
|
|
|
'chromium_win_pch': 0,
|
|
|
|
# goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
|
|
|
|
'conditions': [
|
|
|
|
['win_z7==0 and fastbuild==0', {
|
|
|
|
'fastbuild': 1,
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
}],
|
2014-05-23 16:37:27 +00:00
|
|
|
['(v8_target_arch=="ia32" or v8_target_arch=="x64" or v8_target_arch=="x87") and \
|
2013-07-03 12:00:40 +00:00
|
|
|
(OS=="linux" or OS=="mac")', {
|
|
|
|
'v8_enable_gdbjit%': 1,
|
|
|
|
}, {
|
|
|
|
'v8_enable_gdbjit%': 0,
|
|
|
|
}],
|
2015-04-09 13:26:29 +00:00
|
|
|
['(OS=="linux" or OS=="mac") and (target_arch=="ia32" or target_arch=="x64") and \
|
|
|
|
(v8_target_arch!="x87")', {
|
2014-08-05 13:23:55 +00:00
|
|
|
'clang%': 1,
|
|
|
|
}, {
|
|
|
|
'clang%': 0,
|
|
|
|
}],
|
2015-03-18 08:42:14 +00:00
|
|
|
['host_arch!="ppc" and host_arch!="ppc64" and host_arch!="ppc64le"', {
|
|
|
|
'host_clang%': '1',
|
|
|
|
}, {
|
|
|
|
'host_clang%': '0',
|
|
|
|
}],
|
2015-04-17 08:13:20 +00:00
|
|
|
['asan==1 or lsan==1 or msan==1 or tsan==1', {
|
|
|
|
'clang%': 1,
|
|
|
|
'use_allocator%': 'none',
|
|
|
|
}],
|
2011-08-25 14:50:09 +00:00
|
|
|
],
|
2012-05-03 08:11:38 +00:00
|
|
|
# Default ARM variable settings.
|
2013-12-11 11:58:07 +00:00
|
|
|
'arm_version%': 'default',
|
2012-05-03 08:11:38 +00:00
|
|
|
'arm_fpu%': 'vfpv3',
|
2013-04-16 15:36:11 +00:00
|
|
|
'arm_float_abi%': 'default',
|
|
|
|
'arm_thumb': 'default',
|
2014-11-10 11:47:54 +00:00
|
|
|
|
|
|
|
# Default MIPS variable settings.
|
|
|
|
'mips_arch_variant%': 'r2',
|
|
|
|
# Possible values fp32, fp64, fpxx.
|
|
|
|
# fp32 - 32 32-bit FPU registers are available, doubles are placed in
|
|
|
|
# register pairs.
|
|
|
|
# fp64 - 32 64-bit FPU registers are available.
|
|
|
|
# fpxx - compatibility mode, it chooses fp32 or fp64 depending on runtime
|
|
|
|
# detection
|
|
|
|
'mips_fpu_mode%': 'fp32',
|
2011-08-25 14:50:09 +00:00
|
|
|
},
|
|
|
|
'target_defaults': {
|
2013-06-28 15:22:46 +00:00
|
|
|
'variables': {
|
|
|
|
'v8_code%': '<(v8_code)',
|
|
|
|
},
|
2011-08-25 14:50:09 +00:00
|
|
|
'default_configuration': 'Debug',
|
|
|
|
'configurations': {
|
Use abstract configurations to switch between opt debug settings
The problem is that conditions are evaluated before configuration inheritance is resolved, so we can't just define a configuration like this:
'Optdebug': {
'inherits_from': ['Debug'],
'variables': {
'v8_optimized_debug': 2,
}
}
Instead, we have to put the different settings depending on the optimization level into separate configurations, and use conditions inside the concrete configurations to inherit from the correct base class.
Common settings go in the base configuration DebugBaseCommon, and v8_optimized_debug dependent settings go into DebugBase{0,1,2}
The new Debug configuration inherits from DebugBaseCommon and DebugBase<(v8_optimized_debug), while the new configuration Optdebug inherits from DebugBaseCommon and DebugBase2.
BUG=v8:3252
R=machenbach@chromium.org, jkummerow@chromium.org
LOG=n
Review URL: https://codereview.chromium.org/224443003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-09 09:54:49 +00:00
|
|
|
'DebugBaseCommon': {
|
2014-10-22 08:12:17 +00:00
|
|
|
'conditions': [
|
2015-03-18 08:42:14 +00:00
|
|
|
['OS=="aix"', {
|
|
|
|
'cflags': [ '-g', '-Og', '-gxcoff' ],
|
|
|
|
}, {
|
|
|
|
'cflags': [ '-g', '-O0' ],
|
2015-01-30 08:01:53 +00:00
|
|
|
}],
|
2014-10-22 08:12:17 +00:00
|
|
|
],
|
2011-08-25 14:50:09 +00:00
|
|
|
},
|
Use abstract configurations to switch between opt debug settings
The problem is that conditions are evaluated before configuration inheritance is resolved, so we can't just define a configuration like this:
'Optdebug': {
'inherits_from': ['Debug'],
'variables': {
'v8_optimized_debug': 2,
}
}
Instead, we have to put the different settings depending on the optimization level into separate configurations, and use conditions inside the concrete configurations to inherit from the correct base class.
Common settings go in the base configuration DebugBaseCommon, and v8_optimized_debug dependent settings go into DebugBase{0,1,2}
The new Debug configuration inherits from DebugBaseCommon and DebugBase<(v8_optimized_debug), while the new configuration Optdebug inherits from DebugBaseCommon and DebugBase2.
BUG=v8:3252
R=machenbach@chromium.org, jkummerow@chromium.org
LOG=n
Review URL: https://codereview.chromium.org/224443003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-09 09:54:49 +00:00
|
|
|
'Optdebug': {
|
2015-01-12 09:58:29 +00:00
|
|
|
'inherit_from': [ 'DebugBaseCommon', 'DebugBase1' ],
|
Use abstract configurations to switch between opt debug settings
The problem is that conditions are evaluated before configuration inheritance is resolved, so we can't just define a configuration like this:
'Optdebug': {
'inherits_from': ['Debug'],
'variables': {
'v8_optimized_debug': 2,
}
}
Instead, we have to put the different settings depending on the optimization level into separate configurations, and use conditions inside the concrete configurations to inherit from the correct base class.
Common settings go in the base configuration DebugBaseCommon, and v8_optimized_debug dependent settings go into DebugBase{0,1,2}
The new Debug configuration inherits from DebugBaseCommon and DebugBase<(v8_optimized_debug), while the new configuration Optdebug inherits from DebugBaseCommon and DebugBase2.
BUG=v8:3252
R=machenbach@chromium.org, jkummerow@chromium.org
LOG=n
Review URL: https://codereview.chromium.org/224443003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20605 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2014-04-09 09:54:49 +00:00
|
|
|
},
|
|
|
|
'Debug': {
|
|
|
|
# Xcode insists on this empty entry.
|
|
|
|
},
|
2013-02-06 10:51:55 +00:00
|
|
|
'Release': {
|
2015-04-15 15:20:14 +00:00
|
|
|
'cflags+': ['<@(release_extra_cflags)'],
|
2013-02-06 10:51:55 +00:00
|
|
|
},
|
2011-08-25 14:50:09 +00:00
|
|
|
},
|
2015-03-09 17:22:20 +00:00
|
|
|
'conditions':[
|
|
|
|
['(clang==1 or host_clang==1) and OS!="win"', {
|
|
|
|
# This is here so that all files get recompiled after a clang roll and
|
|
|
|
# when turning clang on or off.
|
|
|
|
# (defines are passed via the command line, and build systems rebuild
|
|
|
|
# things when their commandline changes). Nothing should ever read this
|
|
|
|
# define.
|
|
|
|
'defines': ['CR_CLANG_REVISION=<!(<(DEPTH)/tools/clang/scripts/update.sh --print-revision)'],
|
2015-03-14 18:41:28 +00:00
|
|
|
'cflags+': [
|
|
|
|
'-Wno-format-pedantic',
|
|
|
|
],
|
2015-03-09 17:22:20 +00:00
|
|
|
}],
|
|
|
|
],
|
2013-06-28 15:22:46 +00:00
|
|
|
'target_conditions': [
|
|
|
|
['v8_code == 0', {
|
2013-08-01 19:20:01 +00:00
|
|
|
'defines!': [
|
|
|
|
'DEBUG',
|
|
|
|
],
|
2013-06-28 15:22:46 +00:00
|
|
|
'conditions': [
|
|
|
|
['os_posix == 1 and OS != "mac"', {
|
2015-02-26 08:19:27 +00:00
|
|
|
# We don't want to get warnings from third-party code,
|
|
|
|
# so remove any existing warning-enabling flags like -Wall.
|
2013-06-28 15:22:46 +00:00
|
|
|
'cflags!': [
|
2015-02-26 08:19:27 +00:00
|
|
|
'-pedantic',
|
|
|
|
'-Wall',
|
2013-06-28 15:22:46 +00:00
|
|
|
'-Werror',
|
2015-02-26 08:19:27 +00:00
|
|
|
'-Wextra',
|
2015-04-28 06:54:08 +00:00
|
|
|
'-Wshorten-64-to-32',
|
2015-02-26 08:19:27 +00:00
|
|
|
],
|
|
|
|
'cflags+': [
|
|
|
|
# Clang considers the `register` keyword as deprecated, but
|
|
|
|
# ICU uses it all over the place.
|
|
|
|
'-Wno-deprecated-register',
|
|
|
|
# ICU uses its own deprecated functions.
|
|
|
|
'-Wno-deprecated-declarations',
|
|
|
|
# ICU prefers `a && b || c` over `(a && b) || c`.
|
|
|
|
'-Wno-logical-op-parentheses',
|
|
|
|
# ICU has some `unsigned < 0` checks.
|
|
|
|
'-Wno-tautological-compare',
|
|
|
|
# uresdata.c has switch(RES_GET_TYPE(x)) code. The
|
|
|
|
# RES_GET_TYPE macro returns an UResType enum, but some switch
|
|
|
|
# statement contains case values that aren't part of that
|
|
|
|
# enum (e.g. URES_TABLE32 which is in UResInternalType). This
|
|
|
|
# is on purpose.
|
|
|
|
'-Wno-switch',
|
|
|
|
],
|
|
|
|
'cflags_cc!': [
|
|
|
|
'-Wnon-virtual-dtor',
|
2013-06-28 15:22:46 +00:00
|
|
|
],
|
|
|
|
}],
|
|
|
|
['OS == "mac"', {
|
|
|
|
'xcode_settings': {
|
|
|
|
'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
['OS == "win"', {
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCCLCompilerTool': {
|
|
|
|
'WarnAsError': 'false',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
2011-08-25 14:50:09 +00:00
|
|
|
},
|
|
|
|
'conditions': [
|
2015-01-09 13:38:13 +00:00
|
|
|
['asan==1 and OS!="mac"', {
|
2014-03-13 10:36:55 +00:00
|
|
|
'target_defaults': {
|
|
|
|
'cflags_cc+': [
|
|
|
|
'-fno-omit-frame-pointer',
|
|
|
|
'-gline-tables-only',
|
|
|
|
'-fsanitize=address',
|
|
|
|
'-w', # http://crbug.com/162783
|
|
|
|
],
|
2015-01-09 13:38:13 +00:00
|
|
|
'cflags!': [
|
2014-03-13 10:36:55 +00:00
|
|
|
'-fomit-frame-pointer',
|
|
|
|
],
|
|
|
|
'ldflags': [
|
|
|
|
'-fsanitize=address',
|
|
|
|
],
|
2014-03-26 10:01:53 +00:00
|
|
|
},
|
2014-03-13 10:36:55 +00:00
|
|
|
}],
|
2015-01-09 13:38:13 +00:00
|
|
|
['tsan==1 and OS!="mac"', {
|
2014-07-23 13:14:26 +00:00
|
|
|
'target_defaults': {
|
|
|
|
'cflags+': [
|
|
|
|
'-fno-omit-frame-pointer',
|
|
|
|
'-gline-tables-only',
|
|
|
|
'-fsanitize=thread',
|
|
|
|
'-fPIC',
|
|
|
|
'-Wno-c++11-extensions',
|
|
|
|
],
|
|
|
|
'cflags!': [
|
|
|
|
'-fomit-frame-pointer',
|
|
|
|
],
|
|
|
|
'ldflags': [
|
|
|
|
'-fsanitize=thread',
|
|
|
|
'-pie',
|
|
|
|
],
|
|
|
|
'defines': [
|
|
|
|
'THREAD_SANITIZER',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
2015-04-27 13:20:05 +00:00
|
|
|
['msan==1 and OS!="mac"', {
|
|
|
|
'target_defaults': {
|
|
|
|
'cflags_cc+': [
|
|
|
|
'-fno-omit-frame-pointer',
|
|
|
|
'-gline-tables-only',
|
|
|
|
'-fsanitize=memory',
|
|
|
|
'-fsanitize-memory-track-origins=<(msan_track_origins)',
|
|
|
|
'-fPIC',
|
|
|
|
],
|
|
|
|
'cflags+': [
|
|
|
|
'-fPIC',
|
|
|
|
],
|
|
|
|
'cflags!': [
|
|
|
|
'-fno-exceptions',
|
|
|
|
'-fomit-frame-pointer',
|
|
|
|
],
|
|
|
|
'ldflags': [
|
|
|
|
'-fsanitize=memory',
|
|
|
|
],
|
|
|
|
'defines': [
|
|
|
|
'MEMORY_SANITIZER',
|
|
|
|
],
|
|
|
|
'dependencies': [
|
|
|
|
# Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
|
|
|
|
# stdlibc++ as standard library. This is intended to use for instrumented
|
|
|
|
# builds.
|
|
|
|
'<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
2015-01-09 13:38:13 +00:00
|
|
|
['asan==1 and OS=="mac"', {
|
|
|
|
'target_defaults': {
|
|
|
|
'xcode_settings': {
|
|
|
|
'OTHER_CFLAGS+': [
|
|
|
|
'-fno-omit-frame-pointer',
|
|
|
|
'-gline-tables-only',
|
|
|
|
'-fsanitize=address',
|
|
|
|
'-w', # http://crbug.com/162783
|
|
|
|
],
|
|
|
|
'OTHER_CFLAGS!': [
|
|
|
|
'-fomit-frame-pointer',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'target_conditions': [
|
|
|
|
['_type!="static_library"', {
|
|
|
|
'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']},
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
'dependencies': [
|
|
|
|
'<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
2012-01-05 12:17:08 +00:00
|
|
|
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
|
2015-01-30 08:01:53 +00:00
|
|
|
or OS=="netbsd" or OS=="aix"', {
|
2011-08-25 14:50:09 +00:00
|
|
|
'target_defaults': {
|
2014-09-04 09:23:50 +00:00
|
|
|
'cflags': [
|
|
|
|
'-Wall',
|
|
|
|
'<(werror)',
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-Wno-long-long',
|
|
|
|
'-pthread',
|
|
|
|
'-fno-exceptions',
|
|
|
|
'-pedantic',
|
|
|
|
# Don't warn about the "struct foo f = {0};" initialization pattern.
|
|
|
|
'-Wno-missing-field-initializers',
|
|
|
|
],
|
2014-08-05 13:23:55 +00:00
|
|
|
'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-std=gnu++0x' ],
|
2011-08-25 14:50:09 +00:00
|
|
|
'ldflags': [ '-pthread', ],
|
|
|
|
'conditions': [
|
2015-04-28 06:54:08 +00:00
|
|
|
# TODO(arm64): It'd be nice to enable this for arm64 as well,
|
|
|
|
# but the Assembler requires some serious fixing first.
|
|
|
|
[ 'clang==1 and v8_target_arch=="x64"', {
|
|
|
|
'cflags': [ '-Wshorten-64-to-32' ],
|
|
|
|
}],
|
2015-03-26 08:06:41 +00:00
|
|
|
[ 'host_arch=="ppc64" and OS!="aix"', {
|
2015-01-30 08:01:53 +00:00
|
|
|
'cflags': [ '-mminimal-toc' ],
|
|
|
|
}],
|
2012-12-14 14:27:06 +00:00
|
|
|
[ 'visibility=="hidden" and v8_enable_backtrace==0', {
|
2011-08-25 14:50:09 +00:00
|
|
|
'cflags': [ '-fvisibility=hidden' ],
|
|
|
|
}],
|
2011-08-26 11:23:51 +00:00
|
|
|
[ 'component=="shared_library"', {
|
|
|
|
'cflags': [ '-fPIC', ],
|
|
|
|
}],
|
2011-08-25 14:50:09 +00:00
|
|
|
],
|
|
|
|
},
|
2012-01-05 12:17:08 +00:00
|
|
|
}],
|
|
|
|
# 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"
|
|
|
|
# or OS=="netbsd"'
|
2014-01-02 07:04:05 +00:00
|
|
|
['OS=="qnx"', {
|
|
|
|
'target_defaults': {
|
2014-09-04 09:23:50 +00:00
|
|
|
'cflags': [
|
|
|
|
'-Wall',
|
|
|
|
'<(werror)',
|
|
|
|
'-Wno-unused-parameter',
|
|
|
|
'-fno-exceptions',
|
|
|
|
# Don't warn about the "struct foo f = {0};" initialization pattern.
|
|
|
|
'-Wno-missing-field-initializers',
|
|
|
|
],
|
2014-08-05 13:23:55 +00:00
|
|
|
'cflags_cc': [ '-Wnon-virtual-dtor', '-fno-rtti', '-std=gnu++0x' ],
|
2014-01-02 07:04:05 +00:00
|
|
|
'conditions': [
|
|
|
|
[ 'visibility=="hidden"', {
|
|
|
|
'cflags': [ '-fvisibility=hidden' ],
|
|
|
|
}],
|
|
|
|
[ 'component=="shared_library"', {
|
|
|
|
'cflags': [ '-fPIC' ],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
'target_conditions': [
|
|
|
|
[ '_toolset=="host" and host_os=="linux"', {
|
|
|
|
'cflags': [ '-pthread' ],
|
|
|
|
'ldflags': [ '-pthread' ],
|
|
|
|
'libraries': [ '-lrt' ],
|
|
|
|
}],
|
|
|
|
[ '_toolset=="target"', {
|
|
|
|
'cflags': [ '-Wno-psabi' ],
|
|
|
|
'libraries': [ '-lbacktrace', '-lsocket', '-lm' ],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}], # OS=="qnx"
|
2011-08-25 14:50:09 +00:00
|
|
|
['OS=="win"', {
|
|
|
|
'target_defaults': {
|
|
|
|
'defines': [
|
|
|
|
'_CRT_SECURE_NO_DEPRECATE',
|
|
|
|
'_CRT_NONSTDC_NO_DEPRECATE',
|
2014-08-27 08:45:39 +00:00
|
|
|
'_USING_V110_SDK71_',
|
2011-08-25 14:50:09 +00:00
|
|
|
],
|
|
|
|
'conditions': [
|
|
|
|
['component=="static_library"', {
|
|
|
|
'defines': [
|
|
|
|
'_HAS_EXCEPTIONS=0',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
|
|
|
|
'msvs_disabled_warnings': [4355, 4800],
|
|
|
|
'msvs_settings': {
|
|
|
|
'VCCLCompilerTool': {
|
|
|
|
'MinimalRebuild': 'false',
|
|
|
|
'BufferSecurityCheck': 'true',
|
|
|
|
'EnableFunctionLevelLinking': 'true',
|
|
|
|
'RuntimeTypeInfo': 'false',
|
|
|
|
'WarningLevel': '3',
|
|
|
|
'WarnAsError': 'true',
|
|
|
|
'DebugInformationFormat': '3',
|
|
|
|
'Detect64BitPortabilityProblems': 'false',
|
|
|
|
'conditions': [
|
|
|
|
[ 'msvs_multi_core_compile', {
|
|
|
|
'AdditionalOptions': ['/MP'],
|
|
|
|
}],
|
|
|
|
['component=="shared_library"', {
|
|
|
|
'ExceptionHandling': '1', # /EHsc
|
|
|
|
}, {
|
|
|
|
'ExceptionHandling': '0',
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'VCLibrarianTool': {
|
|
|
|
'AdditionalOptions': ['/ignore:4221'],
|
2014-10-08 09:09:57 +00:00
|
|
|
'conditions': [
|
|
|
|
['v8_target_arch=="x64"', {
|
|
|
|
'TargetMachine': '17', # x64
|
|
|
|
}, {
|
|
|
|
'TargetMachine': '1', # ia32
|
|
|
|
}],
|
|
|
|
],
|
2011-08-25 14:50:09 +00:00
|
|
|
},
|
|
|
|
'VCLinkerTool': {
|
|
|
|
'AdditionalDependencies': [
|
|
|
|
'ws2_32.lib',
|
|
|
|
],
|
|
|
|
'GenerateDebugInformation': 'true',
|
|
|
|
'MapFileName': '$(OutDir)\\$(TargetName).map',
|
|
|
|
'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
|
|
|
|
'FixedBaseAddress': '1',
|
|
|
|
# LinkIncremental values:
|
|
|
|
# 0 == default
|
|
|
|
# 1 == /INCREMENTAL:NO
|
|
|
|
# 2 == /INCREMENTAL
|
|
|
|
'LinkIncremental': '1',
|
|
|
|
# SubSystem values:
|
|
|
|
# 0 == not set
|
|
|
|
# 1 == /SUBSYSTEM:CONSOLE
|
|
|
|
# 2 == /SUBSYSTEM:WINDOWS
|
|
|
|
'SubSystem': '1',
|
2013-07-09 09:55:27 +00:00
|
|
|
|
|
|
|
'conditions': [
|
|
|
|
['v8_enable_i18n_support==1', {
|
|
|
|
'AdditionalDependencies': [
|
|
|
|
'advapi32.lib',
|
|
|
|
],
|
|
|
|
}],
|
2014-10-08 09:09:57 +00:00
|
|
|
['v8_target_arch=="x64"', {
|
|
|
|
'MinimumRequiredVersion': '5.02', # Server 2003.
|
|
|
|
'TargetMachine': '17', # x64
|
|
|
|
}, {
|
|
|
|
'MinimumRequiredVersion': '5.01', # XP.
|
|
|
|
'TargetMachine': '1', # ia32
|
|
|
|
}],
|
2013-07-09 09:55:27 +00:00
|
|
|
],
|
2011-08-25 14:50:09 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}], # OS=="win"
|
|
|
|
['OS=="mac"', {
|
2012-05-11 12:18:09 +00:00
|
|
|
'xcode_settings': {
|
2014-12-18 20:42:32 +00:00
|
|
|
'SDKROOT': 'macosx',
|
2012-05-11 12:18:09 +00:00
|
|
|
'SYMROOT': '<(DEPTH)/xcodebuild',
|
|
|
|
},
|
2011-08-25 14:50:09 +00:00
|
|
|
'target_defaults': {
|
|
|
|
'xcode_settings': {
|
|
|
|
'ALWAYS_SEARCH_USER_PATHS': 'NO',
|
2014-08-05 13:23:55 +00:00
|
|
|
'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
|
2011-08-25 14:50:09 +00:00
|
|
|
'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 maps to -fvisibility-inlines-hidden
|
|
|
|
'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
|
|
|
|
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
|
|
|
|
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
|
2013-06-25 14:39:27 +00:00
|
|
|
'GCC_WARN_NON_VIRTUAL_DESTRUCTOR': 'YES', # -Wnon-virtual-dtor
|
2012-07-02 14:58:43 +00:00
|
|
|
# MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
|
|
|
|
'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
|
2011-08-25 14:50:09 +00:00
|
|
|
'PREBINDING': 'NO', # No -Wl,-prebind
|
2012-05-11 12:18:09 +00:00
|
|
|
'SYMROOT': '<(DEPTH)/xcodebuild',
|
2011-08-25 14:50:09 +00:00
|
|
|
'USE_HEADERMAP': 'NO',
|
|
|
|
'OTHER_CFLAGS': [
|
|
|
|
'-fno-strict-aliasing',
|
|
|
|
],
|
|
|
|
'WARNING_CFLAGS': [
|
|
|
|
'-Wall',
|
|
|
|
'-Wendif-labels',
|
|
|
|
'-Wno-unused-parameter',
|
2014-09-04 09:23:50 +00:00
|
|
|
# Don't warn about the "struct foo f = {0};" initialization pattern.
|
|
|
|
'-Wno-missing-field-initializers',
|
2011-08-25 14:50:09 +00:00
|
|
|
],
|
|
|
|
},
|
2013-12-02 15:29:31 +00:00
|
|
|
'conditions': [
|
|
|
|
['werror==""', {
|
|
|
|
'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO'},
|
|
|
|
}, {
|
|
|
|
'xcode_settings': {'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES'},
|
|
|
|
}],
|
2014-03-14 07:47:08 +00:00
|
|
|
['clang==1', {
|
|
|
|
'xcode_settings': {
|
|
|
|
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
|
2014-08-05 13:23:55 +00:00
|
|
|
'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
|
2014-03-14 07:47:08 +00:00
|
|
|
},
|
|
|
|
}],
|
2013-12-02 15:29:31 +00:00
|
|
|
],
|
2011-08-25 14:50:09 +00:00
|
|
|
'target_conditions': [
|
|
|
|
['_type!="static_library"', {
|
|
|
|
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
|
|
|
|
}],
|
|
|
|
], # target_conditions
|
|
|
|
}, # target_defaults
|
|
|
|
}], # OS=="mac"
|
2015-03-05 12:54:27 +00:00
|
|
|
['clang!=1 and host_clang==1 and target_arch!="ia32" and target_arch!="x64"', {
|
|
|
|
'make_global_settings': [
|
|
|
|
['CC.host', '../<(clang_dir)/bin/clang'],
|
|
|
|
['CXX.host', '../<(clang_dir)/bin/clang++'],
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
['clang==0 and host_clang==1 and target_arch!="ia32" and target_arch!="x64"', {
|
|
|
|
'target_conditions': [
|
|
|
|
['_toolset=="host"', {
|
|
|
|
'cflags_cc': [ '-std=gnu++11', ],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
'target_defaults': {
|
|
|
|
'target_conditions': [
|
|
|
|
['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}],
|
2015-03-04 05:56:03 +00:00
|
|
|
['clang==1 and "<(GENERATOR)"=="ninja"', {
|
|
|
|
# See http://crbug.com/110262
|
|
|
|
'target_defaults': {
|
|
|
|
'cflags': [ '-fcolor-diagnostics' ],
|
|
|
|
'xcode_settings': { 'OTHER_CFLAGS': [ '-fcolor-diagnostics' ] },
|
|
|
|
},
|
|
|
|
}],
|
2014-11-27 17:18:03 +00:00
|
|
|
['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
|
2015-01-22 07:21:35 +00:00
|
|
|
'and OS!="win" and "<(GENERATOR)"=="make"', {
|
2014-11-27 17:18:03 +00:00
|
|
|
'make_global_settings': [
|
2015-01-22 07:21:35 +00:00
|
|
|
['CC', '../<(clang_dir)/bin/clang'],
|
|
|
|
['CXX', '../<(clang_dir)/bin/clang++'],
|
|
|
|
['CC.host', '$(CC)'],
|
|
|
|
['CXX.host', '$(CXX)'],
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
|
|
|
|
'and OS!="win" and "<(GENERATOR)"=="ninja"', {
|
|
|
|
'make_global_settings': [
|
|
|
|
['CC', '<(clang_dir)/bin/clang'],
|
|
|
|
['CXX', '<(clang_dir)/bin/clang++'],
|
2014-11-27 17:18:03 +00:00
|
|
|
['CC.host', '$(CC)'],
|
|
|
|
['CXX.host', '$(CXX)'],
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
['clang==1 and OS=="win"', {
|
|
|
|
'make_global_settings': [
|
|
|
|
# On Windows, gyp's ninja generator only looks at CC.
|
2015-01-22 07:21:35 +00:00
|
|
|
['CC', '../<(clang_dir)/bin/clang-cl'],
|
2014-11-27 17:18:03 +00:00
|
|
|
],
|
|
|
|
}],
|
2015-01-21 15:30:18 +00:00
|
|
|
# TODO(yyanagisawa): supports GENERATOR==make
|
|
|
|
# make generator doesn't support CC_wrapper without CC
|
|
|
|
# in make_global_settings yet.
|
|
|
|
['use_goma==1 and ("<(GENERATOR)"=="ninja" or clang==1)', {
|
|
|
|
'make_global_settings': [
|
|
|
|
['CC_wrapper', '<(gomadir)/gomacc'],
|
|
|
|
['CXX_wrapper', '<(gomadir)/gomacc'],
|
|
|
|
['CC.host_wrapper', '<(gomadir)/gomacc'],
|
|
|
|
['CXX.host_wrapper', '<(gomadir)/gomacc'],
|
|
|
|
],
|
|
|
|
}],
|
2011-08-25 14:50:09 +00:00
|
|
|
],
|
|
|
|
}
|