Skip to content

Commit 42b55f5

Browse files
iignatevoberpar
authored andcommitted
geninfo: preserve-paths makes gcov to fail for long pathnames
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 <[email protected]>
1 parent 0433563 commit 42b55f5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bin/geninfo

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,12 @@ push(@gcov_options, "-c") if ($gcov_caps->{'branch-counts'} &&
468468
$br_coverage);
469469
push(@gcov_options, "-a") if ($gcov_caps->{'all-blocks'} &&
470470
$opt_gcov_all_blocks && $br_coverage);
471-
push(@gcov_options, "-p") if ($gcov_caps->{'preserve-paths'});
471+
if ($gcov_caps->{'hash-filenames'})
472+
{
473+
push(@gcov_options, "-x");
474+
} else {
475+
push(@gcov_options, "-p") if ($gcov_caps->{'preserve-paths'});
476+
}
472477

473478
# Determine compatibility modes
474479
parse_compat_modes($opt_compat);
@@ -3775,6 +3780,7 @@ sub get_gcov_capabilities()
37753780
'p' => 'preserve-paths',
37763781
'u' => 'unconditional-branches',
37773782
'v' => 'version',
3783+
'x' => 'hash-filenames',
37783784
);
37793785

37803786
foreach (split(/\n/, $help)) {

0 commit comments

Comments
 (0)