2024-02-04 16:37:15 +08:00
|
|
|
%bcond_with ctest
|
|
|
|
|
|
|
|
|
|
Name: mold
|
2024-08-13 11:31:51 +08:00
|
|
|
Version: 2.33.0
|
2024-02-04 16:37:15 +08:00
|
|
|
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
|
|
|
|
|
|
2024-07-17 17:38:20 +08:00
|
|
|
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
|
2024-02-04 16:37:15 +08:00
|
|
|
|
|
|
|
|
# following pkgs are only required for the test
|
2024-07-17 17:38:20 +08:00
|
|
|
BuildRequires: llvm clang perl
|
|
|
|
|
BuildRequires: gdb glibc-devel
|
|
|
|
|
BuildRequires: libstdc++-static libdwarf-tools
|
|
|
|
|
|
2024-08-13 11:31:51 +08:00
|
|
|
BuildRequires: tbb-devel >= 2021.11
|
2024-02-04 16:37:15 +08:00
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
2024-08-13 11:31:51 +08:00
|
|
|
%define build_args -DMOLD_USE_MIMALLOC=OFF -DMOLD_USE_SYSTEM_TBB=ON
|
2024-02-04 16:37:15 +08:00
|
|
|
|
|
|
|
|
%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
|
2024-08-13 11:31:51 +08:00
|
|
|
* Tue Aug 13 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 2.33.0-1
|
|
|
|
|
- Upgrade to 2.33.0
|
|
|
|
|
|
2024-07-17 17:38:20 +08:00
|
|
|
* Wed Jul 17 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 2.32.1-1
|
|
|
|
|
- Upgrade to 2.32.1
|
|
|
|
|
|
2024-02-04 16:37:15 +08:00
|
|
|
* Tue Mar 19 2024 jchzhou <zhoujiacheng@iscas.ac.cn> - 2.30.0-1
|
|
|
|
|
- Init package
|