public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug go/56431] New: -lpthread should be added to -lgo
@ 2013-02-22 23:45 hjl.tools at gmail dot com
  2013-02-27 14:54 ` [Bug go/56431] " ian at airs dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2013-02-22 23:45 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56431
           Summary: -lpthread should be added to -lgo
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: go
        AssignedTo: ian@airs.com
        ReportedBy: hjl.tools@gmail.com
        Depends on: 56353


+++ This bug was initially created as a clone of Bug #56353 +++

libjava.jni/invocation/PR16923.c behaves differently, depending
on linking with gold or ld. _Jv_RegisterClasses is weak reference
and libgcj.so isn't on the linker command line. Since libgcj.so isn't
on the linker command line, gold resolves _Jv_RegisterClasses to 0 and
ld silently resolves it to _Jv_RegisterClasses in libgcj.so:

[hjl@gnu-13 testsuite]$ readelf -sWr /tmp/PR16923.gold | grep
_Jv_RegisterClasses 
     8: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _Jv_RegisterClasses
    37: 0000000000000000     0 NOTYPE  WEAK   DEFAULT  UND _Jv_RegisterClasses
[hjl@gnu-13 testsuite]$ readelf -sWr /tmp/PR16923.bfd | grep
_Jv_RegisterClasses 
0000000000600cd0  0000000900000007 R_X86_64_JUMP_SLOT     00000000004005e0
_Jv_RegisterClasses + 0
     9: 00000000004005e0     0 FUNC    WEAK   DEFAULT  UND _Jv_RegisterClasses
    59: 00000000004005e0     0 FUNC    WEAK   DEFAULT  UND _Jv_RegisterClasses
[hjl@gnu-13 testsuite]$]

-lgo has the same issue.  With the bfd linker, I got

[hjl@gnu-mic-2 go]$ ld --eh-frame-hdr -m elf_i386 -dynamic-linker
/lib/ld-linux.so.2 /lib/../lib/crt1.o /lib/../lib/crti.o
/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/testsuite/go/../../32/crtbegin.o
-L/export/build/gnu/gcc-asan/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libgo
-L/export/build/gnu/gcc-asan/build-x86_64-linux/x86_64-unknown-linux-gnu/32/libgo/.libs
-L/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/testsuite/go/../../32
-L/lib/../lib -L/usr/lib/../lib
-L/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/testsuite/go/../..
array-1.o -lgobegin -lgo -lm --wrap=pthread_create -lgcc_s -lgcc -lc -lgcc_s
-lgcc
/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/testsuite/go/../../32/crtend.o
/lib/../lib/crtn.o
ld:
/export/build/gnu/gcc-asan/build-x86_64-linux/gcc/testsuite/go/../../32/libgcc.a(generic-morestack.o):
undefined reference to symbol 'pthread_sigmask@@GLIBC_2.0'
ld: note: 'pthread_sigmask@@GLIBC_2.0' is defined in DSO /lib/libpthread.so.0
so try adding it to the linker command line
/lib/libpthread.so.0: could not read symbols: Invalid operation
[hjl@gnu-mic-2 go]$ 

gold links, but it generates

    51: 00000000     0 NOTYPE  WEAK   DEFAULT  UND pthread_sigmask

It means that go executables generated by bfd ld and gold may behave
differently.  Go driver should add -lpthread to -lgo if libgo.so is
linked against libpthread.so.


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

end of thread, other threads:[~2019-01-16 22:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-22 23:45 [Bug go/56431] New: -lpthread should be added to -lgo hjl.tools at gmail dot com
2013-02-27 14:54 ` [Bug go/56431] " ian at airs dot com
2013-02-27 16:59 ` hjl.tools at gmail dot com
2013-02-27 18:50 ` ian at airs dot com
2013-02-27 19:36 ` hjl.tools at gmail dot com
2013-02-27 21:08 ` ian at airs dot com
2013-02-27 21:21 ` hjl.tools at gmail dot com
2019-01-16 22:32 ` ian at airs dot com

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