]> git.pld-linux.org Git - packages/mold.git/blob - mold.spec
up to 1.3.1
[packages/mold.git] / mold.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 Summary:        mold: A Modern Linker
6 Name:           mold
7 Version:        1.3.1
8 Release:        1
9 License:        GPL v3+
10 Group:          Development/Libraries
11 Source0:        https://github.com/rui314/mold/archive/v%{version}/%{name}-%{version}.tar.gz
12 # Source0-md5:  caeec8fadaea5fcee6e8783534087275
13 URL:            https://github.com/rui314/mold
14 %{?with_tests:BuildRequires:    glibc-static}
15 %ifarch %{armv6} riscv64
16 BuildRequires:  libatomic-devel
17 %endif
18 BuildRequires:  libstdc++-devel >= 6:10
19 %{?with_tests:BuildRequires:    libstdc++-static >= 6:10}
20 BuildRequires:  mimalloc-devel >= 1.7
21 BuildRequires:  openssl-devel
22 BuildRequires:  rpmbuild(macros) >= 2.007
23 BuildRequires:  tbb-devel >= 2021.3.0
24 BuildRequires:  zlib-devel
25 Requires:       mimalloc >= 1.7
26 Requires:       tbb >= 2021.3.0
27 ExclusiveArch:  %{ix86} %{x8664} %{arm} aarch64 riscv64
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
43 %{__make} \
44         ARCH="%{_target_cpu}" \
45         CC="%{__cc}" \
46         CXX="%{__cxx}" \
47         CFLAGS="%{rpmcppflags} %{rpmcflags}" \
48         CXXFLAGS="%{rpmcppflags} %{rpmcxxflags}" \
49         LDFLAGS="%{rpmldflags}" \
50         SYSTEM_MIMALLOC=1 \
51         SYSTEM_TBB=1 \
52         PREFIX="%{_prefix}" \
53         BINDIR="%{_bindir}" \
54         LIBDIR="%{_libdir}" \
55         MANDIR="%{_mandir}"
56
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
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
92 %dir %{_libexecdir}/mold
93 %attr(755,root,root) %{_libexecdir}/mold/ld
94 %{_mandir}/man1/mold.1*
This page took 0.069515 seconds and 3 git commands to generate.