From 7e3d1d32002d7f0046459410f5572e648e9ee475d0767d297e341bb98650f148 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Li=C5=A1ka?= Date: Thu, 24 Feb 2022 12:49:12 +0000 Subject: [PATCH] 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 --- mold.changes | 5 +++++ mold.spec | 23 +++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/mold.changes b/mold.changes index 9d355dd..96b5917 100644 --- a/mold.changes +++ b/mold.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Feb 23 23:29:01 UTC 2022 - Christoph G + +- Fix building for openSuse Leap 15.3 and 15.4. + ------------------------------------------------------------------- Mon Feb 21 07:51:37 UTC 2022 - Martin Liška diff --git a/mold.spec b/mold.spec index b5b43bf..2639248 100644 --- a/mold.spec +++ b/mold.spec @@ -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