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: f6eb0adbc0ebd5dc75aed698bddd1a0e
13 Patch0: x86-nonpic.patch
14 URL: https://github.com/rui314/mold
15 BuildRequires: cmake >= 3.13
16 %{?with_tests:BuildRequires: glibc-static}
17 %ifarch %{armv6} riscv64
18 BuildRequires: libatomic-devel
20 BuildRequires: libstdc++-devel >= 6:10
21 %{?with_tests:BuildRequires: libstdc++-static >= 6:10}
22 BuildRequires: mimalloc-devel >= 1.7
23 BuildRequires: openssl-devel
24 BuildRequires: rpmbuild(macros) >= 2.007
25 BuildRequires: tbb-devel >= 2021.3.0
26 BuildRequires: zlib-devel
27 BuildRequires: zstd-devel
28 Requires: mimalloc >= 1.7
29 Requires: tbb >= 2021.3.0
30 ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 ppc64le riscv64 sparc64
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 mold is a faster drop-in replacement for existing Unix linkers. It is
35 several times faster than LLVM lld linker, the second-fastest
36 open-source linker which I originally created a few years ago. mold is
37 created for increasing developer productivity by reducing build time
38 especially in rapid debug-edit-rebuild cycles.
44 %{__rm} -r third-party/{mimalloc,tbb}
48 %{cmake_on_off tests BUILD_TESTING} \
49 -DMOLD_USE_MIMALLOC:BOOL=ON \
50 -DMOLD_USE_SYSTEM_MIMALLOC:BOOL=ON \
51 -DMOLD_USE_SYSTEM_TBB:BOOL=ON
56 %{__make} -C build test
60 rm -rf $RPM_BUILD_ROOT
62 %{__make} -C build install \
63 DESTDIR=$RPM_BUILD_ROOT
66 rm -rf $RPM_BUILD_ROOT
69 %defattr(644,root,root,755)
70 %doc CONTRIBUTING.md README.md docs/*.md
71 %attr(755,root,root) %{_bindir}/ld.mold
72 %attr(755,root,root) %{_bindir}/ld64.mold
73 %attr(755,root,root) %{_bindir}/mold
75 %attr(755,root,root) %{_libdir}/mold/mold-wrapper.so
76 %dir %{_libexecdir}/mold
77 %attr(755,root,root) %{_libexecdir}/mold/ld
78 %{_mandir}/man1/mold.1*
79 %{_mandir}/man1/ld.mold.1*