1 |
commit: 7a7ae297c5ad2ebaa8bd77398dcf5f3c8f48d5fa |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Feb 2 11:28:11 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 2 11:28:57 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a7ae297 |
7 |
|
8 |
app-forensics/honggfuzz: tweak for binutils-2.34, bug #707846 |
9 |
|
10 |
Reported-by: Toralf Förster |
11 |
Closes: https://bugs.gentoo.org/707846 |
12 |
Package-Manager: Portage-2.3.87, Repoman-2.3.20 |
13 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
14 |
|
15 |
.../files/honggfuzz-2.0-binutils-2.34.patch | 22 ++++++++++++++++++++++ |
16 |
app-forensics/honggfuzz/honggfuzz-2.0.ebuild | 10 +++++++++- |
17 |
2 files changed, 31 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/app-forensics/honggfuzz/files/honggfuzz-2.0-binutils-2.34.patch b/app-forensics/honggfuzz/files/honggfuzz-2.0-binutils-2.34.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..45da65c1c6d |
22 |
--- /dev/null |
23 |
+++ b/app-forensics/honggfuzz/files/honggfuzz-2.0-binutils-2.34.patch |
24 |
@@ -0,0 +1,22 @@ |
25 |
+--- a/linux/bfd.c |
26 |
++++ b/linux/bfd.c |
27 |
+@@ -122,8 +122,8 @@ void arch_bfdDemangle(funcs_t* funcs, size_t funcCnt) { |
28 |
+ |
29 |
+ static struct bfd_section* arch_getSectionForPc(bfd* bfdh, uint64_t pc) { |
30 |
+ for (struct bfd_section* section = bfdh->sections; section; section = section->next) { |
31 |
+- uintptr_t vma = (uintptr_t)bfd_get_section_vma(bfdh, section); |
32 |
+- uintptr_t sz = (uintptr_t)bfd_get_section_size(section); |
33 |
++ uintptr_t vma = (uintptr_t)bfd_section_vma(section); |
34 |
++ uintptr_t sz = (uintptr_t)bfd_section_size(section); |
35 |
+ if ((pc > vma) && (pc < (vma + sz))) { |
36 |
+ return section; |
37 |
+ } |
38 |
+@@ -160,7 +160,7 @@ void arch_bfdResolveSyms(pid_t pid, funcs_t* funcs, size_t num) { |
39 |
+ continue; |
40 |
+ } |
41 |
+ |
42 |
+- long sec_offset = (long)funcs[i].pc - bfd_get_section_vma(bfdParams.bfdh, section); |
43 |
++ long sec_offset = (long)funcs[i].pc - bfd_section_vma(section); |
44 |
+ |
45 |
+ if (bfd_find_nearest_line( |
46 |
+ bfdParams.bfdh, section, bfdParams.syms, sec_offset, &file, &func, &line) == TRUE) { |
47 |
|
48 |
diff --git a/app-forensics/honggfuzz/honggfuzz-2.0.ebuild b/app-forensics/honggfuzz/honggfuzz-2.0.ebuild |
49 |
index f486d019eb3..f58c1b9e7c8 100644 |
50 |
--- a/app-forensics/honggfuzz/honggfuzz-2.0.ebuild |
51 |
+++ b/app-forensics/honggfuzz/honggfuzz-2.0.ebuild |
52 |
@@ -1,4 +1,4 @@ |
53 |
-# Copyright 1999-2019 Gentoo Authors |
54 |
+# Copyright 1999-2020 Gentoo Authors |
55 |
# Distributed under the terms of the GNU General Public License v2 |
56 |
|
57 |
EAPI=7 |
58 |
@@ -33,6 +33,14 @@ PATCHES=( |
59 |
"${FILESDIR}"/${PN}-1.1-binutils-2.29.patch |
60 |
) |
61 |
|
62 |
+src_prepare() { |
63 |
+ default |
64 |
+ |
65 |
+ if has_version ">=sys-libs/binutils-libs-2.34"; then |
66 |
+ eapply "${FILESDIR}"/${PN}-2.0-binutils-2.34.patch |
67 |
+ fi |
68 |
+} |
69 |
+ |
70 |
src_compile() { |
71 |
CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" emake |
72 |
} |