Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2133)

Unified Diff: build/common.gypi

Issue 9169020: Fix ASLR Windows build configuration (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: only set aslr for libraries Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index 9c1d9dbdd965d46f33e2e23d43d382ac138320c9..2f58269363519fb7833645727709047d15c67da4 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -965,7 +965,7 @@
# See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
# Tri-state: blank is default, 1 on, 0 off
- 'win_release_OmitFramePointers%': '1',
+ 'win_release_OmitFramePointers%': 1,
# Tri-state: blank is default, 1 on, 0 off
'win_debug_OmitFramePointers%': '',
@@ -983,6 +983,11 @@
# See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
'win_debug_disable_iterator_debugging%': '0',
+ # Tri-state: blank is VS default, 1 on, 0 off
+ 'win_release_RandomizedBaseAddress%': '',
+ # Tri-state: blank is VS default, 1 on, 0 off. Off by default: see below.
+ 'win_debug_RandomizedBaseAddress%': 0,
+
'release_extra_cflags%': '',
'debug_extra_cflags%': '',
'release_valgrind_build%': 0,
@@ -1517,15 +1522,32 @@
},
'VCLinkerTool': {
'LinkIncremental': '<(msvs_debug_link_incremental)',
- # ASLR makes debugging with windbg difficult because Chrome.exe and
- # Chrome.dll share the same base name. As result, windbg will
- # name the Chrome.dll module like chrome_<base address>, where
- # <base address> typically changes with each launch. This in turn
- # means that breakpoints in Chrome.dll don't stick from one launch
- # to the next. For this reason, we turn ASLR off in debug builds.
- # Note that this is a three-way bool, where 0 means to pick up
- # the default setting, 1 is off and 2 is on.
- 'RandomizedBaseAddress': 1,
+ 'conditions': [
+ # ASLR makes debugging with windbg difficult because Chrome.exe
+ # and Chrome.dll share the same base name. As result, windbg will
+ # name the Chrome.dll module like chrome_<base address>, where
+ # <base address> typically changes with each launch. This in turn
+ # means that breakpoints in Chrome.dll don't stick from one launch
+ # to the next. For this reason, we turn ASLR off in debug builds.
+ # Note that this is a three-way bool, where 0 means to pick up
+ # the default setting, 1 is off and 2 is on.
+ # Also note that an explicit /dynamicbase linker flag will
+ # override this setting.
+
+ # If win_debug_RandomizedBaseAddress is blank, leave as default
+ # (that's VS default: off for VS2008, on for VS2010).
+ ['win_debug_RandomizedBaseAddress==1', {
+ # No ASLR for executables or static libraries
+ 'target_conditions': [
+ ['_type=="shared_library" or _type=="loadable_module"', {
+ 'RandomizedBaseAddress': 2,
+ }],
+ ],
+ }],
+ ['win_debug_RandomizedBaseAddress==0', {
+ 'RandomizedBaseAddress': 1,
+ }],
+ ],
},
'VCResourceCompilerTool': {
'PreprocessorDefinitions': ['_DEBUG'],
@@ -1604,6 +1626,21 @@
# information is used by the Syzygy optimization tool when
# decomposing the release image.
'Profile': 'true',
+ 'conditions': [
+ # If win_release_RandomizedBaseAddress is blank, leave as default.
+ # For RandomizedBaseAddress: 0=default, 1=off, 2=on
+ ['win_release_RandomizedBaseAddress==1', {
+ # No ASLR for executables or static libraries
+ 'target_conditions': [
+ ['_type=="shared_library" or _type=="loadable_module"', {
+ 'RandomizedBaseAddress': 2,
+ }],
+ ],
+ }],
+ ['win_release_RandomizedBaseAddress==0', {
+ 'RandomizedBaseAddress': 1,
+ }],
+ ],
},
},
'conditions': [
@@ -2745,7 +2782,6 @@
'VCLinkerTool': {
'AdditionalOptions': [
'/safeseh',
- '/dynamicbase',
'/ignore:4199',
'/ignore:4221',
'/nxcompat',
@@ -2758,7 +2794,6 @@
'VCLinkerTool': {
'AdditionalOptions': [
# safeseh is not compatible with x64
- '/dynamicbase',
'/ignore:4199',
'/ignore:4221',
'/nxcompat',
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698