diff --git a/0001-fix-some-m32-compilation-issues-type-casting.patch b/0001-fix-some-m32-compilation-issues-type-casting.patch new file mode 100644 index 0000000..b6ff47d --- /dev/null +++ b/0001-fix-some-m32-compilation-issues-type-casting.patch @@ -0,0 +1,49 @@ +From aa1c3ccd0f9e2ed884ba877f2153b40c1448e6b9 Mon Sep 17 00:00:00 2001 +From: Robert Swiecki +Date: Thu, 5 Mar 2020 14:40:05 +0100 +Subject: [PATCH] fix some -m32 compilation issues (type casting) + +--- + linux/trace.c | 4 ++-- + report.c | 3 +-- + 2 files changed, 3 insertions(+), 4 deletions(-) + +diff --git a/linux/trace.c b/linux/trace.c +index 5a99363..3a22234 100644 +--- a/linux/trace.c ++++ b/linux/trace.c +@@ -531,7 +531,7 @@ static void arch_traceSaveData(run_t* run, pid_t pid) { + PLOG_W("Couldn't get siginfo for pid %d", pid); + } + +- uint64_t crashAddr = (uint64_t)si.si_addr; ++ uint64_t crashAddr = (uint64_t)(uintptr_t)si.si_addr; + /* User-induced signals don't set si.si_addr */ + if (SI_FROMUSER(&si)) { + crashAddr = 0UL; +@@ -571,7 +571,7 @@ static void arch_traceSaveData(run_t* run, pid_t pid) { + " instr: '%s'", + pid, si.si_signo, si.si_errno, si.si_code, si.si_addr, pc, crashAddr, instr); + +- if (!SI_FROMUSER(&si) && pc && crashAddr < (uint64_t)run->global->linux.ignoreAddr) { ++ if (!SI_FROMUSER(&si) && pc && crashAddr < (uint64_t)(uintptr_t)run->global->linux.ignoreAddr) { + LOG_I("Input is interesting (%s), but the si.si_addr is %p (below %p), skipping", + util_sigName(si.si_signo), si.si_addr, run->global->linux.ignoreAddr); + return; +diff --git a/report.c b/report.c +index 65af26d..383b273 100644 +--- a/report.c ++++ b/report.c +@@ -146,8 +146,7 @@ void report_appendReport(pid_t pid, run_t* run, funcs_t* funcs, size_t funcCnt, + run->report, sizeof(run->report), "STACK HASH: %016" PRIx64 "\n", run->backtrace); + util_ssnprintf(run->report, sizeof(run->report), "STACK:\n"); + for (size_t i = 0; i < funcCnt; i++) { +- util_ssnprintf( +- run->report, sizeof(run->report), " <0x%016" PRIx64 "> ", (uint64_t)funcs[i].pc); ++ util_ssnprintf(run->report, sizeof(run->report), " <0x%016tx> ", (uintptr_t)funcs[i].pc); + util_ssnprintf(run->report, sizeof(run->report), "[func:%s file:%s line:%zu module:%s]\n", + funcs[i].func, funcs[i].file, funcs[i].line, funcs[i].module); + } +-- +2.25.1 + diff --git a/honggfuzz.changes b/honggfuzz.changes index 805e0a4..c1888fb 100644 --- a/honggfuzz.changes +++ b/honggfuzz.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Mar 18 22:57:55 UTC 2020 - Christophe Giboudeaux + +- Add upstream patch to fix the i586 build: + * 0001-fix-some-m32-compilation-issues-type-casting.patch + ------------------------------------------------------------------- Tue Mar 17 13:07:16 UTC 2020 - Martin Pluskal diff --git a/honggfuzz.spec b/honggfuzz.spec index ea06013..e97cc7a 100644 --- a/honggfuzz.spec +++ b/honggfuzz.spec @@ -24,6 +24,7 @@ License: Apache-2.0 Group: Development/Tools/Other URL: https://honggfuzz.com Source: https://github.com/google/honggfuzz/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Patch0: 0001-fix-some-m32-compilation-issues-type-casting.patch BuildRequires: binutils-devel BuildRequires: libunwind-devel BuildRequires: zlib-devel @@ -35,6 +36,7 @@ evolutionary, feedback-driven fuzzing based on code coverage %prep %setup -q +%patch0 -p1 %build export CFLAGS="%{optflags}"