]>
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 | |
a32f40a2 JP |
7 | Version: 1.4.1 |
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 | |
a32f40a2 | 12 | # Source0-md5: e21fff1962e98787ea0636d68d6369af |
a2080a44 | 13 | URL: https://github.com/rui314/mold |
b5cd69c6 | 14 | %{?with_tests:BuildRequires: glibc-static} |
4f192f39 JP |
15 | %ifarch %{armv6} riscv64 |
16 | BuildRequires: libatomic-devel | |
17 | %endif | |
a2080a44 | 18 | BuildRequires: libstdc++-devel >= 6:10 |
b5cd69c6 | 19 | %{?with_tests:BuildRequires: libstdc++-static >= 6:10} |
a2080a44 JP |
20 | BuildRequires: mimalloc-devel >= 1.7 |
21 | BuildRequires: openssl-devel | |
4f192f39 | 22 | BuildRequires: rpmbuild(macros) >= 2.007 |
a2080a44 | 23 | BuildRequires: tbb-devel >= 2021.3.0 |
a2080a44 JP |
24 | BuildRequires: zlib-devel |
25 | Requires: mimalloc >= 1.7 | |
26 | Requires: tbb >= 2021.3.0 | |
a1637193 | 27 | ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 riscv64 |
a2080a44 JP |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
29 | ||
30 | %description | |
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. | |
36 | ||
37 | %prep | |
38 | %setup -q | |
39 | ||
40 | %{__rm} -r third-party/{mimalloc,tbb} | |
41 | ||
42 | %build | |
a2080a44 | 43 | %{__make} \ |
4f192f39 | 44 | ARCH="%{_target_cpu}" \ |
a2080a44 JP |
45 | CC="%{__cc}" \ |
46 | CXX="%{__cxx}" \ | |
5c950940 JP |
47 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ |
48 | CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \ | |
49 | LDFLAGS="%{rpmldflags}" \ | |
a2080a44 JP |
50 | SYSTEM_MIMALLOC=1 \ |
51 | SYSTEM_TBB=1 \ | |
52 | PREFIX="%{_prefix}" \ | |
53 | BINDIR="%{_bindir}" \ | |
54 | LIBDIR="%{_libdir}" \ | |
55 | MANDIR="%{_mandir}" | |
56 | ||
b5cd69c6 JP |
57 | %if %{with tests} |
58 | %{__make} check \ | |
59 | MACHINE="%{_target_cpu}" \ | |
60 | TEST_CC="%{__cc}" \ | |
61 | TEST_GCC="%{__cc}" \ | |
62 | TEST_CXX="%{__cxx}" \ | |
63 | TEST_GXX="%{__cxx}" \ | |
64 | SYSTEM_MIMALLOC=1 \ | |
65 | SYSTEM_TBB=1 | |
66 | %endif | |
67 | ||
a2080a44 JP |
68 | %install |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | ||
71 | %{__make} install \ | |
72 | D=$RPM_BUILD_ROOT \ | |
73 | SYSTEM_MIMALLOC=1 \ | |
74 | SYSTEM_TBB=1 \ | |
75 | STRIP=: \ | |
76 | PREFIX="%{_prefix}" \ | |
77 | BINDIR="%{_bindir}" \ | |
78 | LIBDIR="%{_libdir}" \ | |
79 | MANDIR="%{_mandir}" | |
80 | ||
81 | %clean | |
82 | rm -rf $RPM_BUILD_ROOT | |
83 | ||
84 | %files | |
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 | |
90 | %dir %{_libdir}/mold | |
91 | %attr(755,root,root) %{_libdir}/mold/mold-wrapper.so | |
5178e76b JP |
92 | %dir %{_libexecdir}/mold |
93 | %attr(755,root,root) %{_libexecdir}/mold/ld | |
a2080a44 | 94 | %{_mandir}/man1/mold.1* |
a32f40a2 | 95 | %{_mandir}/man1/ld.mold.1* |