set CLANG_DEFAULT_UNWIND_LIB instead of using custom patch

And add the clang/toolchains test so we don't regress
This commit is contained in:
Timm Bäder 2021-02-12 12:01:30 +01:00
parent 6fb3a469a9
commit 283f2301df
3 changed files with 9 additions and 56 deletions

View File

@ -1,51 +0,0 @@
From 27000b14439d22145487f55f8a85eb5f8cc98e30 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Thu, 25 Feb 2021 14:08:28 +0100
Subject: [PATCH 2/6] [PATCH][clang] ToolChain: Add -lgcc_s to the linker flags
when using libc++
The libc++ build for Fedora does not include an implementation of
libunwind, so we need to explicitly link against something that
provides this implementation.
---
clang/lib/Driver/ToolChain.cpp | 1 +
clang/test/Driver/netbsd.cpp | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp
index b2ddef1..c4c71e1 100644
--- a/clang/lib/Driver/ToolChain.cpp
+++ b/clang/lib/Driver/ToolChain.cpp
@@ -1014,6 +1014,7 @@ void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
switch (Type) {
case ToolChain::CST_Libcxx:
CmdArgs.push_back("-lc++");
+ CmdArgs.push_back("-lgcc_s");
break;
case ToolChain::CST_Libstdcxx:
diff --git a/clang/test/Driver/netbsd.cpp b/clang/test/Driver/netbsd.cpp
index 4af7d83..ff18c62 100644
--- a/clang/test/Driver/netbsd.cpp
+++ b/clang/test/Driver/netbsd.cpp
@@ -131,7 +131,7 @@
// ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd7.0.0-eabi"
// ARM-7: ld{{.*}}" "--eh-frame-hdr" "-dynamic-linker" "/libexec/ld.elf_so"
// ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
-// ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" "-lm" "-lc"
+// ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" "-lgcc_s" "-lm" "-lc"
// ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd"
@@ -250,7 +250,7 @@
// S-ARM-7: clang{{.*}}" "-cc1" "-triple" "armv5e-unknown-netbsd7.0.0-eabi"
// S-ARM-7: ld{{.*}}" "--eh-frame-hdr" "-Bstatic"
// S-ARM-7: "-o" "a.out" "{{.*}}/usr/lib{{/|\\\\}}crt0.o" "{{.*}}/usr/lib{{/|\\\\}}eabi{{/|\\\\}}crti.o"
-// S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" "-lm" "-lc"
+// S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtbegin.o" "{{.*}}.o" "-lc++" "-lgcc_s" "-lm" "-lc"
// S-ARM-7: "{{.*}}/usr/lib{{/|\\\\}}crtend.o" "{{.*}}/usr/lib{{/|\\\\}}crtn.o"
// S-AARCH64: clang{{.*}}" "-cc1" "-triple" "aarch64-unknown-netbsd"
--
1.8.3.1

View File

@ -4,7 +4,7 @@
%global min_ver 0
%global patch_ver 0
%global rc_ver 3
%global baserelease 5
%global baserelease 6
%global clang_tools_binaries \
%{_bindir}/clang-apply-replacements \
@ -85,13 +85,11 @@ Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{versio
%endif
Source4: tstellar-gpg-key.asc
%if !0%{?compat_build}
Patch21: completion-model-cmake.patch
%endif
Patch4: 0001-PATCH-clang-Reorganize-gtest-integration.patch
Patch11: 0002-PATCH-clang-ToolChain-Add-lgcc_s-to-the-linker-flags.patch
Patch13: 0003-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch
Patch15: 0004-PATCH-clang-Don-t-install-static-libraries.patch
Patch17: 0005-PATCH-clang-Prefer-gcc-toolchains-with-libgcc_s.so-w.patch
@ -277,7 +275,6 @@ pathfix.py -i %{__python3} -pn \
%setup -q -n %{clang_srcdir}
%patch4 -p2 -b .gtest
%patch11 -p2 -b .libcxx-fix
%patch13 -p2 -b .unwind-default
%patch15 -p2 -b .no-install-static
%patch17 -p2 -b .check-gcc_s
@ -369,7 +366,8 @@ sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@//g' test/lit.cfg.py
\
-DCLANG_BUILD_EXAMPLES:BOOL=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCLANG_REPOSITORY_STRING="%{?fedora:Fedora}%{?rhel:Red Hat} %{version}-%{release}"
-DCLANG_REPOSITORY_STRING="%{?fedora:Fedora}%{?rhel:Red Hat} %{version}-%{release}" \
-DCLANG_DEFAULT_UNWINDLIB=libgcc
%cmake_build
@ -539,6 +537,10 @@ false
%endif
%changelog
* Mon Mar 15 2021 Timm Bäder <tbaeder@redhat.com> 12.0.0-0.6.rc3
- Set CLANG_DEFAULT_UNWIND_LIB instead of using custom patch
- Add toolchains test to the tests.yml
* Thu Mar 11 2021 sguelton@redhat.com - 12.0.0-0.5.rc3
- LLVM 12.0.0 rc3

View File

@ -18,6 +18,7 @@
- compiler-rt
- libcxx-devel
- glibc-devel
- glibc-static
- gcc
# Required for fedora-flags:
- annobin
@ -39,3 +40,4 @@
- clang/rhbz_1647130
- clang/llvm-toolchain
- clang/fedora-flags
- clang/toolchains