Skip to content

Commit 529b222

Browse files
davidbolvanskyzmodem
authored andcommitted
[Driver] Change -fnostack-clash-protection to -fno-stack-clash-protection
Clang command line docs mention `-fno-stack-clash-protection`, and GCC also uses -fno-stack-clash-protection. Fixes PR47139 Reviewed By: tstellar Differential Revision: https://reviews.llvm.org/D85844 (cherry picked from commit df3bfaa)
1 parent 844f018 commit 529b222

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1780,7 +1780,7 @@ def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group<f_Group>,
17801780
HelpText<"Enable stack protectors for all functions">;
17811781
def fstack_clash_protection : Flag<["-"], "fstack-clash-protection">, Group<f_Group>, Flags<[CC1Option]>,
17821782
HelpText<"Enable stack clash protection">;
1783-
def fnostack_clash_protection : Flag<["-"], "fnostack-clash-protection">, Group<f_Group>,
1783+
def fno_stack_clash_protection : Flag<["-"], "fno-stack-clash-protection">, Group<f_Group>,
17841784
HelpText<"Disable stack clash protection">;
17851785
def fstack_protector_strong : Flag<["-"], "fstack-protector-strong">, Group<f_Group>,
17861786
HelpText<"Enable stack protectors for some functions vulnerable to stack smashing. "

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2971,7 +2971,7 @@ static void RenderSCPOptions(const ToolChain &TC, const ArgList &Args,
29712971
return;
29722972

29732973
if (Args.hasFlag(options::OPT_fstack_clash_protection,
2974-
options::OPT_fnostack_clash_protection, false))
2974+
options::OPT_fno_stack_clash_protection, false))
29752975
CmdArgs.push_back("-fstack-clash-protection");
29762976
}
29772977

clang/test/Driver/stack-clash-protection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %clang -target i386-unknown-linux -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-i386
2-
// RUN: %clang -target i386-unknown-linux -fnostack-clash-protection -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-i386
3-
// RUN: %clang -target i386-unknown-linux -fstack-clash-protection -fnostack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-i386-NO
2+
// RUN: %clang -target i386-unknown-linux -fno-stack-clash-protection -fstack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-i386
3+
// RUN: %clang -target i386-unknown-linux -fstack-clash-protection -fno-stack-clash-protection -### %s 2>&1 | FileCheck %s -check-prefix=SCP-i386-NO
44
// SCP-i386: "-fstack-clash-protection"
55
// SCP-i386-NO-NOT: "-fstack-clash-protection"
66

0 commit comments

Comments
 (0)