summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2018-10-05 00:15:59 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2018-10-05 00:15:59 +0100
commitf1e6f1643f65825fbb71126a9aa58050adb9df27 (patch)
tree4d32e382c7b63ba13bb98a1e018060a04d24db0c /dev-util/ltrace
parentmedia-gfx/digikam: Move virtual/mysql to RDEPEND-only (diff)
downloadgentoo-f1e6f1643f65825fbb71126a9aa58050adb9df27.tar.gz
gentoo-f1e6f1643f65825fbb71126a9aa58050adb9df27.tar.bz2
gentoo-f1e6f1643f65825fbb71126a9aa58050adb9df27.zip
dev-util/ltrace: fix print-instruction-pointer test
print-instruction-pointer occasionally fails when kernel loads test at address that does not match last 4 digits of 'objdump' output. On x86_64 page size is 4096 bytes (0x1000). This gives only 3 digits of stable address. The change picks last 3 digits from objdump address. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Package-Manager: Portage-2.3.50, Repoman-2.3.11
Diffstat (limited to 'dev-util/ltrace')
-rw-r--r--dev-util/ltrace/files/ltrace-0.7.3-print-test-pie.patch15
-rw-r--r--dev-util/ltrace/ltrace-0.7.3_p4.ebuild3
2 files changed, 17 insertions, 1 deletions
diff --git a/dev-util/ltrace/files/ltrace-0.7.3-print-test-pie.patch b/dev-util/ltrace/files/ltrace-0.7.3-print-test-pie.patch
new file mode 100644
index 000000000000..5e46135add3e
--- /dev/null
+++ b/dev-util/ltrace/files/ltrace-0.7.3-print-test-pie.patch
@@ -0,0 +1,15 @@
+--- a/testsuite/ltrace.minor/print-instruction-pointer.exp
++++ b/testsuite/ltrace.minor/print-instruction-pointer.exp
+@@ -32,6 +32,12 @@ catch "exec sh -c {objdump -d $objdir/$subdir/$binfile | sed -n '/^\[0-9a-fA-F\]
+ catch "exec sh -c {echo \"$output\" | sed -n '2p'| awk -F' ' '{print \$1}'|awk -F: '{print \$1}'}" addr1
+ catch "exec sh -c {echo \"$output\" | sed -n '5p'| awk -F' ' '{print \$1}'|awk -F: '{print \$1}'}" addr2
+
++# Pick at most last 3 digits:
++# PIE binaries randomize address on page level.
++# Let's assume page size is no bigger than 4096 (3 hex digits)
++set addr1 [string range $addr1 3 end]
++set addr2 [string range $addr2 3 end]
++
+ verbose "addr1 = $addr1"
+ verbose "addr2 = $addr2"
+ # Verify the output by checking numbers of print in main.ltrace.
diff --git a/dev-util/ltrace/ltrace-0.7.3_p4.ebuild b/dev-util/ltrace/ltrace-0.7.3_p4.ebuild
index b8d3442e1c11..158e5871be76 100644
--- a/dev-util/ltrace/ltrace-0.7.3_p4.ebuild
+++ b/dev-util/ltrace/ltrace-0.7.3_p4.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=5
@@ -33,6 +33,7 @@ src_prepare() {
epatch "${FILESDIR}"/${PN}-0.7.3-test-protos.patch #bug 421649
epatch "${FILESDIR}"/${PN}-0.7.3-alpha-protos.patch
epatch "${FILESDIR}"/${PN}-0.7.3-ia64.patch
+ epatch "${FILESDIR}"/${PN}-0.7.3-print-test-pie.patch
sed -i '/^dist_doc_DATA/d' Makefile.am || die
eautoreconf
}