diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-01 00:34:46 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-01 00:34:46 +0000 |
commit | 6a0242bc0fa4c8b9263f386111d9ce9ae27a541a (patch) | |
tree | 9694d5b65454b63f9c45b88ec27a8ab460cc031b | |
parent | 90144439183d7a6d2ebdefd90c6bec1e4e8dda17 (diff) | |
download | chromium_src-6a0242bc0fa4c8b9263f386111d9ce9ae27a541a.zip chromium_src-6a0242bc0fa4c8b9263f386111d9ce9ae27a541a.tar.gz chromium_src-6a0242bc0fa4c8b9263f386111d9ce9ae27a541a.tar.bz2 |
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
-rw-r--r-- | build/common.gypi | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/build/common.gypi b/build/common.gypi index 51d2ebe..8fdcf69 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -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': [ |