summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorrnk@chromium.org <rnk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-01 01:29:47 +0000
committerrnk@chromium.org <rnk@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-01 01:29:47 +0000
commita9318c70cad9cdf63b8a74511aa3d63a89d92fc6 (patch)
tree41081c8764747fe91d69b0abaebf2d25eefe34e2 /build
parent7fdf4eb7cd05b725d246ef8be99eb43784ed5ad3 (diff)
downloadchromium_src-a9318c70cad9cdf63b8a74511aa3d63a89d92fc6.zip
chromium_src-a9318c70cad9cdf63b8a74511aa3d63a89d92fc6.tar.gz
chromium_src-a9318c70cad9cdf63b8a74511aa3d63a89d92fc6.tar.bz2
Move the build config logic for our memory tools into common.gypi.
This change allows us to tweak these options without restarting the build masters and submit try jobs that tweak them. It also simplifies usage of these tools, because instead of copying and pasting a large block of gyp variables from tools/build/scripts/masters/factor/chromium_factory.py into GYP_DEFINES or .gyp/include.gyp, developers can simply set build_for_tool=mytool. My plan is to change the chromium.fyi master to use build_for_tool=* first, and revert if those bots break. If they stay green, I'll send a change to update chromium.memory.fyi and completely remove ChromiumFactory.MEMORY_TOOLS_GYP_DEFINES. I intend to remove all the otherwise unused (win_)(release|debug)_* options that we exposed later. This change is supposed to be the simplest thing that works. R=maruel@chromium.org,timurrrr@chromium.org BUG=109780 TEST=built with build_for_tool=drmemory locally Review URL: http://codereview.chromium.org/9516005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124323 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/common.gypi54
1 files changed, 54 insertions, 0 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 487ff93..60bd6df 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -274,6 +274,10 @@
# http://crbug.com/105550
'use_canvas_skia_skia%': 0,
+ # Set to "tsan", "memcheck", or "drmemory" to configure the build to work
+ # with one of those tools.
+ 'build_for_tool%': '',
+
'conditions': [
# TODO(epoger): Figure out how to set use_skia=1 for Mac outside of
# the 'conditions' clause. Initial attempts resulted in chromium and
@@ -955,7 +959,57 @@
# third_party/asan may be different from the default one.
'clang_use_chrome_plugins%': 0,
}],
+
+ # On valgrind bots, override the optimizer settings so we don't inline too
+ # much and make the stacks harder to figure out.
+ #
+ # TODO(rnk): Kill off variables that no one else uses and just implement
+ # them under a build_for_tool== condition.
+ ['build_for_tool=="memcheck" or build_for_tool=="tsan"', {
+ # gcc flags
+ 'mac_debug_optimization': '1',
+ 'mac_release_optimization': '1',
+ 'release_optimize': '1',
+ 'no_gc_sections': 1,
+ 'debug_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
+ '-fno-builtin -fno-optimize-sibling-calls',
+ 'release_extra_cflags': '-g -fno-inline -fno-omit-frame-pointer '
+ '-fno-builtin -fno-optimize-sibling-calls',
+
+ # MSVS flags for TSan on Pin and Windows.
+ 'win_debug_RuntimeChecks': '0',
+ 'win_debug_disable_iterator_debugging': '1',
+ 'win_debug_Optimization': '1',
+ 'win_debug_InlineFunctionExpansion': '0',
+ 'win_release_InlineFunctionExpansion': '0',
+ 'win_release_OmitFramePointers': '0',
+
+ 'linux_use_tcmalloc': 1,
+ 'release_valgrind_build': 1,
+ 'werror': '',
+ 'component': 'static_library',
+ 'use_system_zlib': 0,
+ }],
+
+ # Build tweaks for DrMemory.
+ # TODO(rnk): Combine with tsan config to share the builder.
+ # http://crbug.com/108155
+ ['build_for_tool=="drmemory"', {
+ # DrMemory can't handle the debug CRT dll, so build static.
+ 'component': 'static_library',
+ # These runtime checks force initialization of stack vars which blocks
+ # DrMemory's uninit detection.
+ 'win_debug_RuntimeChecks': '0',
+ # Iterator debugging is slow.
+ 'win_debug_disable_iterator_debugging': '1',
+ # Try to disable optimizations that mess up stacks in a release build.
+ 'win_release_InlineFunctionExpansion': '0',
+ 'win_release_OmitFramePointers': '0',
+ # Keep the code under #ifndef NVALGRIND.
+ 'release_valgrind_build': 1,
+ }],
],
+
# List of default apps to install in new profiles. The first list contains
# the source files as found in svn. The second list, used only for linux,
# contains the destination location for each of the files. When a crx