public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/28307]  New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
@ 2006-07-07 17:07 gcc-bugzilla at gcc dot gnu dot org
  2006-07-07 17:09 ` [Bug target/28307] " ro at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2006-07-07 17:07 UTC (permalink / raw)
  To: gcc-bugs


While investigating the root cause of PR libgcj/28189, I noticed that both
on the 4.1 branch and on mainline (where the libjava testsuite timeouts
occur) the boehm-gc test had started failing as well (which easily goes
unnoticed due to PR boehm-gc/11412): gctest fails like this:

Key creation failed 18446744073709551615
Test failed
FAIL: gctest

It turns out that this happens when pthread_key_create returns -1.
Printing errno at this point reveals that errno is 0, which is unexpected
and shouldn't happen with the function from libpthread.

Upon further investigation, it turned out that the pthread function
definitions from gthr-posix.c aren't marked weak any more, so the dummy
function definitions make it into libgcc.a and libgcc_s.so.1, which of
course every usage of the real pthread functions.  This was introduce by
this patch and it's successors:

2005-11-09  Alexandre Oliva  <aoliva@redhat.com>

        PR other/4372
        * gthr-dce.h, gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
        gthr-tpf.h: Define __gthrw.  For all identifiers that might
        be weak, introduce weakrefs or non-weak aliases with __gthrw,
        and prefix all uses with __ghtrw.

Before that change, there were #pragma weak declarations for all functions
defined in gthr-posix.c, so those definitions became weak.  Afterwards,
those declarations were lost and the definitions became strong.

Environment:
System: OSF1 bartok V5.1 2650 alpha
Machine: alpha

host: alpha-dec-osf5.1b
build: alpha-dec-osf5.1b
target: alpha-dec-osf5.1b
configured with: /vol/gcc/src/gcc/configure --prefix=/vol/gcc
--with-local-prefix=/vol/gcc --disable-nls --host alpha-dec-osf5.1b --build
alpha-dec-osf5.1b --target alpha-dec-osf5.1b
--with-gmp-dir=/vol/gnu/obj/gmp-4.1.3
--with-mpfr-dir=/vol/gnu/obj/gmp-4.1.3/mpfr
--enable-languages=c,c++,fortran,java,objc,ada --disable-libmudflap

How-To-Repeat:
Investigate e.g. the pthread_key_create definition in libgcc.a and
libgcc_s.so.1 with stdump:

On the 4.0 branch, it is marked weak:

6. (file  0) (0x10) pthread_key_create Proc       Text       symref (indexNil) 
(weakext)

while on mainline and the 4.1 branch this is lost:

6. (file  0) (0x10) pthread_key_create Proc       Text       symref (indexNil)


------- Comment #1 from ro at techfak dot uni-bielefeld dot de  2006-07-07 17:06 -------
Fix:
I'm currently testing the following patch (which is difficult due to lots
of other unrelated breakage on mainline ;-).  It probably needs some
cleanup and comments, but gives the basic idea.

Index: gthr-posix.c
===================================================================
--- gthr-posix.c        (revision 115230)
+++ gthr-posix.c        (working copy)
@@ -28,6 +28,7 @@ Software Foundation, 51 Franklin Street,

 #include "tconfig.h"
 #include "tm.h"
+# define __gthrw_pragma(pragma) _Pragma (#pragma)
 /* Define so we provide weak definitions of functions used by libobjc only. 
*/
 #define _LIBOBJC_WEAK
 #include "gthr.h"
Index: gthr-posix.h
===================================================================
--- gthr-posix.h        (revision 115230)
+++ gthr-posix.h        (working copy)
@@ -59,8 +59,12 @@ typedef pthread_mutex_t __gthread_recurs
 #endif

 #if SUPPORTS_WEAK && GTHREAD_USE_WEAK
+# ifndef __gthrw_pragma
+#  define __gthrw_pragma(pragma)
+# endif
 # define __gthrw2(name,name2,type) \
-  static __typeof(type) name __attribute__ ((__weakref__(#name2)));
+  static __typeof(type) name __attribute__ ((__weakref__(#name2))); \
+  __gthrw_pragma(weak name2)
 # define __gthrw_(name) __gthrw_ ## name
 #else
 # define __gthrw2(name,name2,type)


-- 
           Summary: [4.1/4.2 Regression] pthread functions in libgcc not
                    weak any more on Tru64 UNIX
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ro at techfak dot uni-bielefeld dot de
 GCC build triplet: alpha-dec-osf5.1b
  GCC host triplet: alpha-dec-osf5.1b
GCC target triplet: alpha-dec-osf5.1b


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
@ 2006-07-07 17:09 ` ro at gcc dot gnu dot org
  2006-07-07 17:58 ` ro at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ro at gcc dot gnu dot org @ 2006-07-07 17:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from ro at gcc dot gnu dot org  2006-07-07 17:09 -------
Alexandre,

your patch introduced this regression.  Could you have a look if the suggested
fix in Comment #1 seems reasonable?

Thanks.
  Rainer


-- 

ro at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aoliva at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
  2006-07-07 17:09 ` [Bug target/28307] " ro at gcc dot gnu dot org
