Notification time stamped 2023-02-28 23:53:34 UTC
From 6717a1e18a77ad13c70b59198915fa330880434b Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar(a)redhat.com>
Date: Feb 28 2023 23:31:48 +0000
Subject: Add workaround for build failure on i386/f36
https://github.com/llvm/llvm-project/issues/45130
---
diff --git a/.copr/Makefile b/.copr/Makefile
index be16732..274ce72 100644
--- a/.copr/Makefile
+++ b/.copr/Makefile
@@ -7,6 +7,7 @@ srpm:
dnf copr enable -y --setopt=reposdir=/tmp/yum.repos.d
@fedora-llvm-team/llvm-snapshot-builder
dnf install -y --setopt=reposdir=/tmp/yum.repos.d llvm-snapshot-builder
rpmbuild \
+ --define "yyyymmdd 20230228" \
--define "_srcrpmdir $(outdir)" \
--define "_sourcedir $(shell pwd)" \
--define "_disable_source_fetch 0" \
diff --git a/0001-clangd-Link-with-latomic.patch b/0001-clangd-Link-with-latomic.patch
new file mode 100644
index 0000000..10393d9
--- /dev/null
+++ b/0001-clangd-Link-with-latomic.patch
@@ -0,0 +1,30 @@
+From 57127e50bf3cca9f6b9222aea734bc1d232bbb0d Mon Sep 17 00:00:00 2001
+From: Tom Stellard <tstellar(a)redhat.com>
+Date: Tue, 28 Feb 2023 19:46:50 +0000
+Subject: [PATCH] clangd: Link with -latomic
+
+This fixes the build with clang-14.
+
+https://github.com/llvm/llvm-project/issues/45130
+---
+ clang-tools-extra/clangd/support/CMakeLists.txt | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/clang-tools-extra/clangd/support/CMakeLists.txt
b/clang-tools-extra/clangd/support/CMakeLists.txt
+index 0c8c199dd4a4..099f3aa89ef4 100644
+--- a/clang-tools-extra/clangd/support/CMakeLists.txt
++++ b/clang-tools-extra/clangd/support/CMakeLists.txt
+@@ -11,9 +11,7 @@ if(CLANG_BUILT_STANDALONE)
+ endif()
+
+ set(CLANGD_ATOMIC_LIB "")
+-if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB OR NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB)
+- list(APPEND CLANGD_ATOMIC_LIB "atomic")
+-endif()
++list(APPEND CLANGD_ATOMIC_LIB "atomic")
+
+ add_clang_library(clangdSupport
+ Cancellation.cpp
+--
+2.35.1
+
diff --git a/clang.spec b/clang.spec
index 4b5196d..ba36150 100644
--- a/clang.spec
+++ b/clang.spec
@@ -94,6 +94,8 @@ Patch8: D138472.diff
# Patches for clang-tools-extra
# See
https://reviews.llvm.org/D120301
Patch201: 0001-clang-tools-extra-Make-test-dependency-on-LLVMHello-.patch
+# Work-around for
https://github.com/llvm/llvm-project/issues/45130
+Patch301: 0001-clangd-Link-with-latomic.patch
%endif
BuildRequires: clang
@@ -291,7 +293,10 @@ mv %{cmake_srcdir} cmake
%endif
%setup -T -q -b 1 -n %{clang_tools_srcdir}
-%autopatch -m200 -p2
+%autopatch -m200 -M300 -p2
+%if 0%{?fedora} == 36
+%autopatch 301 -p2
+%endif
# failing test case
https://src.fedoraproject.org/rpms/clang/c/6717a1e18a77ad13c70b59198915fa...