From 1eca8b6a6e3801268d14dc3ac1a96ed0d30571d3 Mon Sep 17 00:00:00 2001 From: "keescook@google.com" Date: Fri, 1 Feb 2013 05:47:17 +0000 Subject: [PATCH] gyp: do not force stack protector on Chrome OS The Chrome OS builds already use -fstack-protector-strong. Adding additional -fstack-protector arguments means that the last one seen on the commandline is used. This has caused a regression in the stack-protector features, so avoid stack-protector on Chrome OS. BUG=chromium-os:38354 TEST=link build Review URL: https://chromiumcodereview.appspot.com/12095046 git-svn-id: http://src.chromium.org/svn/trunk/src/build@180088 4ff67af0-8c30-449e-8e8b-ad334ec8d88c --- common.gypi | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/common.gypi b/common.gypi index ae9e34cfc..c76cc1da4 100644 --- a/common.gypi +++ b/common.gypi @@ -2402,18 +2402,25 @@ 'conditions': [ ['os_posix==1', { 'target_defaults': { - 'cflags': [ - # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc - # supports it. - '-fstack-protector', - '--param=ssp-buffer-size=4', - ], 'ldflags': [ '-Wl,-z,now', '-Wl,-z,relro', ], }, }], + ['os_posix==1 and chromeos==0', { + # Chrome OS enables -fstack-protector-strong via its build wrapper, + # 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. + 'target_defaults': { + 'cflags': [ + '-fstack-protector', + '--param=ssp-buffer-size=4', + ], + }, + }], ['os_posix==1 and OS!="mac" and OS!="ios"', { 'target_defaults': { # Enable -Werror by default, but put it in a variable so it can