86 lines
2.3 KiB
RPMSpec
86 lines
2.3 KiB
RPMSpec
|
|
%bcond_with ctest
|
||
|
|
|
||
|
|
Name: mold
|
||
|
|
Version: 2.30.0
|
||
|
|
Release: 1
|
||
|
|
Summary: A Modern Linker (mold)
|
||
|
|
License: MIT
|
||
|
|
URL: https://github.com/rui314/mold
|
||
|
|
Source: https://github.com/rui314/mold/archive/v%{version}/%{name}-%{version}.tar.gz
|
||
|
|
|
||
|
|
ExclusiveArch: x86_64 aarch64 riscv64
|
||
|
|
BuildRequires: cmake
|
||
|
|
BuildRequires: gcc
|
||
|
|
BuildRequires: gcc-c++ >= 10
|
||
|
|
BuildRequires: openssl-devel
|
||
|
|
BuildRequires: grep
|
||
|
|
BuildRequires: python3
|
||
|
|
BuildRequires: xxhash-devel
|
||
|
|
BuildRequires: zlib-devel
|
||
|
|
BuildRequires: libzstd
|
||
|
|
BuildRequires: libzstd-devel
|
||
|
|
|
||
|
|
# Required by bundled oneTBB
|
||
|
|
BuildRequires: hwloc-devel
|
||
|
|
|
||
|
|
# following pkgs are only required for the test
|
||
|
|
BuildRequires: clang
|
||
|
|
BuildRequires: gdb
|
||
|
|
BuildRequires: glibc-devel
|
||
|
|
BuildRequires: libstdc++-static
|
||
|
|
BuildRequires: libdwarf-tools
|
||
|
|
BuildRequires: llvm
|
||
|
|
BuildRequires: perl
|
||
|
|
# API-incompatible with older tbb 2020.3 currently shipped by openEuler
|
||
|
|
Provides: bundled(tbb) = 2021.11
|
||
|
|
|
||
|
|
# Allow building against the system-provided `xxhash.h`
|
||
|
|
Patch0: 0001-Use-system-compatible-include-path-for-xxhash.h.patch
|
||
|
|
|
||
|
|
# Build blake3 as static
|
||
|
|
Patch1: 0002-build-blake3-as-static.patch
|
||
|
|
|
||
|
|
%define build_args -DMOLD_USE_MIMALLOC=OFF -DMOLD_USE_MIMALLOC=OFF
|
||
|
|
|
||
|
|
%description
|
||
|
|
mold is a faster drop-in replacement for existing Unix linkers.
|
||
|
|
It is several times faster than the LLVM lld linker.
|
||
|
|
mold is designed to increase developer productivity by reducing
|
||
|
|
build time, especially in rapid debug-edit-rebuild cycles.
|
||
|
|
|
||
|
|
%prep
|
||
|
|
%autosetup -p1
|
||
|
|
# Prefer system xxhash/zlib/zstd instead of bundled one
|
||
|
|
rm -r third-party/{xxhash,zlib,zstd}
|
||
|
|
|
||
|
|
%build
|
||
|
|
%set_build_flags
|
||
|
|
mkdir "%{_vpath_builddir}"
|
||
|
|
%cmake -B "%{_vpath_builddir}" %{build_args}
|
||
|
|
/usr/bin/cmake --build "%{_vpath_builddir}" "%{?_smp_mflags}" --verbose
|
||
|
|
|
||
|
|
%check
|
||
|
|
%if %{with ctest}
|
||
|
|
pushd "%{_vpath_builddir}"
|
||
|
|
/usr/bin/ctest --output-on-failure --force-new-ctest-process %{?_smp_mflags} || true
|
||
|
|
popd
|
||
|
|
%endif
|
||
|
|
|
||
|
|
%install
|
||
|
|
DESTDIR="%{buildroot}" /usr/bin/cmake --install "%{_vpath_builddir}"
|
||
|
|
chmod +x %{buildroot}%{_libdir}/mold/mold-wrapper.so
|
||
|
|
|
||
|
|
%files
|
||
|
|
%license %{_docdir}/mold/LICENSE
|
||
|
|
%license %{_docdir}/mold/LICENSE.third-party
|
||
|
|
%{_bindir}/mold
|
||
|
|
%{_bindir}/ld.mold
|
||
|
|
%{_libdir}/mold/mold-wrapper.so
|
||
|
|
%{_libexecdir}/mold
|
||
|
|
%{_libexecdir}/mold/ld
|
||
|
|
%{_mandir}/man1/ld.mold.1*
|
||
|
|
%{_mandir}/man1/mold.1*
|
||
|
|
|
||
|
|
%changelog
|
||
|
|
* Tue Mar 19 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 2.30.0-1
|
||
|
|
- Init package
|