Fix build with inhibit_libc (was Re: [PATCH 2/4] Implement N disk counters for single value and indirect call counters.)

Message ID 20190610180226.GC19695@tucnak
State New
Headers show
Series
  • Fix build with inhibit_libc (was Re: [PATCH 2/4] Implement N disk counters for single value and indirect call counters.)
Related show

Commit Message

Jakub Jelinek June 10, 2019, 6:02 p.m.
On Fri, Jun 07, 2019 at 11:10:59AM +0200, Martin Liška wrote:
> libgcc/ChangeLog:

> 

> 2019-06-04  Martin Liska  <mliska@suse.cz>

> 

> 	* Makefile.in: Add __gcov_one_value_profiler_v2,

> 	__gcov_one_value_profiler_v2_atomic and

> 	__gcov_indirect_call_profiler_v4.

> 	* libgcov-merge.c (__gcov_merge_single): Change

> 	function signature.


> diff --git a/libgcc/libgcov-merge.c b/libgcc/libgcov-merge.c

> index 702a69f8349..42416341b4d 100644

> --- a/libgcc/libgcov-merge.c

> +++ b/libgcc/libgcov-merge.c

> @@ -34,8 +34,9 @@ void __gcov_merge_add (gcov_type *counters  __attribute__ ((unused)),

>  #endif

>  

>  #ifdef L_gcov_merge_single

> -void __gcov_merge_single (gcov_type *counters  __attribute__ ((unused)),

> -                          unsigned n_counters __attribute__ ((unused))) {}

> +void __gcov_merge_single (gcov_type *counters  __attribute__ ((unused)))

> +{

> +}

>  #endif

>  

>  #else


This change broke build without target libc.

../../../../libgcc/libgcov-merge.c:37:6: error: conflicting types for ‘__gcov_merge_single’
   37 | void __gcov_merge_single (gcov_type *counters  __attribute__ ((unused)))
      |      ^~~~~~~~~~~~~~~~~~~
In file included from ../../../../libgcc/libgcov-merge.c:26:
../../../../libgcc/libgcov.h:263:13: note: previous declaration of ‘__gcov_merge_single’ was here
  263 | extern void __gcov_merge_single (gcov_type *, unsigned) ATTRIBUTE_HIDDEN;
      |             ^~~~~~~~~~~~~~~~~~~

It is unclear why it has been changed, when the callers haven't been
adjusted, nor the prototype.

So, I'd like to revert this hunk.  Tested with x86_64-linux -> nvptx-none
cross build, ok for trunk?

2019-06-10  Jakub Jelinek  <jakub@redhat.com>

	* libgcov-merge.c (__gcov_merge_single): Revert previous change.



	Jakub

Comments

Jakub Jelinek June 10, 2019, 9:53 p.m. | #1
On Mon, Jun 10, 2019 at 08:02:26PM +0200, Jakub Jelinek wrote:
> This change broke build without target libc.

> 

> ../../../../libgcc/libgcov-merge.c:37:6: error: conflicting types for ‘__gcov_merge_single’

>    37 | void __gcov_merge_single (gcov_type *counters  __attribute__ ((unused)))

>       |      ^~~~~~~~~~~~~~~~~~~

> In file included from ../../../../libgcc/libgcov-merge.c:26:

> ../../../../libgcc/libgcov.h:263:13: note: previous declaration of ‘__gcov_merge_single’ was here

>   263 | extern void __gcov_merge_single (gcov_type *, unsigned) ATTRIBUTE_HIDDEN;

>       |             ^~~~~~~~~~~~~~~~~~~

> 

> It is unclear why it has been changed, when the callers haven't been

> adjusted, nor the prototype.

> 

> So, I'd like to revert this hunk.  Tested with x86_64-linux -> nvptx-none

> cross build, ok for trunk?


Additionally successfully bootstrapped/regtested on x86_64-linux.

> 2019-06-10  Jakub Jelinek  <jakub@redhat.com>

> 

> 	* libgcov-merge.c (__gcov_merge_single): Revert previous change.

> 

> --- libgcc/libgcov-merge.c.jj	2019-06-10 19:39:29.291363550 +0200

> +++ libgcc/libgcov-merge.c	2019-06-10 19:58:36.731524778 +0200

> @@ -34,9 +34,8 @@ void __gcov_merge_add (gcov_type *counte

>  #endif

>  

>  #ifdef L_gcov_merge_single

> -void __gcov_merge_single (gcov_type *counters  __attribute__ ((unused)))

> -{

> -}

> +void __gcov_merge_single (gcov_type *counters  __attribute__ ((unused)),

> +			  unsigned n_counters __attribute__ ((unused))) {}

>  #endif

>  

>  #else


	Jakub
Martin Liška June 11, 2019, 7:35 a.m. | #2
On 6/10/19 11:53 PM, Jakub Jelinek wrote:
> On Mon, Jun 10, 2019 at 08:02:26PM +0200, Jakub Jelinek wrote:

>> This change broke build without target libc.

>>

>> ../../../../libgcc/libgcov-merge.c:37:6: error: conflicting types for ‘__gcov_merge_single’

>>    37 | void __gcov_merge_single (gcov_type *counters  __attribute__ ((unused)))

>>       |      ^~~~~~~~~~~~~~~~~~~

>> In file included from ../../../../libgcc/libgcov-merge.c:26:

>> ../../../../libgcc/libgcov.h:263:13: note: previous declaration of ‘__gcov_merge_single’ was here

>>   263 | extern void __gcov_merge_single (gcov_type *, unsigned) ATTRIBUTE_HIDDEN;

>>       |             ^~~~~~~~~~~~~~~~~~~

>>

>> It is unclear why it has been changed, when the callers haven't been

>> adjusted, nor the prototype.

>>

>> So, I'd like to revert this hunk.  Tested with x86_64-linux -> nvptx-none

>> cross build, ok for trunk?

> 

> Additionally successfully bootstrapped/regtested on x86_64-linux.


Thank you for the patch. It's correct, I really accidentally changed the signature.

Martin

> 

>> 2019-06-10  Jakub Jelinek  <jakub@redhat.com>

>>

>> 	* libgcov-merge.c (__gcov_merge_single): Revert previous change.

>>

>> --- libgcc/libgcov-merge.c.jj	2019-06-10 19:39:29.291363550 +0200

>> +++ libgcc/libgcov-merge.c	2019-06-10 19:58:36.731524778 +0200

>> @@ -34,9 +34,8 @@ void __gcov_merge_add (gcov_type *counte

>>  #endif

>>  

>>  #ifdef L_gcov_merge_single

>> -void __gcov_merge_single (gcov_type *counters  __attribute__ ((unused)))

>> -{

>> -}

>> +void __gcov_merge_single (gcov_type *counters  __attribute__ ((unused)),

>> +			  unsigned n_counters __attribute__ ((unused))) {}

>>  #endif

>>  

>>  #else

> 

> 	Jakub

>

Patch

--- libgcc/libgcov-merge.c.jj	2019-06-10 19:39:29.291363550 +0200
+++ libgcc/libgcov-merge.c	2019-06-10 19:58:36.731524778 +0200
@@ -34,9 +34,8 @@  void __gcov_merge_add (gcov_type *counte
 #endif
 
 #ifdef L_gcov_merge_single
-void __gcov_merge_single (gcov_type *counters  __attribute__ ((unused)))
-{
-}
+void __gcov_merge_single (gcov_type *counters  __attribute__ ((unused)),
+			  unsigned n_counters __attribute__ ((unused))) {}
 #endif
 
 #else