3 %bcond_without tests # build without tests
5 Summary: mold: A Modern Linker
10 Group: Development/Libraries
11 Source0: https://github.com/rui314/mold/archive/v%{version}/%{name}-%{version}.tar.gz
12 # Source0-md5: 2057603a4f8068e062b86dde6ba5c0f0
13 URL: https://github.com/rui314/mold
14 %{?with_tests:BuildRequires: glibc-static}
15 %ifarch %{armv6} riscv64
16 BuildRequires: libatomic-devel
18 BuildRequires: libstdc++-devel >= 6:10
19 %{?with_tests:BuildRequires: libstdc++-static >= 6:10}
20 BuildRequires: mimalloc-devel >= 1.7
21 BuildRequires: openssl-devel
22 BuildRequires: rpmbuild(macros) >= 2.007
23 BuildRequires: tbb-devel >= 2021.3.0
24 BuildRequires: zlib-devel
25 Requires: mimalloc >= 1.7
26 Requires: tbb >= 2021.3.0
27 ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 riscv64
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 mold is a faster drop-in replacement for existing Unix linkers. It is
32 several times faster than LLVM lld linker, the second-fastest
33 open-source linker which I originally created a few years ago. mold is
34 created for increasing developer productivity by reducing build time
35 especially in rapid debug-edit-rebuild cycles.
40 %{__rm} -r third-party/{mimalloc,tbb}
44 ARCH="%{_target_cpu}" \
47 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
48 CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \
49 LDFLAGS="%{rpmldflags}" \
59 MACHINE="%{_target_cpu}" \
69 rm -rf $RPM_BUILD_ROOT
82 rm -rf $RPM_BUILD_ROOT
85 %defattr(644,root,root,755)
86 %doc CONTRIBUTING.md README.md docs/*.md
87 %attr(755,root,root) %{_bindir}/ld.mold
88 %attr(755,root,root) %{_bindir}/ld64.mold
89 %attr(755,root,root) %{_bindir}/mold
91 %attr(755,root,root) %{_libdir}/mold/mold-wrapper.so
92 %dir %{_libexecdir}/mold
93 %attr(755,root,root) %{_libexecdir}/mold/ld
94 %{_mandir}/man1/mold.1*