Accepting request 957341 from home:mathletic:branches:devel:tools:compiler

Fix building for openSuse Leap 15.3 and 15.4.

OBS-URL: https://build.opensuse.org/request/show/957341
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/mold?expand=0&rev=9
This commit is contained in:
Martin Liška 2022-02-24 12:49:12 +00:00 committed by Git OBS Bridge
parent 90538e3939
commit 7e3d1d3200
2 changed files with 26 additions and 2 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Feb 23 23:29:01 UTC 2022 - Christoph G <foss@grueninger.de>
- Fix building for openSuse Leap 15.3 and 15.4.
-------------------------------------------------------------------
Mon Feb 21 07:51:37 UTC 2022 - Martin Liška <mliska@suse.cz>

View File

@ -24,16 +24,24 @@ License: AGPL-3.0-or-later
URL: https://github.com/rui314/mold
Source: https://github.com/rui314/mold/archive/v%{version}/mold-%{version}.tar.gz
BuildRequires: cmake
# for openSuse Leap user newer versions or libraries from mold
%if %{suse_version} < 1550
BuildRequires: gcc10-c++
%else
BuildRequires: gcc-c++
BuildRequires: mimalloc-devel
BuildRequires: tbb-devel
%endif
BuildRequires: openssl-devel
BuildRequires: tbb-devel
BuildRequires: tbb-devel
BuildRequires: xxhash-devel
BuildRequires: zlib-devel
PreReq: update-alternatives
%if %{suse_version} < 1550
%define build_args SYSTEM_XXHASH=1
%else
%define build_args SYSTEM_TBB=1 SYSTEM_XXHASH=1 SYSTEM_MIMALLOC=1
%endif
%description
mold is a faster drop-in replacement for existing Unix linkers.
@ -46,8 +54,13 @@ build time especially in rapid debug-edit-rebuild cycles.
%autosetup -p1
%build
%if %{suse_version} < 1550
export CC=gcc-10
export CXX=g++-10
%else
export CC=gcc
export CXX=g++
%endif
export CFLAGS="%{optflags} -Wno-sign-compare"
export CXXFLAGS="${CFLAGS}"
export MANDIR=%{_mandir}
@ -78,8 +91,14 @@ fi
%{_bindir}/ld.mold
%{_bindir}/ld64.mold
%dir %{_libdir}/mold
%{_prefix}/libexec/mold/ld
%if %{suse_version} < 1550
%dir %{_prefix}/libexec
%dir %{_prefix}/libexec/mold
%else
%{_libexecdir}/mold/ld
%dir %{_libexecdir}/mold
%endif
%{_libdir}/mold/mold-wrapper.so
%{_mandir}/man1/mold.1.gz