Patchwork libgcc gcov_fork failure on AIX

login
register
mail settings
Submitter Richard Guenther
Date March 13, 2012, 9:38 a.m.
Message ID <alpine.LNX.2.00.1203131038090.18230@zhemvz.fhfr.qr>
Download mbox | patch
Permalink /patch/146374/
State New
Headers show

Comments

Richard Guenther - March 13, 2012, 9:38 a.m.
On Mon, 12 Mar 2012, David Edelsohn wrote:

> Richi,
> 
> Your patch for PR gcov/49484 now causes a bootstrap failure on AIX:
> 
> /farm/dje/src/src/libgcc/libgcov.c: In function '__gcov_fork':
> /farm/dje/src/src/libgcc/libgcov.c:1008:5: error: 'mx' undeclared
> (first use in this function)
> /farm/dje/src/src/libgcc/libgcov.c:1008:5: note: each undeclared
> identifier is reported only once for each function it appears in
> make: *** [_gcov_fork.o] Error 1
> 
> # 1000 "/farm/dje/src/src/libgcc/libgcov.c"
> pid_t
> __gcov_fork (void)
> {
>   pid_t pid;
>   extern __gthread_mutex_t __gcov_flush_mx;
>   __gcov_flush ();
>   pid = fork ();
>   if (pid == 0)
>     (mx) (&__gcov_flush_mx);
>   return pid;
> }

Fixed with the following, applied as obvious.

Richard.

2012-03-13  Richard Guenther  <rguenther@suse.de>

	* gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Fix definition.

Patch

Index: libgcc/gthr-single.h
===================================================================
--- libgcc/gthr-single.h	(revision 185319)
+++ libgcc/gthr-single.h	(working copy)
@@ -36,7 +36,7 @@  typedef int __gthread_recursive_mutex_t;
 
 #define __GTHREAD_ONCE_INIT 0
 #define __GTHREAD_MUTEX_INIT 0
-#define __GTHREAD_MUTEX_INIT_FUNCTION (mx)
+#define __GTHREAD_MUTEX_INIT_FUNCTION(mx)
 #define __GTHREAD_RECURSIVE_MUTEX_INIT 0
 
 #define UNUSED __attribute__((unused))