[clang] f96fef8 - [Driver] Default Generic_GCC aarch64 to -fasynchronous-unwind-tables

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 09:51:39 PST 2020


Author: Fangrui Song
Date: 2020-11-24T09:51:32-08:00
New Revision: f96fef89b5eca29f2dc41e97829c20bf742cdcd9

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

LOG: [Driver] Default Generic_GCC aarch64 to -fasynchronous-unwind-tables

In GCC, `aarch64-*-linux` and `aarch64-*-freebsd` made the switch in 2018
(https://gcc.gnu.org/pipermail/gcc-patches/2018-March/495549.html).
In Clang, FreeBSD/Fuchsia/NetBSD/MinGW aarch64 default to -fasynchronous-unwind-tables.

This patch defaults Generic_GCC aarch64 (which affects Linux) to use -fasynchronous-unwind-tables.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D91760

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Gnu.cpp
    clang/test/Driver/aarch64-features.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 7d75e90c6092..08158ba4bae8 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2672,7 +2672,13 @@ void Generic_GCC::printVerboseInfo(raw_ostream &OS) const {
 }
 
 bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const {
-  return getArch() == llvm::Triple::x86_64;
+  switch (getArch()) {
+  case llvm::Triple::aarch64:
+  case llvm::Triple::x86_64:
+    return true;
+  default:
+    return false;
+  }
 }
 
 bool Generic_GCC::isPICDefault() const {

diff  --git a/clang/test/Driver/aarch64-features.c b/clang/test/Driver/aarch64-features.c
index 7c3f8754049a..8d8cc3c68afe 100644
--- a/clang/test/Driver/aarch64-features.c
+++ b/clang/test/Driver/aarch64-features.c
@@ -1,6 +1,8 @@
 // RUN: %clang -target aarch64-none-linux-gnu -### %s -fsyntax-only 2>&1 | FileCheck %s
 // RUN: %clang -target arm64-none-linux-gnu -### %s -fsyntax-only 2>&1 | FileCheck %s
 
+// CHECK: "-munwind-tables"
+
 // The AArch64 PCS states that chars should be unsigned.
 // CHECK: fno-signed-char
 


        


More information about the cfe-commits mailing list