[PATCH] D91760: [Driver] Default Generic_GCC aarch64 to use -fasynchronous-unwind-tables
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 18 21:22:19 PST 2020
MaskRay created this revision.
MaskRay added reviewers: joerg, psmith, resistor.
Herald added subscribers: cfe-commits, danielkiss, mstorsjo, kristof.beyls, krytarowski, arichardson, emaste.
Herald added a project: clang.
MaskRay requested review of this revision.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D91760
Files:
clang/lib/Driver/ToolChains/Gnu.cpp
clang/test/Driver/aarch64-features.c
Index: clang/test/Driver/aarch64-features.c
===================================================================
--- clang/test/Driver/aarch64-features.c
+++ 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
Index: clang/lib/Driver/ToolChains/Gnu.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2672,7 +2672,14 @@
}
bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const {
- return getArch() == llvm::Triple::x86_64;
+ switch (getArch()) {
+ case llvm::Triple::aarch64:
+ return !getTriple().isOSNetBSD();
+ case llvm::Triple::x86_64:
+ return true;
+ default:
+ return false;
+ }
}
bool Generic_GCC::isPICDefault() const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91760.306298.patch
Type: text/x-patch
Size: 1065 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20201119/64ac064c/attachment-0001.bin>
More information about the cfe-commits
mailing list