Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/lcov/, dev-util/lcov/files/
Date: Mon, 22 Oct 2018 20:07:50
Message-Id: 1540238721.f0d105746deac8824d3bb78125a306b78b29ecd1.mgorny@gentoo
1 commit: f0d105746deac8824d3bb78125a306b78b29ecd1
2 Author: Jeffrey Lin <jeffrey <AT> icurse <DOT> nl>
3 AuthorDate: Thu Oct 11 15:53:41 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 22 20:05:21 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0d10574
7
8 dev-util/lcov: add gcc 8 patch
9
10 Closes: https://bugs.gentoo.org/664454
11 Package-Manager: Portage-2.3.51, Repoman-2.3.11
12 Signed-off-by: Jeffrey Lin <jeffrey <AT> icurse.nl>
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 dev-util/lcov/files/lcov-1.13-gcc-8.patch | 91 ++++++++++++++++++++++
16 .../{lcov-1.13-r1.ebuild => lcov-1.13-r2.ebuild} | 4 +
17 2 files changed, 95 insertions(+)
18
19 diff --git a/dev-util/lcov/files/lcov-1.13-gcc-8.patch b/dev-util/lcov/files/lcov-1.13-gcc-8.patch
20 new file mode 100644
21 index 00000000000..b67ca411bda
22 --- /dev/null
23 +++ b/dev-util/lcov/files/lcov-1.13-gcc-8.patch
24 @@ -0,0 +1,91 @@
25 +From a5dd9529f9232b8d901a4d6eb9ae54cae179e5b3 Mon Sep 17 00:00:00 2001
26 +From: Peter Oberparleiter <oberpar@××××××××××××××.com>
27 +Date: Wed, 7 Mar 2018 14:18:55 +0100
28 +Subject: [PATCH] geninfo: Add gcc 8 support
29 +
30 +Fix errors and incorrect data when trying to collect coverage data
31 +for programs compiled with gcc 8.
32 +
33 +Covers the following gcov-related changes in gcc:
34 +
35 +.gcov-file format:
36 + - Line coverage data can appear multiple times for the same line
37 + - Line coverage count can be suffixed by '*' to indicated unexecuted
38 + basic blocks in that line
39 +
40 +.gcno-file format:
41 + - new header field 'support unexecuted blocks flag'
42 + - new function record fields 'column number', 'ending line number',
43 + and 'compiler-generated entity flag'
44 +
45 +Signed-off-by: Peter Oberparleiter <oberpar@××××××××××××××.com>
46 +---
47 + bin/geninfo | 20 ++++++++++++++++++++
48 + 1 file changed, 20 insertions(+)
49 +
50 +diff --git a/bin/geninfo b/bin/geninfo
51 +index 8562560..ef6a818 100755
52 +--- a/bin/geninfo
53 ++++ b/bin/geninfo
54 +@@ -68,6 +68,7 @@ our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
55 + our $gcov_tool = "gcov";
56 + our $tool_name = basename($0);
57 +
58 ++our $GCOV_VERSION_8_0_0 = 0x80000;
59 + our $GCOV_VERSION_4_7_0 = 0x40700;
60 + our $GCOV_VERSION_3_4_0 = 0x30400;
61 + our $GCOV_VERSION_3_3_0 = 0x30300;
62 +@@ -1934,6 +1935,9 @@ sub read_gcov_file($)
63 + {
64 + my ($count, $line, $code) = ($1, $2, $3);
65 +
66 ++ # Skip instance-specific counts
67 ++ next if ($line == $last_line);
68 ++
69 + $last_line = $line;
70 + $last_block = $UNNAMED_BLOCK;
71 + # Check for exclusion markers
72 +@@ -1963,6 +1967,9 @@ sub read_gcov_file($)
73 + }
74 + }
75 +
76 ++ # Strip unexecuted basic block marker
77 ++ $count =~ s/\*$//;
78 ++
79 + # <exec count>:<line number>:<source code>
80 + if ($line eq "0")
81 + {
82 +@@ -3537,6 +3544,10 @@ sub read_gcno_function_record(*$$$$$)
83 + graph_expect("function name");
84 + $function = read_gcno_string($handle, $big_endian);
85 + return undef if (!defined($function));
86 ++ if ($version >= $GCOV_VERSION_8_0_0) {
87 ++ graph_skip($handle, 4, "compiler-generated entity flag")
88 ++ or return undef;
89 ++ }
90 + # Read filename
91 + graph_expect("filename");
92 + $filename = read_gcno_string($handle, $big_endian);
93 +@@ -3544,6 +3555,11 @@ sub read_gcno_function_record(*$$$$$)
94 + # Read first line number
95 + $lineno = read_gcno_value($handle, $big_endian, "initial line number");
96 + return undef if (!defined($lineno));
97 ++ # Skip column and ending line number
98 ++ if ($version >= $GCOV_VERSION_8_0_0) {
99 ++ graph_skip($handle, 4, "column number") or return undef;
100 ++ graph_skip($handle, 4, "ending line number") or return undef;
101 ++ }
102 + # Add to list
103 + push(@{$bb->{$function}->{$filename}}, $lineno);
104 + graph_add_order($fileorder, $function, $filename);
105 +@@ -3631,6 +3647,10 @@ sub read_gcno($)
106 + debug(sprintf("found version 0x%08x\n", $version));
107 + # Skip stamp
108 + graph_skip(*HANDLE, 4, "file timestamp") or goto incomplete;
109 ++ if ($version >= $GCOV_VERSION_8_0_0) {
110 ++ graph_skip(*HANDLE, 4, "support unexecuted blocks flag")
111 ++ or goto incomplete;
112 ++ }
113 + while (!eof(HANDLE)) {
114 + my $next_pos;
115 + my $curr_pos;
116
117 diff --git a/dev-util/lcov/lcov-1.13-r1.ebuild b/dev-util/lcov/lcov-1.13-r2.ebuild
118 similarity index 94%
119 rename from dev-util/lcov/lcov-1.13-r1.ebuild
120 rename to dev-util/lcov/lcov-1.13-r2.ebuild
121 index cd55511f099..4d6f4df4381 100644
122 --- a/dev-util/lcov/lcov-1.13-r1.ebuild
123 +++ b/dev-util/lcov/lcov-1.13-r2.ebuild
124 @@ -25,6 +25,10 @@ RDEPEND="
125 png? ( dev-perl/GD[png] )
126 "
127
128 +PATCHES=(
129 + "${FILESDIR}/lcov-1.13-gcc-8.patch"
130 +)
131 +
132 src_prepare() {
133 default
134 if use prefix; then