Page MenuHomePhabricator

[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

Unit TestsFailed

TimeTest
40 mslinux > Clang.Driver::cl-options.cu
Script: -- : 'RUN: at line 11'; /mnt/disks/ssd0/agent/llvm-project/build/bin/clang --driver-mode=cl -### -nocudalib -nocudainc -- /mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/cl-options.cu 2>&1 | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck -check-prefix=GS-default /mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/cl-options.cu
410 mslinux > HWAddressSanitizer-x86_64.TestCases::sizes.cpp
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/./bin/clang --driver-mode=g++ -m64 -gline-tables-only -fsanitize=hwaddress -fuse-ld=lld -mcmodel=large -mllvm -hwasan-globals -mllvm -hwasan-use-short-granules -mllvm -hwasan-instrument-landing-pads=0 -mllvm -hwasan-instrument-personality-functions /mnt/disks/ssd0/agent/llvm-project/compiler-rt/test/hwasan/TestCases/sizes.cpp -nostdlib++ -lstdc++ -o /mnt/disks/ssd0/agent/llvm-project/build/projects/compiler-rt/test/hwasan/X86_64/TestCases/Output/sizes.cpp.tmp