]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
5 | Summary: mold: A Modern Linker | |
6 | Name: mold | |
7 | Version: 2.32.0 | |
8 | Release: 1 | |
9 | License: MIT | |
10 | Group: Development/Libraries | |
11 | Source0: https://github.com/rui314/mold/archive/v%{version}/%{name}-%{version}.tar.gz | |
12 | # Source0-md5: a6d222dacd30f0c11546a2194f737280 | |
13 | URL: https://github.com/rui314/mold | |
14 | BuildRequires: blake3-devel | |
15 | BuildRequires: cmake >= 3.14 | |
16 | %{?with_tests:BuildRequires: glibc-static} | |
17 | %ifarch %{armv6} riscv64 | |
18 | BuildRequires: libatomic-devel | |
19 | %endif | |
20 | BuildRequires: libstdc++-devel >= 6:10 | |
21 | %{?with_tests:BuildRequires: libstdc++-static >= 6:10} | |
22 | BuildRequires: mimalloc-devel >= 1.7 | |
23 | BuildRequires: rpmbuild(macros) >= 2.007 | |
24 | BuildRequires: tbb-devel >= 2021.3.0 | |
25 | BuildRequires: zlib-devel | |
26 | BuildRequires: zstd-devel | |
27 | Requires: mimalloc >= 1.7 | |
28 | Requires: tbb >= 2021.3.0 | |
29 | ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 m68k ppc64 ppc64le riscv32 riscv64 s390x sparc64 | |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
31 | ||
32 | %description | |
33 | mold is a faster drop-in replacement for existing Unix linkers. It is | |
34 | several times faster than LLVM lld linker, the second-fastest | |
35 | open-source linker which I originally created a few years ago. mold is | |
36 | created for increasing developer productivity by reducing build time | |
37 | especially in rapid debug-edit-rebuild cycles. | |
38 | ||
39 | %prep | |
40 | %setup -q | |
41 | ||
42 | %{__rm} -r third-party/{mimalloc,tbb} | |
43 | ||
44 | %build | |
45 | %cmake -B build \ | |
46 | %{cmake_on_off tests BUILD_TESTING} \ | |
47 | -DMOLD_USE_MIMALLOC:BOOL=ON \ | |
48 | -DMOLD_USE_SYSTEM_MIMALLOC:BOOL=ON \ | |
49 | -DMOLD_USE_SYSTEM_TBB:BOOL=ON | |
50 | ||
51 | %{__make} -C build | |
52 | ||
53 | %if %{with tests} | |
54 | %{__make} -C build test | |
55 | %endif | |
56 | ||
57 | %install | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | ||
60 | %{__make} -C build install \ | |
61 | DESTDIR=$RPM_BUILD_ROOT | |
62 | ||
63 | %clean | |
64 | rm -rf $RPM_BUILD_ROOT | |
65 | ||
66 | %files | |
67 | %defattr(644,root,root,755) | |
68 | %doc LICENSE README.md docs/*.md | |
69 | %attr(755,root,root) %{_bindir}/ld.mold | |
70 | %attr(755,root,root) %{_bindir}/mold | |
71 | %dir %{_libdir}/mold | |
72 | %attr(755,root,root) %{_libdir}/mold/mold-wrapper.so | |
73 | %dir %{_libexecdir}/mold | |
74 | %attr(755,root,root) %{_libexecdir}/mold/ld | |
75 | %{_mandir}/man1/mold.1* | |
76 | %{_mandir}/man1/ld.mold.1* |