Page MenuHomePhabricator

[Driver] specify -stack-protector 0 for -fno-stack-protector
AbandonedPublic

Authored by nickdesaulniers on Oct 28 2020, 3:37 PM.

Details

Reviewers
void
manojgupta
Summary

-fno-stack-protector now explicitly sets -stack-protector 0 for the
invocation of cc1. In turn, -stack-protector 0 will set nossp IR fn attr
on all functions defined in the translation unit.

Fixes pr/47479.

Diff Detail

Unit TestsFailed

TimeTest
430 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

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2020, 3:37 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
nickdesaulniers requested review of this revision.Oct 28 2020, 3:37 PM

Might be nice to add an integration test where -fno-stack-protector results in nossp function attributes (so -fno-stack-protector -> -stack-protector 0 -> nossp fn attrs).

Might be nice to add an integration test where -fno-stack-protector results in nossp function attributes (so -fno-stack-protector -> -stack-protector 0 -> nossp fn attrs).

Oh, this is covered somewhat by clang/test/CodeGen/stack-protector.c which was updated in parent commit D90194.

Bumping for review