public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2002-12-10 11:06 Joseph S. Myers
  0 siblings, 0 replies; 12+ messages in thread
From: Joseph S. Myers @ 2002-12-10 11:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR other/8888; it has been noted by GNATS.

From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: Sebastian Wilhelmi <wilhelmi@ira.uka.de>
Cc: <bangerth@dealii.org>,  <gcc-bugs@gcc.gnu.org>,  <gcc-gnats@gcc.gnu.org>
Subject: Re: other/8888: Linking shared libraries with -pthread fails to link
 to libpthread
Date: Tue, 10 Dec 2002 19:02:09 +0000 (GMT)

 On 10 Dec 2002, Sebastian Wilhelmi wrote:
 
 > the man page for gcc-3.2 says:
 > 
 >        -pthread
 >            Adds support for multithreading with the pthreads library.
 >            This option sets flags for both the preprocessor and linker.
 
 This documentation is as an RS6000/PowerPC option only.  If it's intended 
 to be supported on other systems, it needs to be more generally 
 documented.
 
 -- 
 Joseph S. Myers
 jsm28@cam.ac.uk
 


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

* Re: other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2003-03-10 20:39 bangerth
  0 siblings, 0 replies; 12+ messages in thread
From: bangerth @ 2003-03-10 20:39 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, wilhelmi

Synopsis: Linking shared libraries with -pthread fails to link to libpthread

State-Changed-From-To: analyzed->closed
State-Changed-By: bangerth
State-Changed-When: Mon Mar 10 20:39:52 2003
State-Changed-Why:
    Apparently fixed

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8888


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

* Re: other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2003-03-09 17:36 Hans-Peter Nilsson
  0 siblings, 0 replies; 12+ messages in thread
From: Hans-Peter Nilsson @ 2003-03-09 17:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR other/8888; it has been noted by GNATS.

From: Hans-Peter Nilsson <hp@bitrange.com>
To: bangerth@dealii.org,  <gcc-bugs@gcc.gnu.org>,  <gcc-prs@gcc.gnu.org>, 
     <nobody@gcc.gnu.org>,  <wilhelmi@ira.uka.de>,  <gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: other/8888: Linking shared libraries with -pthread fails to link
 to libpthread
Date: Sun, 9 Mar 2003 12:34:29 -0500 (EST)

 On 10 Dec 2002 bangerth@dealii.org wrote:
 
 > Synopsis: Linking shared libraries with -pthread fails to link to libpthread
 > State-Changed-Why:
 >     Problem unsolved as of now. Will hopefully be fixed sometimes.
 
 I think this is solved for main trunk:
 
 2002-12-10  Jakub Jelinek  <jakub@redhat.com>
 
 	* config/linux.h (LIB_SPEC): If -pthread, add -lpthread even if
 	-shared.
 
 brgds, H-P
 


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

* Re: other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2002-12-10 11:46 Wolfgang Bangerth
  0 siblings, 0 replies; 12+ messages in thread
From: Wolfgang Bangerth @ 2002-12-10 11:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR other/8888; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: "Joseph S. Myers" <jsm28@cam.ac.uk>
Cc: Sebastian Wilhelmi <wilhelmi@ira.uka.de>, <gcc-bugs@gcc.gnu.org>,
   <gcc-gnats@gcc.gnu.org>
Subject: Re: other/8888: Linking shared libraries with -pthread fails to link
 to libpthread
Date: Tue, 10 Dec 2002 13:39:30 -0600 (CST)

 > > So I'm inclined to close the report. Is this sensible, Joseph?
 > 
 > No, since I believe the intention is that it *is* intended to be supported 
 > on other systems, but is missing documentation.  (And some systems may 
 > inconsistently use the spelling -pthreads, a generic option (with docs 
 > moved to a generic section and a note that this option is only supported 
 > on some targets) should have a fixed spelling (or remap one to the other 
 > so both work on all systems).)
 
 OK, thanks for the clarification. I remember that it is a hassle that this 
 flag is called differently on all different platforms. There might be some 
 value in keeping this report as a reminder that this should eventually be 
 fixed.
 
 Thanks for your feedback
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 


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

