Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37842127
en ru br
Репозитории ALT

Группа :: Development/Tools
Пакет: mold

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%define _unpackaged_files_terminate_build 1
%define _stripped_files_terminate_build 1

# gcc is broken for these architectures.

# See: https://github.com/rui314/mold/issues/358
%ifarch %ix86 %arm
%def_without check
%else
%def_with check
%endif

%def_without third_party
%def_with lto
%def_with strict

%define _libexecdir %prefix/libexec

Name: mold
Version: 2.1.0
Release: alt1

Summary: A Modern Linker
License: MIT
Group: Development/Tools
Url: https://github.com/rui314/mold
Vcs: https://github.com/rui314/mold

Source0: %name-%version.tar

BuildRequires(pre): rpm-macros-cmake
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libstdc++-devel
BuildRequires: libssl-devel
BuildRequires: libzstd-devel
BuildRequires: zlib-devel

%if_without third_party
BuildRequires: libmimalloc-devel
BuildRequires: tbb-devel
BuildRequires: libxxhash-devel
%endif

%if_with check
BuildRequires(pre): /proc
BuildRequires: ctest
%endif

%description
mold is a faster drop-in replacement for existing Unix linkers.
It is several times quicker than the LLVM lld linker,
the second-fastest open-source linker.
mold aims to enhance developer productivity by minimizing build time,
particularly in rapid debug-edit-rebuild cycles.

%prep
%setup

# Sse system zstd and zlib always.

rm -rfv third-party/{zlib,zstd}

%if_without third_party
rm -rfv third-party/{mimalloc,tbb,xxhash}
# Use system xxhash.
sed -i "/xxhash.h/s/.*/#include <xxhash.h>/" common/common.h
%endif

%build
%if_with strict
%set_verify_elf_method strict
%add_optflags -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
%endif

%cmake \
       -DCMAKE_BUILD_TYPE=RelWithDebInfo \
%if_with lto
-DMOLD_LTO=ON \
%endif
%if_without third_party
-DMOLD_USE_MIMALLOC=ON \
-DMOLD_USE_SYSTEM_MIMALLOC=ON \
-DMOLD_USE_SYSTEM_TBB=ON \
%endif
%if_with check
-DBUILD_TESTING=ON \
%endif
%nil
%cmake_build

%install
%cmake_install

# Remove wrong-installed license file.

rm -rfv %buildroot%_docdir/mold

%check
%ctest

%files
%doc LICENSE
%_bindir/*mold
%_libdir/mold/
%_libexecdir/mold/
%_man1dir/*mold.1.*

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin