[llvm-branch-commits] [llvm] 00065d5 - Revert "-fstack-clash-protection: Return an actual error when used on unsupported OS"

Nico Weber via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 22 03:56:30 PST 2020


Author: Nico Weber
Date: 2020-12-22T06:51:19-05:00
New Revision: 00065d5cbd02b0f3fccb34881b58bcd0852b3970

URL: https://github.com/llvm/llvm-project/commit/00065d5cbd02b0f3fccb34881b58bcd0852b3970
DIFF: https://github.com/llvm/llvm-project/commit/00065d5cbd02b0f3fccb34881b58bcd0852b3970.diff

LOG: Revert "-fstack-clash-protection: Return an actual error when used on unsupported OS"

This reverts commit 4d59c8fdb955ea0d668b854f467e12bce05a8857.
Breaks tens of thousands of tests, and had pending review comments, see
comments on https://reviews.llvm.org/D92245 (and e.g.
http://lab.llvm.org:8011/#/builders/109/builds/5236 for failures).

Added: 
    

Modified: 
    clang/include/clang/Basic/DiagnosticDriverKinds.td
    clang/lib/Driver/ToolChains/Clang.cpp
    llvm/test/CodeGen/X86/stack-clash-large.ll

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td
index 736950b0abb1..e92a4bf1dac5 100644
--- a/clang/include/clang/Basic/DiagnosticDriverKinds.td
+++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td
@@ -273,8 +273,6 @@ def err_drv_unsupported_embed_bitcode
     : Error<"%0 is not supported with -fembed-bitcode">;
 def err_drv_bitcode_unsupported_on_toolchain : Error<
   "-fembed-bitcode is not supported on versions of iOS prior to 6.0">;
-def err_drv_stack_clash_protection_unsupported_on_toolchain : Error<
-  "-fstack-clash-protection is not supported on %0">;
 
 def err_drv_invalid_malign_branch_EQ : Error<
   "invalid argument '%0' to -malign-branch=; each element must be one of: %1">;

diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index c04b350dae7d..300ab6e815e2 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -3067,15 +3067,12 @@ static void RenderSSPOptions(const Driver &D, const ToolChain &TC,
   }
 }
 
-static void RenderSCPOptions(const Driver &D, const ToolChain &TC,
-                             const ArgList &Args, ArgStringList &CmdArgs) {
+static void RenderSCPOptions(const ToolChain &TC, const ArgList &Args,
+                             ArgStringList &CmdArgs) {
   const llvm::Triple &EffectiveTriple = TC.getEffectiveTriple();
 
-  if (EffectiveTriple.isOSWindows()) {
-    D.Diag(diag::err_drv_stack_clash_protection_unsupported_on_toolchain)
-        << EffectiveTriple.getOSName();
+  if (!EffectiveTriple.isOSLinux())
     return;
-  }
 
   if (!EffectiveTriple.isX86() && !EffectiveTriple.isSystemZ() &&
       !EffectiveTriple.isPPC64())
@@ -5553,7 +5550,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back(Args.MakeArgString("-mspeculative-load-hardening"));
 
   RenderSSPOptions(D, TC, Args, CmdArgs, KernelOrKext);
-  RenderSCPOptions(D, TC, Args, CmdArgs);
+  RenderSCPOptions(TC, Args, CmdArgs);
   RenderTrivialAutoVarInitOptions(D, TC, Args, CmdArgs);
 
   // Translate -mstackrealign

diff  --git a/llvm/test/CodeGen/X86/stack-clash-large.ll b/llvm/test/CodeGen/X86/stack-clash-large.ll
index 7deae310f617..dd53cd8f6964 100644
--- a/llvm/test/CodeGen/X86/stack-clash-large.ll
+++ b/llvm/test/CodeGen/X86/stack-clash-large.ll
@@ -1,7 +1,5 @@
 ; RUN: llc -mtriple=x86_64-linux-android < %s | FileCheck -check-prefix=CHECK-X86-64 %s 
 ; RUN: llc -mtriple=i686-linux-android < %s | FileCheck -check-prefix=CHECK-X86-32 %s 
-; RUN: llc -mtriple=x86_64-unknown-freebsd < %s | FileCheck -check-prefix=CHECK-X86-64 %s
-; RUN: llc -mtriple=x86_64-pc-linux-gnu < %s | FileCheck -check-prefix=CHECK-X86-64 %s
 
 define i32 @foo() local_unnamed_addr #0 {
 


        


More information about the llvm-branch-commits mailing list