diff --git a/common.gypi b/common.gypi index 1d69c5182..c81899ec9 100644 --- a/common.gypi +++ b/common.gypi @@ -3375,7 +3375,7 @@ ['release_valgrind_build==0', { 'xcode_settings': { 'OTHER_CFLAGS': [ - '-fstack-protector-all', # Implies -fstack-protector + '-fstack-protector-strong', # Implies -fstack-protector ], }, }], @@ -3593,7 +3593,7 @@ # and we want to avoid overriding this, so stack-protector is only # enabled when not building on Chrome OS. # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc - # supports it. + # supports it. See also https://crbug.com/533294 'target_defaults': { 'cflags': [ '-fstack-protector', diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn index ea5401a39..65cf23637 100644 --- a/config/compiler/BUILD.gn +++ b/config/compiler/BUILD.gn @@ -191,9 +191,10 @@ config("compiler") { # Stack protection. if (is_mac) { - cflags += [ "-fstack-protector-all" ] + cflags += [ "-fstack-protector-strong" ] } else if (is_posix && !is_chromeos && !is_nacl) { # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc supports it. + # See also https://crbug.com/533294 cflags += [ "--param=ssp-buffer-size=4" ] # The x86 toolchain currently has problems with stack-protector.