summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Lin <jeffrey@icurse.nl>2018-10-11 11:53:41 -0400
committerMichał Górny <mgorny@gentoo.org>2018-10-22 22:05:21 +0200
commitf0d105746deac8824d3bb78125a306b78b29ecd1 (patch)
tree3443ddfc7f4736e1b060200a025ec628dbd29be1 /dev-util/lcov
parentdev-util/lcov: add version -9999 (diff)
downloadgentoo-f0d105746deac8824d3bb78125a306b78b29ecd1.tar.gz
gentoo-f0d105746deac8824d3bb78125a306b78b29ecd1.tar.bz2
gentoo-f0d105746deac8824d3bb78125a306b78b29ecd1.zip
dev-util/lcov: add gcc 8 patch
Closes: https://bugs.gentoo.org/664454 Package-Manager: Portage-2.3.51, Repoman-2.3.11 Signed-off-by: Jeffrey Lin <jeffrey@icurse.nl> Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-util/lcov')
-rw-r--r--dev-util/lcov/files/lcov-1.13-gcc-8.patch91
-rw-r--r--dev-util/lcov/lcov-1.13-r2.ebuild (renamed from dev-util/lcov/lcov-1.13-r1.ebuild)4
2 files changed, 95 insertions, 0 deletions
diff --git a/dev-util/lcov/files/lcov-1.13-gcc-8.patch b/dev-util/lcov/files/lcov-1.13-gcc-8.patch
new file mode 100644
index 000000000000..b67ca411bdaf
--- /dev/null
+++ b/dev-util/lcov/files/lcov-1.13-gcc-8.patch
@@ -0,0 +1,91 @@
+From a5dd9529f9232b8d901a4d6eb9ae54cae179e5b3 Mon Sep 17 00:00:00 2001
+From: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
+Date: Wed, 7 Mar 2018 14:18:55 +0100
+Subject: [PATCH] geninfo: Add gcc 8 support
+
+Fix errors and incorrect data when trying to collect coverage data
+for programs compiled with gcc 8.
+
+Covers the following gcov-related changes in gcc:
+
+.gcov-file format:
+ - Line coverage data can appear multiple times for the same line
+ - Line coverage count can be suffixed by '*' to indicated unexecuted
+ basic blocks in that line
+
+.gcno-file format:
+ - new header field 'support unexecuted blocks flag'
+ - new function record fields 'column number', 'ending line number',
+ and 'compiler-generated entity flag'
+
+Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
+---
+ bin/geninfo | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/bin/geninfo b/bin/geninfo
+index 8562560..ef6a818 100755
+--- a/bin/geninfo
++++ b/bin/geninfo
+@@ -68,6 +68,7 @@ our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
+ our $gcov_tool = "gcov";
+ our $tool_name = basename($0);
+
++our $GCOV_VERSION_8_0_0 = 0x80000;
+ our $GCOV_VERSION_4_7_0 = 0x40700;
+ our $GCOV_VERSION_3_4_0 = 0x30400;
+ our $GCOV_VERSION_3_3_0 = 0x30300;
+@@ -1934,6 +1935,9 @@ sub read_gcov_file($)
+ {
+ my ($count, $line, $code) = ($1, $2, $3);
+
++ # Skip instance-specific counts
++ next if ($line == $last_line);
++
+ $last_line = $line;
+ $last_block = $UNNAMED_BLOCK;
+ # Check for exclusion markers
+@@ -1963,6 +1967,9 @@ sub read_gcov_file($)
+ }
+ }
+
++ # Strip unexecuted basic block marker
++ $count =~ s/\*$//;
++
+ # <exec count>:<line number>:<source code>
+ if ($line eq "0")
+ {
+@@ -3537,6 +3544,10 @@ sub read_gcno_function_record(*$$$$$)
+ graph_expect("function name");
+ $function = read_gcno_string($handle, $big_endian);
+ return undef if (!defined($function));
++ if ($version >= $GCOV_VERSION_8_0_0) {
++ graph_skip($handle, 4, "compiler-generated entity flag")
++ or return undef;
++ }
+ # Read filename
+ graph_expect("filename");
+ $filename = read_gcno_string($handle, $big_endian);
+@@ -3544,6 +3555,11 @@ sub read_gcno_function_record(*$$$$$)
+ # Read first line number
+ $lineno = read_gcno_value($handle, $big_endian, "initial line number");
+ return undef if (!defined($lineno));
++ # Skip column and ending line number
++ if ($version >= $GCOV_VERSION_8_0_0) {
++ graph_skip($handle, 4, "column number") or return undef;
++ graph_skip($handle, 4, "ending line number") or return undef;
++ }
+ # Add to list
+ push(@{$bb->{$function}->{$filename}}, $lineno);
+ graph_add_order($fileorder, $function, $filename);
+@@ -3631,6 +3647,10 @@ sub read_gcno($)
+ debug(sprintf("found version 0x%08x\n", $version));
+ # Skip stamp
+ graph_skip(*HANDLE, 4, "file timestamp") or goto incomplete;
++ if ($version >= $GCOV_VERSION_8_0_0) {
++ graph_skip(*HANDLE, 4, "support unexecuted blocks flag")
++ or goto incomplete;
++ }
+ while (!eof(HANDLE)) {
+ my $next_pos;
+ my $curr_pos;
diff --git a/dev-util/lcov/lcov-1.13-r1.ebuild b/dev-util/lcov/lcov-1.13-r2.ebuild
index cd55511f0993..4d6f4df43817 100644
--- a/dev-util/lcov/lcov-1.13-r1.ebuild
+++ b/dev-util/lcov/lcov-1.13-r2.ebuild
@@ -25,6 +25,10 @@ RDEPEND="
png? ( dev-perl/GD[png] )
"
+PATCHES=(
+ "${FILESDIR}/lcov-1.13-gcc-8.patch"
+)
+
src_prepare() {
default
if use prefix; then