Skip to content

Commit 6bbb04a

Browse files
committed
[Driver] Default Generic_GCC ppc/ppc64/ppc64le to -fasynchronous-unwind-tables
GCC made the switch on 2018-04-10 ("rs6000: Enable -fasynchronous-unwind-tables by default"). In Clang, FreeBSD/NetBSD powerpc have already defaulted to -fasynchronous-unwind-tables. This patch defaults Generic_GCC powerpc (which affects Linux) to use -fasynchronous-unwind-tables. Reviewed By: #powerpc, nemanjai Differential Revision: https://reviews.llvm.org/D92054
1 parent 7f40bb3 commit 6bbb04a

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ Modified Compiler Flags
118118
`-fno-delete-null-pointer-checks` has gained the power to remove the
119119
`nonnull` attribute on `this` for configurations that need it to be nullable.
120120
- ``-gsplit-dwarf`` no longer implies ``-g2``.
121+
- ``-fasynchronous-unwind-tables`` is now the default on Linux AArch64/PowerPC.
122+
This behavior matches newer GCC.
123+
(`D91760 <https://reviews.llvm.org/D91760>`_)
124+
(`D92054 <https://reviews.llvm.org/D92054>`_)
121125

122126
Removed Compiler Flags
123127
-------------------------

clang/lib/Driver/ToolChains/Gnu.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2674,6 +2674,9 @@ void Generic_GCC::printVerboseInfo(raw_ostream &OS) const {
26742674
bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const {
26752675
switch (getArch()) {
26762676
case llvm::Triple::aarch64:
2677+
case llvm::Triple::ppc:
2678+
case llvm::Triple::ppc64:
2679+
case llvm::Triple::ppc64le:
26772680
case llvm::Triple::x86_64:
26782681
return true;
26792682
default:

clang/test/Driver/ppc-features.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/// Check default CC1 and linker options for ppc32.
22
// RUN: %clang -### -target powerpc-unknown-linux-gnu %s 2>&1 | FileCheck --check-prefix=PPC32 %s
3-
// PPC32: "-mfloat-abi" "hard"
3+
// PPC32: "-munwind-tables"
4+
// PPC32-SAME: "-mfloat-abi" "hard"
45

56
// PPC32: "-m" "elf32ppclinux"
67

@@ -38,11 +39,12 @@
3839

3940

4041
/// Check default CC1 and linker options for ppc64.
41-
// RUN: %clang -### -target powerpc64le-unknown-linux-gnu %s 2>&1 | FileCheck --check-prefix=PPC64 %s
42-
// RUN: %clang -### -target powerpc64-unknown-linux-gnu %s 2>&1 | FileCheck -check-prefix=PPC64BE %s
43-
// PPC64: "-mfloat-abi" "hard"
42+
// RUN: %clang -### -target powerpc64le-unknown-linux-gnu %s 2>&1 | FileCheck --check-prefixes=PPC64,PPC64LE %s
43+
// RUN: %clang -### -target powerpc64-unknown-linux-gnu %s 2>&1 | FileCheck --check-prefixes=PPC64,PPC64BE %s
44+
// PPC64: "-munwind-tables"
45+
// PPC64-SAME: "-mfloat-abi" "hard"
4446

45-
// PPC64: "-m" "elf64lppc"
47+
// PPC64LE: "-m" "elf64lppc"
4648
// PPC64BE: "-m" "elf64ppc"
4749

4850
// check -msoft-float option for ppc64

0 commit comments

Comments
 (0)