From e52eee25255952daf02cf01a40162201ed0f32cf20493d24156d7232bef139b7 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 31 Mar 2022 09:27:56 +0000 Subject: [PATCH] Accepting request 965115 from home:aaronpuchert:branches:devel:tools - Fix build with armv7l on Leap: we have afl-llvm-rt-lto{,-32}.o. - Fix build with ppc64le: we don't seem to have the 32-bit object files available there and there is also no gcc-32bit. OBS-URL: https://build.opensuse.org/request/show/965115 OBS-URL: https://build.opensuse.org/package/show/devel:tools/afl?expand=0&rev=146 --- afl.changes | 7 +++++++ afl.spec | 40 +++++++++++++++++++++++++--------------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/afl.changes b/afl.changes index b40f004..b395183 100644 --- a/afl.changes +++ b/afl.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Feb 23 22:21:07 UTC 2022 - Aaron Puchert + +- Fix build with armv7l on Leap: we have afl-llvm-rt-lto{,-32}.o. +- Fix build with ppc64le: we don't seem to have the 32-bit object + files available there and there is also no gcc-32bit. + ------------------------------------------------------------------- Mon Jan 31 12:45:45 UTC 2022 - Marcus Meissner diff --git a/afl.spec b/afl.spec index 44b9127..52b7d1b 100644 --- a/afl.spec +++ b/afl.spec @@ -16,6 +16,25 @@ # +%ifarch riscv64 +%define afl_rt compiler-rt,llvm-rt +%else +%define afl_rt compiler-rt,llvm-rt,llvm-rt-lto +%endif + +%ifarch %{arm} %ix86 s390x x86_64 +%define afl_32 1 +%endif +%ifarch ppc64le +%if %{pkg_vcmp clang < 12} +%define afl_32 1 +%endif +%endif + +%ifarch aarch64 ppc64 ppc64le riscv64 s390x x86_64 +%define afl_64 1 +%endif + Name: afl Version: 4.00c Release: 0 @@ -82,25 +101,16 @@ chmod -x %{buildroot}/%{_libexecdir}/%{name}/*.o %dir %{_libexecdir}/%{name} %{_libexecdir}/%{name}/%{name}-as %{_libexecdir}/%{name}/as -%ifarch x86_64 aarch64 ppc64 ppc64le s390x riscv64 -%{_libexecdir}/%{name}/afl-compiler-rt-64.o -%{_libexecdir}/%{name}/afl-llvm-rt-64.o -%ifnarch riscv64 -%{_libexecdir}/%{name}/afl-llvm-rt-lto-64.o +%if 0%{?afl_64} +%{_libexecdir}/%{name}/afl-{%{afl_rt}}-64.o %endif +%if 0%{?afl_32} +%{_libexecdir}/%{name}/afl-{%{afl_rt}}-32.o %endif -%ifarch %ix86 %{arm} s390x ppc64le x86_64 -%{_libexecdir}/%{name}/afl-compiler-rt-32.o -%{_libexecdir}/%{name}/afl-llvm-rt-32.o -%endif -%ifarch %ix86 aarch64 s390x ppc64le x86_64 +%ifarch aarch64 %{_libexecdir}/%{name}/afl-llvm-rt-lto-32.o %endif -%{_libexecdir}/%{name}/afl-compiler-rt.o -%{_libexecdir}/%{name}/afl-llvm-rt.o -%ifnarch %{arm} riscv64 -%{_libexecdir}/%{name}/afl-llvm-rt-lto.o -%endif +%{_libexecdir}/%{name}/afl-{%{afl_rt}}.o %{_libexecdir}/%{name}/dynamic_list.txt %{_libexecdir}/%{name}/*.so %{_libexecdir}/%{name}/*.a