On Fri, Apr 12, 2013 at 10:43 AM, Andrew Hsieh <andrewhs...@google.com> wrote: > Introduced TARGET_SSP_GLOBAL_GUARD and TARGET_SSP_TLS_GUARD as suggested. > As for handling default in ix86_option_override_internal, is it > possible to achieve the same "default to SSP_GLOBAL if bionic" > entirely in i386.opt?
No, AFAIK option system won't dynamically initialize a variable. +mstack-protector-guard= +Target RejectNegative Joined Enum(stack_protector_guard) Var(ix86_stack_protector_ guard) Init(SSP_TLS) +Use given stack-protector guard So, you don't need Init in the code above ... > + > + /* Handle stack protector */ > + if (!global_options_set.x_ix86_stack_protector_guard) > + { > + ix86_stack_protector_guard = TARGET_HAS_BIONIC? SSP_GLOBAL : SSP_TLS; > + } ... since you initialize it here. Please, remove the braces here. Also, as Jakub said, please also update the comment for 32bit case. The patch is OK with these changes. Thanks, Uros.