* Re: other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2002-12-10 11:46 Joseph S. Myers
  0 siblings, 0 replies; 12+ messages in thread
From: Joseph S. Myers @ 2002-12-10 11:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR other/8888; it has been noted by GNATS.

From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
Cc: Sebastian Wilhelmi <wilhelmi@ira.uka.de>,  <gcc-bugs@gcc.gnu.org>, 
     <gcc-gnats@gcc.gnu.org>
Subject: Re: other/8888: Linking shared libraries with -pthread fails to link
 to libpthread
Date: Tue, 10 Dec 2002 19:36:43 +0000 (GMT)

 On Tue, 10 Dec 2002, Wolfgang Bangerth wrote:
 
 > > This documentation is as an RS6000/PowerPC option only.  If it's intended 
 > > to be supported on other systems, it needs to be more generally 
 > > documented.
 > 
 > So I'm inclined to close the report. Is this sensible, Joseph?
 
 No, since I believe the intention is that it *is* intended to be supported 
 on other systems, but is missing documentation.  (And some systems may 
 inconsistently use the spelling -pthreads, a generic option (with docs 
 moved to a generic section and a note that this option is only supported 
 on some targets) should have a fixed spelling (or remap one to the other 
 so both work on all systems).)
 
 -- 
 Joseph S. Myers
 jsm28@cam.ac.uk
 


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

* Re: other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2002-12-10 11:40 bangerth
  0 siblings, 0 replies; 12+ messages in thread
From: bangerth @ 2002-12-10 11:40 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, wilhelmi

Synopsis: Linking shared libraries with -pthread fails to link to libpthread

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Tue Dec 10 11:40:08 2002
State-Changed-Why:
    Problem unsolved as of now. Will hopefully be fixed sometimes.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8888


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

* Re: other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2002-12-10 11:36 Wolfgang Bangerth
  0 siblings, 0 replies; 12+ messages in thread
From: Wolfgang Bangerth @ 2002-12-10 11:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR other/8888; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: "Joseph S. Myers" <jsm28@cam.ac.uk>
Cc: Sebastian Wilhelmi <wilhelmi@ira.uka.de>, <gcc-bugs@gcc.gnu.org>,
   <gcc-gnats@gcc.gnu.org>
Subject: Re: other/8888: Linking shared libraries with -pthread fails to link
 to libpthread
Date: Tue, 10 Dec 2002 13:27:28 -0600 (CST)

 > > the man page for gcc-3.2 says:
 > > 
 > >        -pthread
 > >            Adds support for multithreading with the pthreads library.
 > >            This option sets flags for both the preprocessor and linker.
 > 
 > This documentation is as an RS6000/PowerPC option only.  If it's intended 
 > to be supported on other systems, it needs to be more generally 
 > documented.
 
 So I'm inclined to close the report. Is this sensible, Joseph?
 
 W.
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 


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

* Re: other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2002-12-10  6:48 bangerth
  0 siblings, 0 replies; 12+ messages in thread
From: bangerth @ 2002-12-10  6:48 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, wilhelmi

Synopsis: Linking shared libraries with -pthread fails to link to libpthread

State-Changed-From-To: feedback->open
State-Changed-By: bangerth
State-Changed-When: Tue Dec 10 06:48:27 2002
State-Changed-Why:
    More information received. Seems like an inconsistency
    problem.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8888


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

* Re: other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2002-12-10  6:46 Wolfgang Bangerth
  0 siblings, 0 replies; 12+ messages in thread
From: Wolfgang Bangerth @ 2002-12-10  6:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR other/8888; it has been noted by GNATS.

