This is an archive of the discontinued LLVM Phabricator instance.

[Clang][Driver] default to nossp
AbandonedPublic

Authored by nickdesaulniers on Nov 5 2020, 5:33 PM.

Details

Reviewers
void
rnk
Summary

This patch does 2 things:

  1. the default value of StackProtectorMode, StackProtectorMode::SSPOff now explicitly adds the nossp LLVM IR fn attr.
  2. it makes -fno-stack-protector/\GS_ now explictly pass -stack-protector 0 to cc1, which sets the StackProtectorMode to StackProtectorMode::SSPOff.

This allows safer mixing of translation units compiled with
-fno-stack-protector and -fstack-protector* for LTO, since LLVM IR fn
attr nossp will prevent inlining across the two.

Fixes pr/47479.

Alternative to D90194+D90348.

Diff Detail