mold/mold.spec
jchzhou 1e9c8f5f0a Upgrade to 2.33.0
Signed-off-by: jchzhou <zhoujiacheng@iscas.ac.cn>
2024-08-13 11:33:17 +08:00

78 lines
2.2 KiB
RPMSpec

%bcond_with ctest
Name: mold
Version: 2.33.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 loongarch64
BuildRequires: gcc gcc-c++ >= 10
BuildRequires: python3 grep cmake openssl-devel
BuildRequires: zlib-devel xxhash-devel libzstd libzstd-devel
# following pkgs are only required for the test
BuildRequires: llvm clang perl
BuildRequires: gdb glibc-devel
BuildRequires: libstdc++-static libdwarf-tools
BuildRequires: tbb-devel >= 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_SYSTEM_TBB=ON
%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 Aug 13 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 2.33.0-1
- Upgrade to 2.33.0
* Wed Jul 17 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 2.32.1-1
- Upgrade to 2.32.1
* Tue Mar 19 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 2.30.0-1
- Init package