[packages/mold] link with libatomic on %{armv6}

atler atler at pld-linux.org
Mon Apr 18 15:15:20 CEST 2022


commit 4f192f39388f71cfa6cfddad0351b999b8af1456
Author: Jan Palus <atler at pld-linux.org>
Date:   Mon Apr 18 15:14:22 2022 +0200

    link with libatomic on %{armv6}

 atomic.patch | 11 +++++++++++
 mold.spec    |  7 +++++++
 2 files changed, 18 insertions(+)
---
diff --git a/mold.spec b/mold.spec
index f6ea147..c00c253 100644
--- a/mold.spec
+++ b/mold.spec
@@ -6,11 +6,16 @@ License:	GPL v3+
 Group:		Development/Libraries
 Source0:	https://github.com/rui314/mold/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	6e9dba635bd3ed1d39a8fe6411a2005e
+Patch0:		atomic.patch
 URL:		https://github.com/rui314/mold
+%ifarch %{armv6} riscv64
+BuildRequires:	libatomic-devel
+%endif
 BuildRequires:	libstdc++-devel >= 6:10
 BuildRequires:	mimalloc-devel >= 1.7
 BuildRequires:	openssl-devel
 BuildRequires:	pkgconfig
+BuildRequires:	rpmbuild(macros) >= 2.007
 BuildRequires:	tbb-devel >= 2021.3.0
 BuildRequires:	zlib-devel
 Requires:	mimalloc >= 1.7
@@ -27,11 +32,13 @@ especially in rapid debug-edit-rebuild cycles.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %{__rm} -r third-party/{mimalloc,tbb}
 
 %build
 %{__make} \
+	ARCH="%{_target_cpu}" \
 	CC="%{__cc}" \
 	CXX="%{__cxx}" \
 	CFLAGS="%{rpmcppflags} %{rpmcflags}" \
diff --git a/atomic.patch b/atomic.patch
new file mode 100644
index 0000000..3b6bfbe
--- /dev/null
+++ b/atomic.patch
@@ -0,0 +1,11 @@
+--- mold-1.2.0/Makefile.orig	2022-04-15 11:08:14.000000000 +0200
++++ mold-1.2.0/Makefile	2022-04-18 15:00:15.960428924 +0200
+@@ -110,7 +110,7 @@
+ # '-latomic' flag is needed building on riscv64 system
+ # RV32 system doesn't tested yet
+ # seems like '-atomic' would be better but not working.
+-ifeq ($(ARCH), riscv64)
++ifneq (,$(filter armv6% riscv64, $(ARCH)))
+   MOLD_LDFLAGS += -latomic
+ endif
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mold.git/commitdiff/4f192f39388f71cfa6cfddad0351b999b8af1456



More information about the pld-cvs-commit mailing list