[clang][PowerPC] Enable -fstack-clash-protection option for ppc64

Differential Revision: https://reviews.llvm.org/D81355
This commit is contained in:
Kai Luo 2020-07-05 03:40:40 +00:00
parent afd81a637d
commit 68e07da3e5
4 changed files with 10 additions and 3 deletions

View File

@ -94,8 +94,8 @@ New Compiler Flags
------------------ ------------------
- -fstack-clash-protection will provide a protection against the stack clash - -fstack-clash-protection will provide a protection against the stack clash
attack for x86 and s390x architectures through automatic probing of each page attack for x86, s390x and ppc64 architectures through automatic probing of
of allocated stack. each page of allocated stack.
- -ffp-exception-behavior={ignore,maytrap,strict} allows the user to specify - -ffp-exception-behavior={ignore,maytrap,strict} allows the user to specify
the floating-point exception behavior. The default setting is ``ignore``. the floating-point exception behavior. The default setting is ``ignore``.

View File

@ -343,6 +343,10 @@ public:
const char *getFloat128Mangling() const override { return "u9__ieee128"; } const char *getFloat128Mangling() const override { return "u9__ieee128"; }
bool hasExtIntType() const override { return true; } bool hasExtIntType() const override { return true; }
bool isSPRegName(StringRef RegName) const override {
return RegName.equals("r1") || RegName.equals("x1");
}
}; };
class LLVM_LIBRARY_VISIBILITY PPC32TargetInfo : public PPCTargetInfo { class LLVM_LIBRARY_VISIBILITY PPC32TargetInfo : public PPCTargetInfo {

View File

@ -2966,7 +2966,8 @@ static void RenderSCPOptions(const ToolChain &TC, const ArgList &Args,
if (!EffectiveTriple.isOSLinux()) if (!EffectiveTriple.isOSLinux())
return; return;
if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ()) if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ() &&
!EffectiveTriple.isPPC64())
return; return;
if (Args.hasFlag(options::OPT_fstack_clash_protection, if (Args.hasFlag(options::OPT_fstack_clash_protection,

View File

@ -1,6 +1,8 @@
// Check the correct function attributes are generated // Check the correct function attributes are generated
// RUN: %clang_cc1 -triple x86_64-linux -O0 -S -emit-llvm -o- %s -fstack-clash-protection | FileCheck %s // RUN: %clang_cc1 -triple x86_64-linux -O0 -S -emit-llvm -o- %s -fstack-clash-protection | FileCheck %s
// RUN: %clang_cc1 -triple s390x-linux-gnu -O0 -S -emit-llvm -o- %s -fstack-clash-protection | FileCheck %s // RUN: %clang_cc1 -triple s390x-linux-gnu -O0 -S -emit-llvm -o- %s -fstack-clash-protection | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64le-linux-gnu -O0 -S -emit-llvm -o- %s -fstack-clash-protection | FileCheck %s
// RUN: %clang_cc1 -triple powerpc64-linux-gnu -O0 -S -emit-llvm -o- %s -fstack-clash-protection | FileCheck %s
// CHECK: define void @large_stack() #[[A:.*]] { // CHECK: define void @large_stack() #[[A:.*]] {
void large_stack() { void large_stack() {