From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Sebastian Wilhelmi <wilhelmi@ira.uka.de>
Cc: gcc-bugs@gcc.gnu.org, <gcc-gnats@gcc.gnu.org>
Subject: Re: other/8888: Linking shared libraries with -pthread fails to link
 to libpthread
Date: Tue, 10 Dec 2002 08:44:55 -0600 (CST)

 > the man page for gcc-3.2 says:
 > 
 >        -pthread
 >            Adds support for multithreading with the pthreads library.
 >            This option sets flags for both the preprocessor and linker.
 
 Sorry, I overlooked this (the gcc2.95 info pages have no documentation on 
 -pthread whatsoever). Nevertheless, it does not say specifically that it 
 links with libpthread. It might just select thread-safe variants of other 
 libraries, in case there are different versions.
 
 Though...
 
 > Also for non-shared binaries gcc does the right thing now, but not for
 > shared objects, why is that?
 
 ...this seems inconsistent. I will thus reopen the report.
 
 To workaround, you could of course just pass "-pthread -lpthread" on the 
 linker line. This is basically also what I always do.
 
 > P.S.: I have no write access to GNATS, so I could only write this
 > e-mail, or is there some way to attach that message to the bug report?
 
 As long as you CC: gcc-gnats@gcc.gnu.org, everything is fine.
 
 Regards
   Wolfgang
 
 -------------------------------------------------------------------------
 Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                                www: http://www.ticam.utexas.edu/~bangerth
 
 


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

* Re: other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2002-12-10  6:36 Sebastian Wilhelmi
  0 siblings, 0 replies; 12+ messages in thread
From: Sebastian Wilhelmi @ 2002-12-10  6:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR other/8888; it has been noted by GNATS.

From: Sebastian Wilhelmi <wilhelmi@ira.uka.de>
To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,  gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: other/8888: Linking shared libraries with -pthread fails to
	link to libpthread
Date: 10 Dec 2002 15:31:02 +0100

 Hi,
 
 > Synopsis: Linking shared libraries with -pthread fails to link to libpthread
 > 
 > State-Changed-From-To: open->feedback
 > State-Changed-By: bangerth
 > State-Changed-When: Tue Dec 10 06:13:52 2002
 > State-Changed-Why:
 >     I fail to see the reasoning behind the report: what is wrong
 >     with passing -lpthread to the linker line? The -pthread
 >     changes some things when compiling (as far as I understand,
 >     for example the initialization of static variables), so
 >     has nothing to do with what libraries are linked. You 
 >     would want to specify this separately. Why is this bad?
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8888
 
 the man page for gcc-3.2 says:
 
        -pthread
            Adds support for multithreading with the pthreads library.
            This option sets flags for both the preprocessor and linker.
 
 So we consider -pthread in GLib the preferred way to indicate, that a
 program or library is multithreaded. We use it both for linking and
 compiling programs and libraries. I got the impression, that also gcc
 consideres using -pthread superior to using -D_REENTRANT and -lpthread.
 
 Also for non-shared binaries gcc does the right thing now, but not for
 shared objects, why is that?
 
 Bye,
 Sebastian
 
 P.S.: I have no write access to GNATS, so I could only write this
 e-mail, or is there some way to attach that message to the bug report?
 -- 
 Sebastian Wilhelmi
 mailto:wilhelmi@ira.uka.de
 http://goethe.ira.uka.de/~wilhelmi
 
 


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

* Re: other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2002-12-10  6:13 bangerth
  0 siblings, 0 replies; 12+ messages in thread
From: bangerth @ 2002-12-10  6:13 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, wilhelmi

Synopsis: Linking shared libraries with -pthread fails to link to libpthread

State-Changed-From-To: open->feedback
State-Changed-By: bangerth
State-Changed-When: Tue Dec 10 06:13:52 2002
State-Changed-Why:
    I fail to see the reasoning behind the report: what is wrong
    with passing -lpthread to the linker line? The -pthread
    changes some things when compiling (as far as I understand,
    for example the initialization of static variables), so
    has nothing to do with what libraries are linked. You 
    would want to specify this separately. Why is this bad?

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8888


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

