Only enable -funwind-tables by default on Fedora arches

.eh_frame sections confuse bpf tools, so -funwind-tables  shouldn't be enabled there.
There are other non-CPU arches where this could potentially cause problems, so be
conservative and only enable this on CPU arches supported by Fedora.

Resolves: rhbz#1970463
This commit is contained in:
Tom Stellard 2021-06-08 17:34:28 +00:00
parent 941ef08c01
commit f94e02e6ae
2 changed files with 20 additions and 28 deletions

View File

@ -1,40 +1,29 @@
From 07b062e1f7c3359550aa8c0a7b86f6054971439d Mon Sep 17 00:00:00 2001
From c87abee7356b8fde81512ffceadd520776c465d2 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Thu, 25 Feb 2021 14:09:29 +0100
Subject: [PATCH 2/6] [PATCH][clang] Make -funwind-tables the default on all
archs
Subject: [PATCH] [PATCH][clang] Make -funwind-tables the default on all archs
---
clang/lib/Driver/ToolChain.cpp | 2 +-
clang/lib/Driver/ToolChains/Gnu.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
clang/lib/Driver/ToolChains/Gnu.cpp | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index b2ddef1..715b323 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -257,7 +257,7 @@ std::string ToolChain::getInputFilename(const InputInfo &Input) const {
}
bool ToolChain::IsUnwindTablesDefault(const ArgList &Args) const {
- return false;
+ return true;
}
Tool *ToolChain::getClang() const {
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index 1d8a3cd..5deeb10 100644
index a27841dc5985..7489e6785150 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2713,7 +2713,7 @@ bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const {
@@ -2709,6 +2709,12 @@ bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const {
case llvm::Triple::ppc64:
case llvm::Triple::ppc64le:
case llvm::Triple::x86_64:
+
+ // Enable -funwind-tables on all architectures supported by Fedora:
+ // rhbz#1655546
+ case llvm::Triple::x86:
+ case llvm::Triple::systemz:
+ case llvm::Triple::arm:
return true;
default:
- return false;
+ return true;
}
}
return false;
--
1.8.3.1
2.27.0

View File

@ -78,7 +78,7 @@
Name: %pkg_name
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}
Release: 3%{?dist}
Release: 4%{?dist}
Summary: A C language family front-end for LLVM
License: NCSA
@ -588,6 +588,9 @@ false
%endif
%changelog
* Tue Jun 08 2021 Tom Stellard <tstellar@redhat.com> - 12.0.0-4
- Only enable -funwind-tables by default on Fedora arches
* Fri May 14 2021 Tom Stellard <tstellar@redhat.com> - 12.0.0-3
- Reduce number of ninja jobs on aarch64