summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2022-09-19 21:36:53 +0100
committerMarek Szuba <marecki@gentoo.org>2022-09-19 21:39:10 +0100
commitc882ddbf58031c073f6cfd1ae77063cc7542cf89 (patch)
treecbcb83499b6710ede3c4803845852bdeb4f186e5 /app-forensics
parentdev-python/pyzmq: Stabilize 23.2.1 ppc, #871795 (diff)
downloadgentoo-c882ddbf58031c073f6cfd1ae77063cc7542cf89.tar.gz
gentoo-c882ddbf58031c073f6cfd1ae77063cc7542cf89.tar.bz2
gentoo-c882ddbf58031c073f6cfd1ae77063cc7542cf89.zip
app-forensics/honggfuzz: support binutils-2.39
Backported upstream fix from their git master. Closes: https://bugs.gentoo.org/868126 Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'app-forensics')
-rw-r--r--app-forensics/honggfuzz/files/honggfuzz-2.5_binutils239.patch51
-rw-r--r--app-forensics/honggfuzz/honggfuzz-2.5-r1.ebuild (renamed from app-forensics/honggfuzz/honggfuzz-2.5.ebuild)3
2 files changed, 53 insertions, 1 deletions
diff --git a/app-forensics/honggfuzz/files/honggfuzz-2.5_binutils239.patch b/app-forensics/honggfuzz/files/honggfuzz-2.5_binutils239.patch
new file mode 100644
index 000000000000..af574bc495a0
--- /dev/null
+++ b/app-forensics/honggfuzz/files/honggfuzz-2.5_binutils239.patch
@@ -0,0 +1,51 @@
+From 23c3da7ea63e4a841fa0e181d173e16b437adff0 Mon Sep 17 00:00:00 2001
+From: Robert Swiecki <robert@swiecki.net>
+Date: Thu, 2 Jun 2022 23:17:49 +0200
+Subject: [PATCH] Always pass 4 arguments to init_disassemble_info(), no matter
+ what's the declaration. binutils/libopcode offers an unstable interface
+
+---
+ linux/bfd.c | 23 +++++++++++++++++++++--
+ 1 file changed, 21 insertions(+), 2 deletions(-)
+
+diff --git a/linux/bfd.c b/linux/bfd.c
+index 228365f69..236f050ec 100644
+--- a/linux/bfd.c
++++ b/linux/bfd.c
+@@ -197,6 +197,24 @@ static int arch_bfdFPrintF(void* buf, const char* fmt, ...) {
+ return ret;
+ }
+
++static int arch_bfdFPrintFStyled(void* buf, int style HF_ATTR_UNUSED, const char* fmt, ...) {
++ va_list args;
++ va_start(args, fmt);
++ int ret = util_vssnprintf(buf, _HF_INSTR_SZ, fmt, args);
++ va_end(args);
++
++ return ret;
++}
++
++/*
++ * binutils/libopcode has an unstable public interface. At some point in time the function
++ * init_disassemble_info() started taking 4 arguments instead of 3. Always pass 4 arguments to it,
++ * no matter what's the declaration.
++ */
++static void arch_bfdInitDisassembleInfoStub(
++ struct disassemble_info* info, char* instr, void* bfd_printf_func, void* bfd_printf_styled_func)
++ __attribute__((weakref, alias("init_disassemble_info")));
++
+ void arch_bfdDisasm(pid_t pid, uint8_t* mem, size_t size, char* instr) {
+ MX_SCOPED_LOCK(&arch_bfd_mutex);
+
+@@ -227,8 +245,9 @@ void arch_bfdDisasm(pid_t pid, uint8_t* mem, size_t size, char* instr) {
+ return;
+ }
+
+- struct disassemble_info info;
+- init_disassemble_info(&info, instr, arch_bfdFPrintF);
++ struct disassemble_info info = {};
++
++ arch_bfdInitDisassembleInfoStub(&info, instr, arch_bfdFPrintF, arch_bfdFPrintFStyled);
+ info.arch = bfd_get_arch(bfdh);
+ info.mach = bfd_get_mach(bfdh);
+ info.buffer = mem;
diff --git a/app-forensics/honggfuzz/honggfuzz-2.5.ebuild b/app-forensics/honggfuzz/honggfuzz-2.5-r1.ebuild
index 69db69f71a79..54fe2dc7889f 100644
--- a/app-forensics/honggfuzz/honggfuzz-2.5.ebuild
+++ b/app-forensics/honggfuzz/honggfuzz-2.5-r1.ebuild
@@ -15,7 +15,7 @@ KEYWORDS="~amd64"
IUSE="clang"
RDEPEND="
- <sys-libs/binutils-libs-2.39:=
+ >=sys-libs/binutils-libs-2.29:=
sys-libs/libunwind:=
app-arch/xz-utils
clang? ( sys-libs/blocksruntime )
@@ -33,6 +33,7 @@ DOCS=(
PATCHES=(
"${FILESDIR}"/${PN}-2.0-no-werror.patch
+ "${FILESDIR}"/${PN}-2.5_binutils239.patch
)
pkg_pretend() {