2022-01-25 18:46:31 +00:00
|
|
|
Name: mold
|
2022-04-16 15:16:35 +00:00
|
|
|
Version: 1.2
|
2022-02-22 21:16:29 +00:00
|
|
|
Release: 1%{?dist}
|
2022-01-25 18:46:31 +00:00
|
|
|
Summary: A Modern Linker
|
|
|
|
|
|
|
|
License: AGPLv3+
|
|
|
|
URL: https://github.com/rui314/mold
|
|
|
|
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
|
|
|
|
|
|
# The bundled build system for tbb tries to strip all Werror from the
|
|
|
|
# CFLAGS/CXXFLAGS when not building in strict mode (mold doesn't use strict
|
|
|
|
# mode). We don't want that because it causes the "Werror=format-security"
|
|
|
|
# option to become "=format-security" and break the build. (similar to a patch
|
|
|
|
# in the Fedora tbb package)
|
|
|
|
Patch0: tbb-strip-werror.patch
|
|
|
|
|
2022-04-16 15:16:35 +00:00
|
|
|
# Skip test if dwarfdump is unavailable
|
|
|
|
Patch1: 0001-Skip-test-if-dwarfdump-is-unavailable.patch
|
2022-01-25 18:46:31 +00:00
|
|
|
|
2022-02-22 21:16:29 +00:00
|
|
|
# Fix mimalloc compatibility with libstdc++ < 9:
|
|
|
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68210
|
2022-03-08 21:45:00 +00:00
|
|
|
Patch2: 0002-Fix-compatibility-with-libstdc-9.patch
|
2022-01-25 18:46:31 +00:00
|
|
|
|
2022-04-16 15:16:35 +00:00
|
|
|
# mold can produce native binaries for i686, x86_64, ARMv7, aarch64 and riscv64,
|
|
|
|
# but it only runs on a 64-bit host
|
2022-02-23 07:12:01 +00:00
|
|
|
ExclusiveArch: x86_64 aarch64 riscv64
|
2022-01-25 18:46:31 +00:00
|
|
|
|
|
|
|
BuildRequires: cmake
|
|
|
|
%if 0%{?el8}
|
|
|
|
BuildRequires: gcc-toolset-10-toolchain
|
2022-04-16 15:03:26 +00:00
|
|
|
%else
|
2022-02-22 21:15:11 +00:00
|
|
|
BuildRequires: gcc
|
2022-01-25 18:46:31 +00:00
|
|
|
BuildRequires: gcc-c++ >= 10
|
|
|
|
%endif
|
|
|
|
BuildRequires: mimalloc-devel
|
|
|
|
BuildRequires: openssl-devel
|
|
|
|
BuildRequires: xxhash-devel
|
|
|
|
BuildRequires: zlib-devel
|
|
|
|
|
|
|
|
# The following packages are only required for executing the tests
|
|
|
|
BuildRequires: clang
|
|
|
|
BuildRequires: glibc-static
|
|
|
|
%ifarch x86_64
|
2022-01-25 20:59:42 +00:00
|
|
|
BuildRequires: /usr/lib/libc.a
|
2022-01-25 18:46:31 +00:00
|
|
|
%endif
|
2022-04-16 15:09:05 +00:00
|
|
|
%if 0%{!?el8}
|
2022-01-25 20:54:40 +00:00
|
|
|
BuildRequires: libdwarf-tools
|
|
|
|
%endif
|
2022-01-25 18:46:31 +00:00
|
|
|
BuildRequires: libstdc++-static
|
2022-03-08 21:47:04 +00:00
|
|
|
BuildRequires: llvm
|
|
|
|
BuildRequires: perl
|
2022-01-25 18:46:31 +00:00
|
|
|
|
|
|
|
Requires(post): %{_sbindir}/alternatives
|
|
|
|
Requires(preun): %{_sbindir}/alternatives
|
|
|
|
|
|
|
|
# API-incompatible with older tbb 2020.3 currently shipped by Fedora:
|
|
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=2036372
|
2022-04-16 15:14:15 +00:00
|
|
|
Provides: bundled(tbb) = 2021.5
|
2022-01-25 18:46:31 +00:00
|
|
|
|
2022-04-16 15:13:37 +00:00
|
|
|
%define build_args PREFIX=%{_prefix} LIBDIR=%{_libdir} CFLAGS="%{build_cflags}" CXXFLAGS="%{build_cxxflags} -Wno-sign-compare" LDFLAGS="%{build_ldflags}" STRIP=echo SYSTEM_MIMALLOC=1
|
2022-01-25 18:46:31 +00:00
|
|
|
|
|
|
|
%description
|
2022-02-22 21:15:29 +00:00
|
|
|
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.
|
2022-01-25 18:46:31 +00:00
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -p1
|
|
|
|
rm -r third-party/{mimalloc,xxhash}
|
2022-04-16 15:16:35 +00:00
|
|
|
# Remove failing unit test for now (https://github.com/rui314/mold/issues/436)
|
|
|
|
rm test/elf/gdb-index.sh
|
2022-01-25 18:46:31 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
%if 0%{?el8}
|
|
|
|
. /opt/rh/gcc-toolset-10/enable
|
|
|
|
%endif
|
|
|
|
%make_build %{build_args}
|
|
|
|
|
|
|
|
%install
|
|
|
|
%make_install %{build_args}
|
|
|
|
# Overwrite absolute symlink with relative symlink
|
|
|
|
ln -srf %{buildroot}%{_bindir}/mold %{buildroot}%{_libexecdir}/mold/ld
|
|
|
|
chmod +x %{buildroot}%{_libdir}/mold/mold-wrapper.so
|
|
|
|
|
|
|
|
%post
|
|
|
|
if [ "$1" = 1 ]; then
|
|
|
|
%{_sbindir}/alternatives --install %{_bindir}/ld ld %{_bindir}/ld.mold 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
%postun
|
|
|
|
if [ "$1" = 0 ]; then
|
|
|
|
%{_sbindir}/alternatives --remove ld %{_bindir}/ld.mold
|
|
|
|
fi
|
|
|
|
|
|
|
|
%check
|
|
|
|
%if 0%{?el8}
|
|
|
|
. /opt/rh/gcc-toolset-10/enable
|
|
|
|
%endif
|
2022-02-23 05:43:19 +00:00
|
|
|
%make_build -j1 %{build_args} test
|
2022-01-25 18:46:31 +00:00
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSE
|
|
|
|
%ghost %{_bindir}/ld
|
|
|
|
%{_bindir}/mold
|
|
|
|
%{_bindir}/ld.mold
|
|
|
|
%{_bindir}/ld64.mold
|
|
|
|
%{_libdir}/mold
|
|
|
|
%{_libdir}/mold/mold-wrapper.so
|
|
|
|
%{_libexecdir}/mold
|
|
|
|
%{_libexecdir}/mold/ld
|
|
|
|
%{_mandir}/man1/mold.1*
|
|
|
|
|
|
|
|
%changelog
|
2022-04-16 15:16:35 +00:00
|
|
|
* Sat Apr 16 2022 Christoph Erhardt <fedora@sicherha.de> - 1.2-1
|
|
|
|
- Bump version to 1.2
|
|
|
|
- Drop upstreamed patches
|
|
|
|
- Set correct version of bundled tbb
|
|
|
|
- Suppress 'comparison between signed and unsigned' warnings
|
|
|
|
|
2022-03-08 21:47:04 +00:00
|
|
|
* Tue Mar 08 2022 Christoph Erhardt <fedora@sicherha.de> - 1.1.1-1
|
|
|
|
- Bump version to 1.1.1
|
|
|
|
|
2022-02-22 21:16:29 +00:00
|
|
|
* Mon Feb 21 2022 Christoph Erhardt <fedora@sicherha.de> - 1.1-1
|
|
|
|
- Bump version to 1.1
|
|
|
|
- Drop upstreamed patches
|
|
|
|
- Update description
|
|
|
|
|
2022-02-17 07:07:20 +00:00
|
|
|
* Thu Feb 17 2022 Christoph Erhardt <fedora@sicherha.de> - 1.0.2-2
|
|
|
|
- Rebuild due to mimalloc soname change
|
|
|
|
|
2022-01-25 18:46:31 +00:00
|
|
|
* Sun Jan 23 2022 Christoph Erhardt <fedora@sicherha.de> - 1.0.2-1
|
|
|
|
- Bump version to 1.0.2.
|
|
|
|
|
|
|
|
* Sat Jan 01 2022 Christoph Erhardt <fedora@sicherha.de> - 1.0.1-1
|
|
|
|
- Initial package for version 1.0.1.
|