]> git.pld-linux.org Git - packages/mold.git/blame - mold.spec
add tests invocation
[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
0a2ebcd2 7Version: 1.3.0
591a6948 8Release: 1
a2080a44
JP
9License: GPL v3+
10Group: Development/Libraries
11Source0: https://github.com/rui314/mold/archive/v%{version}/%{name}-%{version}.tar.gz
0a2ebcd2 12# Source0-md5: f7ed6a7246e6ef945494f51e70072ad4
4f192f39 13Patch0: atomic.patch
69539fe3 14Patch1: arm32-reloc.patch
a2080a44 15URL: https://github.com/rui314/mold
b5cd69c6 16%{?with_tests:BuildRequires: glibc-static}
4f192f39
JP
17%ifarch %{armv6} riscv64
18BuildRequires: libatomic-devel
19%endif
a2080a44 20BuildRequires: libstdc++-devel >= 6:10
b5cd69c6 21%{?with_tests:BuildRequires: libstdc++-static >= 6:10}
a2080a44
JP
22BuildRequires: mimalloc-devel >= 1.7
23BuildRequires: openssl-devel
4f192f39 24BuildRequires: rpmbuild(macros) >= 2.007
a2080a44 25BuildRequires: tbb-devel >= 2021.3.0
a2080a44
JP
26BuildRequires: zlib-devel
27Requires: mimalloc >= 1.7
28Requires: tbb >= 2021.3.0
a1637193 29ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 riscv64
a2080a44
JP
30BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32%description
33mold is a faster drop-in replacement for existing Unix linkers. It is
34several times faster than LLVM lld linker, the second-fastest
35open-source linker which I originally created a few years ago. mold is
36created for increasing developer productivity by reducing build time
37especially in rapid debug-edit-rebuild cycles.
38
39%prep
40%setup -q
4f192f39 41%patch0 -p1
69539fe3 42%patch1 -p1
a2080a44
JP
43
44%{__rm} -r third-party/{mimalloc,tbb}
45
46%build
a2080a44 47%{__make} \
4f192f39 48 ARCH="%{_target_cpu}" \
a2080a44
JP
49 CC="%{__cc}" \
50 CXX="%{__cxx}" \
5c950940
JP
51 CFLAGS="%{rpmcppflags} %{rpmcflags}" \
52 CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \
53 LDFLAGS="%{rpmldflags}" \
a2080a44
JP
54 SYSTEM_MIMALLOC=1 \
55 SYSTEM_TBB=1 \
56 PREFIX="%{_prefix}" \
57 BINDIR="%{_bindir}" \
58 LIBDIR="%{_libdir}" \
59 MANDIR="%{_mandir}"
60
b5cd69c6
JP
61%if %{with tests}
62%{__make} check \
63 MACHINE="%{_target_cpu}" \
64 TEST_CC="%{__cc}" \
65 TEST_GCC="%{__cc}" \
66 TEST_CXX="%{__cxx}" \
67 TEST_GXX="%{__cxx}" \
68 SYSTEM_MIMALLOC=1 \
69 SYSTEM_TBB=1
70%endif
71
a2080a44
JP
72%install
73rm -rf $RPM_BUILD_ROOT
74
75%{__make} install \
76 D=$RPM_BUILD_ROOT \
77 SYSTEM_MIMALLOC=1 \
78 SYSTEM_TBB=1 \
79 STRIP=: \
80 PREFIX="%{_prefix}" \
81 BINDIR="%{_bindir}" \
82 LIBDIR="%{_libdir}" \
83 MANDIR="%{_mandir}"
84
85%clean
86rm -rf $RPM_BUILD_ROOT
87
88%files
89%defattr(644,root,root,755)
90%doc CONTRIBUTING.md README.md docs/*.md
91%attr(755,root,root) %{_bindir}/ld.mold
92%attr(755,root,root) %{_bindir}/ld64.mold
93%attr(755,root,root) %{_bindir}/mold
94%dir %{_libdir}/mold
95%attr(755,root,root) %{_libdir}/mold/mold-wrapper.so
5178e76b
JP
96%dir %{_libexecdir}/mold
97%attr(755,root,root) %{_libexecdir}/mold/ld
a2080a44 98%{_mandir}/man1/mold.1*
This page took 0.177227 seconds and 4 git commands to generate.