]>
Commit | Line | Data |
---|---|---|
b5cd69c6 JP |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
a2080a44 JP |
5 | Summary: mold: A Modern Linker |
6 | Name: mold | |
ffeb613b | 7 | Version: 1.5.0 |
a32f40a2 | 8 | Release: 1 |
a2080a44 JP |
9 | License: GPL v3+ |
10 | Group: Development/Libraries | |
11 | Source0: https://github.com/rui314/mold/archive/v%{version}/%{name}-%{version}.tar.gz | |
ffeb613b JP |
12 | # Source0-md5: bd4e4d7c8430821d82773f723454cacd |
13 | Patch0: absolute-install-paths.patch | |
a2080a44 | 14 | URL: https://github.com/rui314/mold |
ffeb613b | 15 | BuildRequires: cmake >= 3.13 |
b5cd69c6 | 16 | %{?with_tests:BuildRequires: glibc-static} |
4f192f39 JP |
17 | %ifarch %{armv6} riscv64 |
18 | BuildRequires: libatomic-devel | |
19 | %endif | |
a2080a44 | 20 | BuildRequires: libstdc++-devel >= 6:10 |
b5cd69c6 | 21 | %{?with_tests:BuildRequires: libstdc++-static >= 6:10} |
a2080a44 JP |
22 | BuildRequires: mimalloc-devel >= 1.7 |
23 | BuildRequires: openssl-devel | |
4f192f39 | 24 | BuildRequires: rpmbuild(macros) >= 2.007 |
a2080a44 | 25 | BuildRequires: tbb-devel >= 2021.3.0 |
a2080a44 | 26 | BuildRequires: zlib-devel |
ffeb613b | 27 | BuildRequires: zstd-devel |
a2080a44 JP |
28 | Requires: mimalloc >= 1.7 |
29 | Requires: tbb >= 2021.3.0 | |
ffeb613b | 30 | ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 ppc64le riscv64 sparc64 |
a2080a44 JP |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
32 | ||
33 | %description | |
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. | |
39 | ||
40 | %prep | |
41 | %setup -q | |
ffeb613b | 42 | %patch0 -p1 |
a2080a44 JP |
43 | |
44 | %{__rm} -r third-party/{mimalloc,tbb} | |
45 | ||
46 | %build | |
ffeb613b JP |
47 | %cmake -B build \ |
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 | |
52 | ||
53 | %{__make} -C build | |
a2080a44 | 54 | |
b5cd69c6 | 55 | %if %{with tests} |
ffeb613b | 56 | %{__make} -C build test |
b5cd69c6 JP |
57 | %endif |
58 | ||
a2080a44 JP |
59 | %install |
60 | rm -rf $RPM_BUILD_ROOT | |
61 | ||
ffeb613b JP |
62 | %{__make} -C build install \ |
63 | DESTDIR=$RPM_BUILD_ROOT | |
a2080a44 JP |
64 | |
65 | %clean | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | ||
68 | %files | |
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 | |
74 | %dir %{_libdir}/mold | |
75 | %attr(755,root,root) %{_libdir}/mold/mold-wrapper.so | |
5178e76b JP |
76 | %dir %{_libexecdir}/mold |
77 | %attr(755,root,root) %{_libexecdir}/mold/ld | |
a2080a44 | 78 | %{_mandir}/man1/mold.1* |
a32f40a2 | 79 | %{_mandir}/man1/ld.mold.1* |