Skip to content

Commit

Permalink
geninfo: preserve-paths makes gcov to fail for long pathnames
Browse files Browse the repository at this point in the history
geninfo uses '--preserve-paths' gcov option whenever gcov supports it, this
forces gcov to use a whole pathname as a filename for .gcov files. So in cases
of quite large pathnames, gcov isn't able to create .gcov files and hence
geninfo can't get any data. The fix replaces usage '--preserve-paths' with
'--hash-filenames' when it is available.

Signed-off-by: Igor Ignatev <igor.v.ignatiev@gmail.com>
  • Loading branch information
iignatev committed Feb 8, 2019
1 parent 0433563 commit f13e775
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/geninfo
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,12 @@ push(@gcov_options, "-c") if ($gcov_caps->{'branch-counts'} &&
$br_coverage);
push(@gcov_options, "-a") if ($gcov_caps->{'all-blocks'} &&
$opt_gcov_all_blocks && $br_coverage);
push(@gcov_options, "-p") if ($gcov_caps->{'preserve-paths'});
if ($gcov_caps->{'hash-filenames'})
{
push(@gcov_options, "-x");
} else {
push(@gcov_options, "-p") if ($gcov_caps->{'preserve-paths'});
}

# Determine compatibility modes
parse_compat_modes($opt_compat);
Expand Down Expand Up @@ -3775,6 +3780,7 @@ sub get_gcov_capabilities()
'p' => 'preserve-paths',
'u' => 'unconditional-branches',
'v' => 'version',
'x' => 'hash-filenames',
);

foreach (split(/\n/, $help)) {
Expand Down

0 comments on commit f13e775

Please sign in to comment.