1 |
commit: f1e6f1643f65825fbb71126a9aa58050adb9df27 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Oct 4 23:15:59 2018 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Oct 4 23:15:59 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1e6f164 |
7 |
|
8 |
dev-util/ltrace: fix print-instruction-pointer test |
9 |
|
10 |
print-instruction-pointer occasionally fails when |
11 |
kernel loads test at address that does not match |
12 |
last 4 digits of 'objdump' output. |
13 |
|
14 |
On x86_64 page size is 4096 bytes (0x1000). This gives |
15 |
only 3 digits of stable address. |
16 |
|
17 |
The change picks last 3 digits from objdump address. |
18 |
|
19 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
20 |
Package-Manager: Portage-2.3.50, Repoman-2.3.11 |
21 |
|
22 |
dev-util/ltrace/files/ltrace-0.7.3-print-test-pie.patch | 15 +++++++++++++++ |
23 |
dev-util/ltrace/ltrace-0.7.3_p4.ebuild | 3 ++- |
24 |
2 files changed, 17 insertions(+), 1 deletion(-) |
25 |
|
26 |
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 |
27 |
new file mode 100644 |
28 |
index 00000000000..5e46135add3 |
29 |
--- /dev/null |
30 |
+++ b/dev-util/ltrace/files/ltrace-0.7.3-print-test-pie.patch |
31 |
@@ -0,0 +1,15 @@ |
32 |
+--- a/testsuite/ltrace.minor/print-instruction-pointer.exp |
33 |
++++ b/testsuite/ltrace.minor/print-instruction-pointer.exp |
34 |
+@@ -32,6 +32,12 @@ catch "exec sh -c {objdump -d $objdir/$subdir/$binfile | sed -n '/^\[0-9a-fA-F\] |
35 |
+ catch "exec sh -c {echo \"$output\" | sed -n '2p'| awk -F' ' '{print \$1}'|awk -F: '{print \$1}'}" addr1 |
36 |
+ catch "exec sh -c {echo \"$output\" | sed -n '5p'| awk -F' ' '{print \$1}'|awk -F: '{print \$1}'}" addr2 |
37 |
+ |
38 |
++# Pick at most last 3 digits: |
39 |
++# PIE binaries randomize address on page level. |
40 |
++# Let's assume page size is no bigger than 4096 (3 hex digits) |
41 |
++set addr1 [string range $addr1 3 end] |
42 |
++set addr2 [string range $addr2 3 end] |
43 |
++ |
44 |
+ verbose "addr1 = $addr1" |
45 |
+ verbose "addr2 = $addr2" |
46 |
+ # Verify the output by checking numbers of print in main.ltrace. |
47 |
|
48 |
diff --git a/dev-util/ltrace/ltrace-0.7.3_p4.ebuild b/dev-util/ltrace/ltrace-0.7.3_p4.ebuild |
49 |
index b8d3442e1c1..158e5871be7 100644 |
50 |
--- a/dev-util/ltrace/ltrace-0.7.3_p4.ebuild |
51 |
+++ b/dev-util/ltrace/ltrace-0.7.3_p4.ebuild |
52 |
@@ -1,4 +1,4 @@ |
53 |
-# Copyright 1999-2018 Gentoo Foundation |
54 |
+# Copyright 1999-2018 Gentoo Authors |
55 |
# Distributed under the terms of the GNU General Public License v2 |
56 |
|
57 |
EAPI=5 |
58 |
@@ -33,6 +33,7 @@ src_prepare() { |
59 |
epatch "${FILESDIR}"/${PN}-0.7.3-test-protos.patch #bug 421649 |
60 |
epatch "${FILESDIR}"/${PN}-0.7.3-alpha-protos.patch |
61 |
epatch "${FILESDIR}"/${PN}-0.7.3-ia64.patch |
62 |
+ epatch "${FILESDIR}"/${PN}-0.7.3-print-test-pie.patch |
63 |
sed -i '/^dist_doc_DATA/d' Makefile.am || die |
64 |
eautoreconf |
65 |
} |