Turn off PIE when building for Valgrind.

BUG=90221, 93551
TEST=Valgrind
Review URL: http://codereview.chromium.org/7724002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98046 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/build/common.gypi b/build/common.gypi
index b6b179a..c8c37bd 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -1688,10 +1688,24 @@
                   # relativization during dict merging.
                   'change_mach_o_flags_path':
                       'mac/change_mach_o_flags_from_xcode.sh',
+                  'change_mach_o_flags_options': [
+                  ],
+                  'target_conditions': [
+                    ['release_valgrind_build==1', {
+                      'change_mach_o_flags_options': [
+                        # Turn off PIE when building for Valgrind because
+                        # Valgrind doesn't understand slide. TODO: Make
+                        # Valgrind on Mac OS X understand slide, and get rid
+                        # of the Valgrind check.
+                        '--no-pie',
+                      ],
+                    }],
+                  ],
                 },
                 'postbuild_name': 'Change Mach-O Flags',
                 'action': [
                   '<(change_mach_o_flags_path)',
+                  '>@(change_mach_o_flags_options)',
                 ],
               },
             ],