* other/8888: Linking shared libraries with -pthread fails to link to libpthread
@ 2002-12-10  4:16 wilhelmi
  0 siblings, 0 replies; 12+ messages in thread
From: wilhelmi @ 2002-12-10  4:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8888
>Category:       other
>Synopsis:       Linking shared libraries with -pthread fails to link to libpthread
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 10 04:16:03 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Sebastian Wilhelmi
>Release:        CVS
>Organization:
>Environment:
Linux
>Description:
Linking a shared library with -pthread does not link in libpthread.so on linux. 

Quoting from the corresponding GLib bug report about the reasons, that libpthread.so has to be on the linking line also for shared libs:

 - prelink; in order for prelink to preresolve relocations
   for a library must not have undefined symbols; any 
   undefined symbols will always have to handled at run 
   time.

 - Symbol versioning; the binding of symbols to particular 
   versions happens when the library is linked. If -lpthread
   not on the link line, then the symbol will get the base 
   version at run time, not the correct newer one. 

Please see 

    http://bugzilla.gnome.org/show_bug.cgi?id=100697

for further information.
>How-To-Repeat:

>Fix:
See attached patch. Other platforms surely need similiar fixes as well.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gcc.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gcc.diff"

SW5kZXg6IGdjYy9jb25maWcvbGludXguaAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3Zzcm9vdC9n
Y2MvZ2NjL2djYy9jb25maWcvbGludXguaCx2CnJldHJpZXZpbmcgcmV2aXNpb24gMS4xOQpkaWZm
IC1wIC11IC1iIC1CIC1yMS4xOSBsaW51eC5oCi0tLSBnY2MvY29uZmlnL2xpbnV4LmgJMjkgU2Vw
IDIwMDIgMTM6MTY6NDQgLTAwMDAJMS4xOQorKysgZ2NjL2NvbmZpZy9saW51eC5oCTEwIERlYyAy
MDAyIDEyOjA5OjI2IC0wMDAwCkBAIC05Myw3ICs5Myw3IEBAIEJvc3RvbiwgTUEgMDIxMTEtMTMw
NywgVVNBLiAgKi8KICAgICAgJXshcHJvZmlsZToleyFnZ2RiOi1sY30gJXtnZ2RiOi1sZ319fSIK
ICNlbHNlCiAjZGVmaW5lIExJQl9TUEVDIFwKLSAgIiV7c2hhcmVkOiAtbGN9IFwKKyAgIiV7c2hh
cmVkOiAtbGMgJXtwdGhyZWFkOi1scHRocmVhZH19IFwKICAgICV7IXNoYXJlZDogJXttaWVlZS1m
cDotbGllZWV9ICV7cHRocmVhZDotbHB0aHJlYWR9IFwKIAkle3Byb2ZpbGU6LWxjX3B9ICV7IXBy
b2ZpbGU6IC1sY319IgogI2VuZGlmCg==


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

end of thread, other threads:[~2003-03-10 20:39 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-10 11:06 other/8888: Linking shared libraries with -pthread fails to link to libpthread Joseph S. Myers
  -- strict thread matches above, loose matches on Subject: below --
2003-03-10 20:39 bangerth
2003-03-09 17:36 Hans-Peter Nilsson
2002-12-10 11:46 Joseph S. Myers
2002-12-10 11:46 Wolfgang Bangerth
2002-12-10 11:40 bangerth
2002-12-10 11:36 Wolfgang Bangerth
2002-12-10  6:48 bangerth
2002-12-10  6:46 Wolfgang Bangerth
2002-12-10  6:36 Sebastian Wilhelmi
2002-12-10  6:13 bangerth
2002-12-10  4:16 wilhelmi

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).