Mmm, pie.
Enable position independence by linking executables with the -pie linker flag. This was previously done in r29592, but had to be backed out in r29604 because Valgrind didn't understand slide. I don't know if Valgrind understands slide or not on Mac OS X now, but for the time being, we'll do this in non-Valgrind build configurations. Position independence turns on address space layout randomization (ASLR). No perf impact expected. We don't really have any significant quantity of exported symbols for the loader to chew on. BUG=16713 TEST=Everything should still work Review URL: http://codereview.chromium.org/7291012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91243 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@ -1538,6 +1538,19 @@
|
||||
['_mac_bundle', {
|
||||
'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
|
||||
}],
|
||||
['_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)
|
||||
],
|
||||
},
|
||||
}],
|
||||
['(_type=="executable" or _type=="shared_library" or \
|
||||
_type=="loadable_module") and mac_strip!=0', {
|
||||
'target_conditions': [
|
||||
|
Reference in New Issue
Block a user