Bug 4302 - [regression] ld fails to link gcc-4.1's libstdc++ debug build
Summary: [regression] ld fails to link gcc-4.1's libstdc++ debug build
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.18
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-30 19:09 UTC by Matthias Klose
Modified: 2007-04-22 21:46 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc-linux-gnu
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2007-03-30 19:09:44 UTC
binutils HEAD 20070329, configured with --enable-targets=powerpc64-linux-gnu
fails to build the libstdc++ debug library from the gcc-4_1-branch; the library
from the gcc-4_2-branch did build fine with the same ld.

Note, that this is a build with HJ LU's patches applied (except binutils-shr).
Will test a build from HEAD over the weekend.

sh collect2.sh
GNU ld (GNU Binutils for Ubuntu) 2.17.50.20070329
  Supported emulations:
   elf32ppclinux
   elf32ppc
   elf32ppcsim
   elf64ppc
/usr/bin/ld: .libs/libstdc++.so.6.0.8: undefined versioned symbol name
frexpl@GLIBCXX_3.4.3
/usr/bin/ld: failed to set dynamic section sizes: Bad value
collect2: ld returned 1 exit status

testcase:
http://people.ubuntu.com/~doko/tmp/libstd++-v3-gcc-4.1-powerpc.tar.bz2
Comment 1 Matthias Klose 2007-03-30 20:48:48 UTC
same failure on sparc-linux-gnu (configured the same as in #4267)
Comment 2 Matthias Klose 2007-03-30 23:32:48 UTC
HEAD 20070329 shows the same behaviour
Comment 3 H.J. Lu 2007-04-05 15:04:07 UTC
What is the last working version in CVS for PPC and Sparc?
I don't have PPC nor Sparc. If you can provide me testcacases for PPC
and Sparc I can use with a cross linker, I will try to take a look.
Comment 4 Matthias Klose 2007-04-05 18:15:00 UTC
I added
http://people.ubuntu.com/~doko/tmp/libstd++-v3-gcc-4.1-powerpc-host=i386.tar.bz2
this is a ld configured with --enable-targets=powerpc-linux-gnu,powerpc64-linux-gnu

the last binutils I sucessfully checked was 20070210.
Comment 5 H.J. Lu 2007-04-05 19:19:39 UTC
(In reply to comment #4)
> I added
> http://people.ubuntu.com/~doko/tmp/libstd++-v3-gcc-4.1-powerpc-host=i386.tar.bz2
> this is a ld configured with
--enable-targets=powerpc-linux-gnu,powerpc64-linux-gnu
> 
> the last binutils I sucessfully checked was 20070210.
> 

20070210 linker doesn't work for me either:

GNU ld version 2.17.50 20070210
./ld-last: .libs/libstdc++.so.6.0.8: undefined versioned symbol name
frexpl@GLIBCXX_3.4.3
./ld-last: failed to set dynamic section sizes: Bad value
make: *** [foo] Error 1

The problem may be in gcc or assembler.
Comment 6 H.J. Lu 2007-04-05 19:55:56 UTC
src/debug/.libs/compatibility.o is wrong:

[hjl@gnu-26 .libs]$  readelf -s compatibility.o | grep GLIBC
   159: 00000000    88 FUNC    GLOBAL DEFAULT   73 acosl@GLIBCXX_3.4.3
   160: 00000000    88 FUNC    GLOBAL DEFAULT   71 asinl@GLIBCXX_3.4.3
   161: 00000000    96 FUNC    GLOBAL DEFAULT   69 atan2l@GLIBCXX_3.4
   162: 00000000    88 FUNC    GLOBAL DEFAULT   67 atanl@GLIBCXX_3.4.3
   163: 00000000    88 FUNC    GLOBAL DEFAULT   65 ceill@GLIBCXX_3.4.3
   164: 00000000    88 FUNC    GLOBAL DEFAULT   63 coshl@GLIBCXX_3.4
   165: 00000000    88 FUNC    GLOBAL DEFAULT   61 cosl@GLIBCXX_3.4
   166: 00000000    88 FUNC    GLOBAL DEFAULT   59 expl@GLIBCXX_3.4
   167: 00000000    88 FUNC    GLOBAL DEFAULT   57 floorl@GLIBCXX_3.4.3
   168: 00000000    96 FUNC    GLOBAL DEFAULT   55 fmodl@GLIBCXX_3.4.3
   169: 00000000    96 FUNC    GLOBAL DEFAULT   53 frexpl@GLIBCXX_3.4.3
   170: 00000000    96 FUNC    GLOBAL DEFAULT   51 hypotl@GLIBCXX_3.4
   171: 00000000    96 FUNC    GLOBAL DEFAULT   49 ldexpl@GLIBCXX_3.4.3
   172: 00000000    88 FUNC    GLOBAL DEFAULT   47 log10l@GLIBCXX_3.4
   173: 00000000    88 FUNC    GLOBAL DEFAULT   45 logl@GLIBCXX_3.4
   174: 00000000    96 FUNC    GLOBAL DEFAULT   43 modfl@GLIBCXX_3.4.3
   175: 00000000    96 FUNC    GLOBAL DEFAULT   41 powl@GLIBCXX_3.4
   176: 00000000    88 FUNC    GLOBAL DEFAULT   39 sinhl@GLIBCXX_3.4
   177: 00000000    88 FUNC    GLOBAL DEFAULT   37 sinl@GLIBCXX_3.4
   178: 00000000    88 FUNC    GLOBAL DEFAULT   35 sqrtl@GLIBCXX_3.4
   179: 00000000    88 FUNC    GLOBAL DEFAULT   33 tanhl@GLIBCXX_3.4
   180: 00000000    88 FUNC    GLOBAL DEFAULT   31 tanl@GLIBCXX_3.4

Where are they coming from? I don't see them on Linux/x86-64.
Comment 7 Matthias Klose 2007-04-05 21:38:16 UTC
for both targets GCC is configured --with-long-double-128, after applying
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25864#c14
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25864#c13
Comment 8 H.J. Lu 2007-04-05 21:42:59 UTC
(In reply to comment #7)
> for both targets GCC is configured --with-long-double-128, after applying
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25864#c14
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25864#c13
> 

Those symbols are for glibc. Why do they have libstdc++ version names? I
think it is a gcc bug. Please open a gcc bug instead.
Comment 9 peter green 2007-04-19 19:10:39 UTC
so has anyone actually reported this to the gcc guys yet and if so where?
Comment 10 Matthias Klose 2007-04-22 22:35:43 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > I added
> > http://people.ubuntu.com/~doko/tmp/libstd++-v3-gcc-4.1-powerpc-host=i386.tar.bz2
> > this is a ld configured with
> --enable-targets=powerpc-linux-gnu,powerpc64-linux-gnu
> > 
> > the last binutils I sucessfully checked was 20070210.
> > 
> 
> 20070210 linker doesn't work for me either:

rechecked with 20070103, which works for me; H.J., please could you recheck?
Comment 11 H.J. Lu 2007-04-22 22:46:33 UTC
(In reply to comment #10)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > I added
> > >
http://people.ubuntu.com/~doko/tmp/libstd++-v3-gcc-4.1-powerpc-host=i386.tar.bz2
> > > this is a ld configured with
> > --enable-targets=powerpc-linux-gnu,powerpc64-linux-gnu
> > > 
> > > the last binutils I sucessfully checked was 20070210.
> > > 
> > 
> > 20070210 linker doesn't work for me either:
> 
> rechecked with 20070103, which works for me; H.J., please could you recheck?

It is a gcc bug. The newer linker checks it. Please file a gcc bug report.