]> git.pld-linux.org Git - packages/mold.git/blame - mold.spec
up to 1.4.2
[packages/mold.git] / mold.spec
CommitLineData
b5cd69c6
JP
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
a2080a44
JP
5Summary: mold: A Modern Linker
6Name: mold
8668a437 7Version: 1.4.2
a32f40a2 8Release: 1
a2080a44
JP
9License: GPL v3+
10Group: Development/Libraries
11Source0: https://github.com/rui314/mold/archive/v%{version}/%{name}-%{version}.tar.gz
8668a437 12# Source0-md5: 3a9891b330789fe04fbcced05b5fffe2
a2080a44 13URL: https://github.com/rui314/mold
b5cd69c6 14%{?with_tests:BuildRequires: glibc-static}
4f192f39
JP
15%ifarch %{armv6} riscv64
16BuildRequires: libatomic-devel
17%endif
a2080a44 18BuildRequires: libstdc++-devel >= 6:10
b5cd69c6 19%{?with_tests:BuildRequires: libstdc++-static >= 6:10}
a2080a44
JP
20BuildRequires: mimalloc-devel >= 1.7
21BuildRequires: openssl-devel
4f192f39 22BuildRequires: rpmbuild(macros) >= 2.007
a2080a44 23BuildRequires: tbb-devel >= 2021.3.0
a2080a44
JP
24BuildRequires: zlib-devel
25Requires: mimalloc >= 1.7
26Requires: tbb >= 2021.3.0
a1637193 27ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 riscv64
a2080a44
JP
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30%description
31mold is a faster drop-in replacement for existing Unix linkers. It is
32several times faster than LLVM lld linker, the second-fastest
33open-source linker which I originally created a few years ago. mold is
34created for increasing developer productivity by reducing build time
35especially 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
69rm -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
82rm -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*
This page took 0.17004 seconds and 4 git commands to generate.