diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-04-11 22:27:55 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2016-04-11 22:27:55 +0000 |
commit | 368d3074ba4993408825ef563fe5b8198a34077b (patch) | |
tree | 0a4203d97a2d5ced68c57938a758665f8480af91 /clang/lib/Driver/Tools.cpp | |
parent | f17120a85ff619f2420a6b86a05bed5c5d816353 (diff) | |
download | bcm5719-llvm-368d3074ba4993408825ef563fe5b8198a34077b.tar.gz bcm5719-llvm-368d3074ba4993408825ef563fe5b8198a34077b.zip |
Allow simultaneous safestack and stackprotector attributes.
This is the clang part of http://reviews.llvm.org/D18846.
SafeStack instrumentation pass adds stack protector canaries if both
attributes are present on a function. StackProtector pass will step
back if the function has a safestack attribute.
llvm-svn: 266005
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index a585918aa28..9fbb12c089c 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -4878,15 +4878,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // -stack-protector=0 is default. unsigned StackProtectorLevel = 0; - if (getToolChain().getSanitizerArgs().needsSafeStackRt()) { - Args.ClaimAllArgs(options::OPT_fno_stack_protector); - Args.ClaimAllArgs(options::OPT_fstack_protector_all); - Args.ClaimAllArgs(options::OPT_fstack_protector_strong); - Args.ClaimAllArgs(options::OPT_fstack_protector); - } else if (Arg *A = Args.getLastArg(options::OPT_fno_stack_protector, - options::OPT_fstack_protector_all, - options::OPT_fstack_protector_strong, - options::OPT_fstack_protector)) { + if (Arg *A = Args.getLastArg(options::OPT_fno_stack_protector, + options::OPT_fstack_protector_all, + options::OPT_fstack_protector_strong, + options::OPT_fstack_protector)) { if (A->getOption().matches(options::OPT_fstack_protector)) { StackProtectorLevel = std::max<unsigned>( LangOptions::SSPOn, |