diff options
-rw-r--r-- | breakpad/breakpad.gyp | 6 | ||||
-rw-r--r-- | build/common.gypi | 50 |
2 files changed, 33 insertions, 23 deletions
diff --git a/breakpad/breakpad.gyp b/breakpad/breakpad.gyp index 98d36e5..d9832a1 100644 --- a/breakpad/breakpad.gyp +++ b/breakpad/breakpad.gyp @@ -104,6 +104,12 @@ { 'target_name': 'dump_syms', 'type': 'executable', + 'variables': { + # Turn off PIE because it may interfere with dump_syms' ability to + # allocate a contiguous region in memory large enough to mmap the + # entire unstripped framework in a 32-bit dump_syms process. + 'mac_pie': 0, + }, 'include_dirs++': [ # ++ ensures this comes before src brought in from target_defaults. 'pending/src', diff --git a/build/common.gypi b/build/common.gypi index 0a8d7ba..bebff1a 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -1622,11 +1622,12 @@ ['OS=="mac"', { 'target_defaults': { 'variables': { - # These should be 'mac_real_dsym%' and 'mac_strip%', but there - # seems to be a bug with % in variables that are intended to be - # set to different values in different targets, like these two. - 'mac_strip': 1, # Strip debugging symbols from the target. + # These should end with %, but there seems to be a bug with % in + # variables that are intended to be set to different values in + # different targets, like these. + 'mac_pie': 1, # Most executables can be position-independent. 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases. + 'mac_strip': 1, # Strip debugging symbols from the target. }, 'mac_bundle': 0, 'xcode_settings': { @@ -1725,15 +1726,16 @@ # relativization during dict merging. 'change_mach_o_flags_path': 'mac/change_mach_o_flags_from_xcode.sh', - 'change_mach_o_flags_options': [ + 'change_mach_o_flags_options%': [ ], 'target_conditions': [ - ['release_valgrind_build==1', { + ['mac_pie==0 or release_valgrind_build==1', { + # Don't enable PIE if it's unwanted. It's unwanted if + # the target specifies mac_pie=0 or if building for + # Valgrind, because Valgrind doesn't understand slide. + # See the similar mac_pie/release_valgrind_build check + # below. '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', ], }], @@ -1756,19 +1758,21 @@ }, }], ], - }], - ['_type=="executable" and release_valgrind_build==0', { - # Turn on position-independence (ASLR) for executables. When PIE - # is on for the Chrome executables, the framework will also be - # subject to ASLR. - # Don't do this 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. - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - '-Wl,-pie', # Position-independent executable (MH_PIE) - ], - }, + 'target_conditions': [ + ['mac_pie==1 and release_valgrind_build==0', { + # Turn on position-independence (ASLR) for executables. When + # PIE is on for the Chrome executables, the framework will + # also be subject to ASLR. + # Don't do this 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. + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-Wl,-pie', # Position-independent executable (MH_PIE) + ], + }, + }], + ], }], ['(_type=="executable" or _type=="shared_library" or \ _type=="loadable_module") and mac_strip!=0', { |