@ 2006-07-07 17:58 ` ro at gcc dot gnu dot org
  2006-09-10 16:57 ` jsm28 at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ro at gcc dot gnu dot org @ 2006-07-07 17:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ro at gcc dot gnu dot org  2006-07-07 17:58 -------
Created an attachment (id=11851)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11851&action=view)
Revised patch

Minor correction: with the original patch, some functions (those which didn't
use
#pragma extern_prefix) were still not marked weak.  In the presence of #pragma
extern_prefix, #pragma weak still needs to refer to the unprefixed name.

With the attached patch, at least the unmodified boehm-gc 6.7 tested
successfully.


-- 

ro at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |ro at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
  2006-07-07 17:09 ` [Bug target/28307] " ro at gcc dot gnu dot org
  2006-07-07 17:58 ` ro at gcc dot gnu dot org
@ 2006-09-10 16:57 ` jsm28 at gcc dot gnu dot org
  2006-09-20 22:26 ` mmitchel at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2006-09-10 16:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.1.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-09-10 16:57 ` jsm28 at gcc dot gnu dot org
@ 2006-09-20 22:26 ` mmitchel at gcc dot gnu dot org
  2006-09-21  2:35 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-09-20 22:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from mmitchel at gcc dot gnu dot org  2006-09-20 22:26 -------
Marked as P5 because this is marked as applying to Alpha/OSF.  If this problem
applies to other platforms, please set back to P3 with explanatory comment.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-09-20 22:26 ` mmitchel at gcc dot gnu dot org
@ 2006-09-21  2:35 ` mmitchel at gcc dot gnu dot org
  2006-10-05  8:50 ` markus dot schoepflin at comsoft dot de
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-09-21  2:35 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P5


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-09-21  2:35 ` mmitchel at gcc dot gnu dot org
@ 2006-10-05  8:50 ` markus dot schoepflin at comsoft dot de
  2007-02-14  9:40 ` [Bug target/28307] [4.1/4.2/4.3 " mmitchel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: markus dot schoepflin at comsoft dot de @ 2006-10-05  8:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from markus dot schoepflin at comsoft dot de  2006-10-05 08:49 -------
(In reply to comment #3)

> With the attached patch, at least the unmodified boehm-gc 6.7 tested
> successfully.

I stumbled accross this bug when investigating why the boost thread library
tests started to fail from 4.1.0 onwards on this platform.

I can confirm that the suggested patch fixes things in such a way, that the
regression tests for the boost thread library pass sucessfully when testing
with 4.1.1.

Please note that the patch didn't apply cleanly to 4.1.1, but I was able to
apply it manually.


-- 

markus dot schoepflin at comsoft dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markus dot schoepflin at
                   |                            |comsoft dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2/4.3 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-10-05  8:50 ` markus dot schoepflin at comsoft dot de
@ 2007-02-14  9:40 ` mmitchel at gcc dot gnu dot org
  2007-07-03 13:36 ` ro at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14  9:40 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.1.2                       |4.1.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2/4.3 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-02-14  9:40 ` [Bug target/28307] [4.1/4.2/4.3 " mmitchel at gcc dot gnu dot org
@ 2007-07-03 13:36 ` ro at gcc dot gnu dot org
  2007-07-03 13:41 ` ro at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ro at gcc dot gnu dot org @ 2007-07-03 13:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from ro at gcc dot gnu dot org  2007-07-03 13:36 -------
Patch here:

http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00533.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2/4.3 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-07-03 13:36 ` ro at gcc dot gnu dot org
@ 2007-07-03 13:41 ` ro at gcc dot gnu dot org
  2007-07-03 13:43 ` ro at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: ro at gcc dot gnu dot org @ 2007-07-03 13:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ro at gcc dot gnu dot org  2007-07-03 13:41 -------
Subject: Bug 28307

Author: ro
Date: Tue Jul  3 13:41:00 2007
New Revision: 126253

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126253
Log:
        PR target/28307
        * gthr-posix.h [SUPPORTS_WEAK && GTHREAD_USE_WEAK]
        (__gthrw_pragma): Provide default definition.
        (__gthrw2): Use it.
        * gthr-posix.c (__gthrw_pragma): Define.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gthr-posix.c
    trunk/gcc/gthr-posix.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2/4.3 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2007-07-03 13:41 ` ro at gcc dot gnu dot org
@ 2007-07-03 13:43 ` ro at gcc dot gnu dot org
  2007-07-03 13:45 ` ro at gcc dot gnu dot org
  2007-07-03 13:46 ` ro at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ro at gcc dot gnu dot org @ 2007-07-03 13:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from ro at gcc dot gnu dot org  2007-07-03 13:43 -------
Subject: Bug 28307

Author: ro
Date: Tue Jul  3 13:43:01 2007
New Revision: 126254

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126254
Log:
        PR target/28307
        * gthr-posix.h [SUPPORTS_WEAK && GTHREAD_USE_WEAK]
        (__gthrw_pragma): Provide default definition.
        (__gthrw2): Use it.
        * gthr-posix.c (__gthrw_pragma): Define.


Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/gthr-posix.c
    branches/gcc-4_2-branch/gcc/gthr-posix.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2/4.3 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2007-07-03 13:43 ` ro at gcc dot gnu dot org
@ 2007-07-03 13:45 ` ro at gcc dot gnu dot org
  2007-07-03 13:46 ` ro at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ro at gcc dot gnu dot org @ 2007-07-03 13:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ro at gcc dot gnu dot org  2007-07-03 13:45 -------
Subject: Bug 28307

Author: ro
Date: Tue Jul  3 13:45:21 2007
New Revision: 126255

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126255
Log:
        PR target/28307
        * gthr-posix.h [SUPPORTS_WEAK && GTHREAD_USE_WEAK]
        (__gthrw_pragma): Provide default definition.
        (__gthrw2): Use it.
        * gthr-posix.c (__gthrw_pragma): Define.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/gthr-posix.c
    branches/gcc-4_1-branch/gcc/gthr-posix.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug target/28307] [4.1/4.2/4.3 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX
  2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2007-07-03 13:45 ` ro at gcc dot gnu dot org
@ 2007-07-03 13:46 ` ro at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: ro at gcc dot gnu dot org @ 2007-07-03 13:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from ro at gcc dot gnu dot org  2007-07-03 13:46 -------
Fixed for 4.1.3, 4.2.1, 4.3.


-- 

ro at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28307


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-07-03 13:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-07 17:07 [Bug target/28307] New: [4.1/4.2 Regression] pthread functions in libgcc not weak any more on Tru64 UNIX gcc-bugzilla at gcc dot gnu dot org
2006-07-07 17:09 ` [Bug target/28307] " ro at gcc dot gnu dot org
2006-07-07 17:58 ` ro at gcc dot gnu dot org
2006-09-10 16:57 ` jsm28 at gcc dot gnu dot org
2006-09-20 22:26 ` mmitchel at gcc dot gnu dot org
2006-09-21  2:35 ` mmitchel at gcc dot gnu dot org
2006-10-05  8:50 ` markus dot schoepflin at comsoft dot de
2007-02-14  9:40 ` [Bug target/28307] [4.1/4.2/4.3 " mmitchel at gcc dot gnu dot org
2007-07-03 13:36 ` ro at gcc dot gnu dot org
2007-07-03 13:41 ` ro at gcc dot gnu dot org
2007-07-03 13:43 ` ro at gcc dot gnu dot org
2007-07-03 13:45 ` ro at gcc dot gnu dot org
2007-07-03 13:46 ` ro at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).