[cfe-dev] Stack Protectors

Bill Wendling wendling at apple.com
Sat Jun 27 18:41:42 PDT 2009


On Jun 27, 2009, at 6:33 PM, Eric Christopher wrote:

>
> On Jun 27, 2009, at 6:16 PM, Bill Wendling wrote:
>
>> <clang-ssp.patch>
>
>   // Blocks default to on for 10.6 (darwin10) and beyond.
>   // As does nonfragile-abi for 64bit mode
> -  if (Maj > 9)
> +  if (Maj > 9) {
>     Opts.Blocks = 1;
> +    Opts.StackProtector = 1;
> +  }
>
>
> Might want to update the comment, replace it with a list or  
> something :)
>
I updated them to this:

   // Blocks and stack protectors default to on for 10.6 (darwin10)  
and beyond.
   if (Maj > 9) {
     Opts.Blocks = 1;
     Opts.StackProtector = 1;
   }

   // Non-fragile ABI (in 64-bit mode) default to on for 10.5  
(darwin9) and
   // beyond.
   if (Maj >= 9 && Opts.ObjC1 && !strncmp(Triple, "x86_64", 6))
     Opts.ObjCNonFragileABI = 1;


> Otherwise looks pretty good to me. Not that I'm a clang reviewer or  
> anything though :)
>
Thanks for the initial review at least! :-)

-bw



More information about the cfe-dev mailing list