This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libgcov-driver-system bootstrap failure


On 06/06/2018 03:09 AM, David Edelsohn wrote:
> Also, there seems to be a find-and-replace mistake in libgcov-driver.c
> 
> #if !GCOV_LOCKED
>   /* summary for all instances of program.  */
>   struct gcov_summary *cs_all;
> #endif
> 
> cs_all is declared within the !GCOV_LOCKED macro
> 
> but later all references have been changed to "all", not "cs_all"
> 
> #if !GCOV_LOCKED
>   all = &all_prg->ctrs[t_ix];
> 
> and all_prg no longer has some of the members.  Was the !GCOV_LOCKED
> path not tested for the recent changes?

Hi.

Sorry for the breakage, I forgot to test !GCOV_LOCKED conditional compilation.
I'm sending patch candidate. I manually overwritten GCOV_LOCKED on my machine and
verified that gcov.exp tests work. And I also checked that gcov-dump prints correct
numbers.

I'll install the patch later if there are no objections.

Martin

> 
> Thanks, David
> 
> On Tue, Jun 5, 2018 at 8:28 PM David Edelsohn <dje.gcc@gmail.com> wrote:
>>
>> Martin,
>>
>> With your recent patch, I receive the following failure building
>> libgcov-driver-system.c
>>
>> In file included from
>> /nasfarm/edelsohn/src/src/gcc/../libgcc/libgcov-driver.c:322:0:
>> /nasfarm/edelsohn/src/src/gcc/../libgcc/libgcov-driver-system.c: In
>> function 'char* replace_filename_variables(char*)':
>> /nasfarm/edelsohn/src/src/gcc/../libgcc/libgcov-driver-system.c:193:61:
>> error: 'mempcpy' was not declared in this scope
>>     buffer_ptr = (char *)mempcpy (buffer_ptr, filename, start);
>>
>> mempcpy is a GLIBC extension and not defined in POSIX.  There is no
>> libiberty implementation.  Please avoid use of GLIBC-specific
>> functions.
>>
>> Thanks, David

>From d1913b67feed71614a3d687c9288297d6b4a200a Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 6 Jun 2018 11:02:17 +0200
Subject: [PATCH] Fix compilation of libgcov with GCOV_LOCKED=0.

libgcc/ChangeLog:

2018-06-06  Martin Liska  <mliska@suse.cz>

	* libgcov-driver.c: Rename cs_all to all and assign it from
        all_prg.
---
 libgcc/libgcov-driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libgcc/libgcov-driver.c b/libgcc/libgcov-driver.c
index 922d9dde833..d718942978b 100644
--- a/libgcc/libgcov-driver.c
+++ b/libgcc/libgcov-driver.c
@@ -581,7 +581,7 @@ merge_summary (const char *filename __attribute__ ((unused)), int run_counted,
 {
 #if !GCOV_LOCKED 
   /* summary for all instances of program.  */ 
-  struct gcov_summary *cs_all;
+  struct gcov_summary *all;
 #endif 
 
   /* Merge the summary.  */
@@ -601,7 +601,7 @@ merge_summary (const char *filename __attribute__ ((unused)), int run_counted,
   else
     gcov_histogram_merge (prg->histogram, this_prg->histogram);
 #if !GCOV_LOCKED
-  all = &all_prg->ctrs[t_ix];
+  all = all_prg;
   if (!all->runs && prg->runs)
     {
       all->num = prg->num;
-- 
2.17.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]