2021-12-21 19:39:05 +01:00
|
|
|
#
|
|
|
|
# spec file for package mold
|
|
|
|
#
|
2022-01-04 19:37:29 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2021-12-21 19:39:05 +01:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2022-01-04 19:37:29 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2021-12-21 19:39:05 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: mold
|
2022-07-01 11:18:34 +02:00
|
|
|
Version: 1.3.1
|
2021-12-21 19:39:05 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: A Modern Linker (mold)
|
|
|
|
License: AGPL-3.0-or-later
|
2022-06-18 09:21:47 +02:00
|
|
|
Group: Development/Tools/Building
|
2022-01-04 19:37:29 +01:00
|
|
|
URL: https://github.com/rui314/mold
|
|
|
|
Source: https://github.com/rui314/mold/archive/v%{version}/mold-%{version}.tar.gz
|
2022-08-01 07:35:49 +02:00
|
|
|
Patch0: fix-tests.patch
|
|
|
|
ExclusiveArch: aarch64 %arm %ix86 x86_64 aarch64 riscv64
|
2021-12-21 19:39:05 +01:00
|
|
|
BuildRequires: cmake
|
2022-02-24 13:49:12 +01:00
|
|
|
%if %{suse_version} < 1550
|
|
|
|
BuildRequires: gcc10-c++
|
|
|
|
%else
|
2022-02-24 13:50:20 +01:00
|
|
|
# These libraries are not present for openSUSE Leap
|
2021-12-21 19:39:05 +01:00
|
|
|
BuildRequires: gcc-c++
|
2022-04-20 08:51:04 +02:00
|
|
|
BuildRequires: clang
|
2022-04-19 09:21:49 +02:00
|
|
|
BuildRequires: libdwarf-tools
|
2022-04-21 16:24:10 +02:00
|
|
|
BuildRequires: llvm
|
2022-04-20 09:01:37 +02:00
|
|
|
BuildRequires: llvm-gold
|
2022-01-04 19:37:29 +01:00
|
|
|
BuildRequires: tbb-devel
|
2022-04-20 08:53:47 +02:00
|
|
|
%ifarch x86_64
|
2022-04-20 08:53:26 +02:00
|
|
|
BuildRequires: gcc-32bit
|
|
|
|
%endif
|
2022-02-24 13:49:12 +01:00
|
|
|
%endif
|
2022-04-28 14:50:42 +02:00
|
|
|
BuildRequires: gdb
|
2022-04-19 08:44:11 +02:00
|
|
|
BuildRequires: glibc-devel-static
|
2022-02-24 13:49:12 +01:00
|
|
|
BuildRequires: openssl-devel
|
2022-05-05 13:17:20 +02:00
|
|
|
BuildRequires: valgrind
|
2021-12-21 19:39:05 +01:00
|
|
|
BuildRequires: xxhash-devel
|
|
|
|
BuildRequires: zlib-devel
|
|
|
|
PreReq: update-alternatives
|
|
|
|
|
2022-02-24 13:49:12 +01:00
|
|
|
%if %{suse_version} < 1550
|
2022-05-10 14:30:23 +02:00
|
|
|
%define build_args STRIP=true SYSTEM_XXHASH=1 USE_MIMALLOC=0
|
2022-02-24 13:49:12 +01:00
|
|
|
%else
|
2022-05-10 14:30:57 +02:00
|
|
|
%define build_args STRIP=true SYSTEM_TBB=1 SYSTEM_XXHASH=1 USE_MIMALLOC=0
|
2022-02-24 13:49:12 +01:00
|
|
|
%endif
|
2021-12-22 20:18:10 +01:00
|
|
|
|
2021-12-21 19:39:05 +01:00
|
|
|
%description
|
|
|
|
mold is a faster drop-in replacement for existing Unix linkers.
|
|
|
|
It is several times faster than LLVM lld linker, the second-fastest
|
|
|
|
open-source linker.
|
|
|
|
mold is created for increasing developer productivity by reducing
|
|
|
|
build time especially in rapid debug-edit-rebuild cycles.
|
|
|
|
|
|
|
|
%prep
|
2022-01-04 19:37:29 +01:00
|
|
|
%autosetup -p1
|
2021-12-21 19:39:05 +01:00
|
|
|
|
|
|
|
%build
|
2022-02-24 13:49:12 +01:00
|
|
|
%if %{suse_version} < 1550
|
|
|
|
export CC=gcc-10
|
|
|
|
export CXX=g++-10
|
|
|
|
%endif
|
2022-03-08 13:07:45 +01:00
|
|
|
export CXXFLAGS="%{optflags} -Wno-sign-compare"
|
2022-04-08 17:45:32 +02:00
|
|
|
|
|
|
|
%make_build -e \
|
|
|
|
CXXFLAGS="${CXXFLAGS}" \
|
|
|
|
LDFLAGS="${CXXFLAGS}" \
|
|
|
|
PREFIX=%{_prefix} \
|
|
|
|
BINDIR=%{_bindir} \
|
|
|
|
MANDIR=%{_mandir} \
|
|
|
|
LIBDIR=%{_libdir} \
|
|
|
|
LIBEXECDIR=%{_libexecdir} \
|
|
|
|
%{build_args}
|
|
|
|
|
2021-12-21 19:39:05 +01:00
|
|
|
%install
|
2022-04-08 17:45:32 +02:00
|
|
|
%make_install -e \
|
|
|
|
PREFIX=%{_prefix} \
|
|
|
|
BINDIR=%{_bindir} \
|
|
|
|
MANDIR=%{_mandir} \
|
|
|
|
LIBDIR=%{_libdir} \
|
|
|
|
LIBEXECDIR=%{_libexecdir} \
|
|
|
|
%{build_args}
|
2021-12-21 19:39:05 +01:00
|
|
|
|
2022-04-19 08:44:11 +02:00
|
|
|
%check
|
2022-05-13 11:31:45 +02:00
|
|
|
%if %{suse_version} < 1550
|
|
|
|
export TEST_CC=gcc-10
|
|
|
|
export TEST_CXX=g++-10
|
|
|
|
%endif
|
2022-04-20 09:01:37 +02:00
|
|
|
make test -k -e \
|
2022-04-19 08:44:11 +02:00
|
|
|
PREFIX=%{_prefix} \
|
|
|
|
BINDIR=%{_bindir} \
|
|
|
|
MANDIR=%{_mandir} \
|
|
|
|
LIBDIR=%{_libdir} \
|
|
|
|
LIBEXECDIR=%{_libexecdir} \
|
|
|
|
%{build_args}
|
|
|
|
|
2021-12-21 19:39:05 +01:00
|
|
|
%post
|
|
|
|
"%_sbindir/update-alternatives" --install \
|
|
|
|
"%_bindir/ld" ld "%_bindir/ld.mold" 1
|
|
|
|
|
|
|
|
%pre
|
|
|
|
if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then
|
|
|
|
"%_sbindir/update-alternatives" --remove ld "%_bindir/ld.mold";
|
|
|
|
fi;
|
|
|
|
|
|
|
|
%postun
|
|
|
|
if [ ! -f %{_bindir}/lld ] ; then
|
|
|
|
"%{_sbindir}/update-alternatives" --remove ld "%{_bindir}/ld.mold"
|
|
|
|
fi
|
|
|
|
|
|
|
|
%files
|
|
|
|
%ghost %_sysconfdir/alternatives/ld
|
|
|
|
%{_bindir}/mold
|
|
|
|
%{_bindir}/ld.mold
|
|
|
|
%{_bindir}/ld64.mold
|
|
|
|
%dir %{_libdir}/mold
|
2022-01-04 19:37:29 +01:00
|
|
|
%{_libexecdir}/mold/ld
|
|
|
|
%dir %{_libexecdir}/mold
|
2021-12-21 19:39:05 +01:00
|
|
|
%{_libdir}/mold/mold-wrapper.so
|
|
|
|
%{_mandir}/man1/mold.1.gz
|
|
|
|
|
|
|
|
%changelog
|