Bug 18889 - Unable to build libstdc++-v3
Summary: Unable to build libstdc++-v3
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.4.3
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-08 16:17 UTC by Mike Tedder
Modified: 2007-02-12 10:45 UTC (History)
2 users (show)

See Also:
Host: powerpc-unknown-linux-gnu
Target: powerpc-unknown-linux-gnu
Build: powerpc-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments
requested config.log from failed compile (20.86 KB, text/plain)
2004-12-14 16:23 UTC, Mike Tedder
Details
requested config.log from failed compile (in nof) (21.41 KB, text/plain)
2004-12-14 16:24 UTC, Mike Tedder
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Tedder 2004-12-08 16:17:09 UTC
After bootstraping the newly built gcc, make fails on linking libstdc++-v3:

/usr/src/gcc-3.4.3-objdir/gcc/xgcc -shared-libgcc -B/usr/src/gcc-3.4.3-objdir/
gcc/ -nostdinc++ -L/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/nof/
libstdc++-v3/src -L/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/nof/
libstdc++-v3/src/.libs -B/usr/local/powerpc-unknown-linux-gnu/bin/ -B/usr/local/
powerpc-unknown-linux-gnu/lib/ -isystem /usr/local/powerpc-unknown-linux-gnu/
include -isystem /usr/local/powerpc-unknown-linux-gnu/sys-include  -msoft-float 
-fPIC -mstrict-align -shared /usr/lib/crti.o /usr/src/gcc-3.4.3-objdir/gcc/nof/
crtbeginS.o  .libs/allocator.o .libs/codecvt.o .libs/complex_io.o .libs/ctype.o 
.libs/debug.o .libs/debug_list.o .libs/functexcept.o .libs/globals_locale.o .
libs/globals_io.o .libs/ios.o .libs/ios_failure.o .libs/ios_init.o .libs/
ios_locale.o .libs/limits.o .libs/list.o .libs/locale.o .libs/locale_init.o .
libs/locale_facets.o .libs/localename.o .libs/stdexcept.o .libs/strstream.o .
libs/tree.o .libs/allocator-inst.o .libs/concept-inst.o .libs/fstream-inst.o .
libs/ext-inst.o .libs/io-inst.o .libs/istream-inst.o .libs/locale-inst.o .libs/
locale-misc-inst.o .libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o .
libs/streambuf-inst.o .libs/string-inst.o .libs/valarray-inst.o .libs/wlocale-
inst.o .libs/wstring-inst.o .libs/atomicity.o .libs/codecvt_members.o .libs/
collate_members.o .libs/ctype_members.o .libs/messages_members.o .libs/
monetary_members.o .libs/numeric_members.o .libs/time_members.o .libs/
basic_file.o .libs/c++locale.o .libs/libstdc++.lax/libmath.a/stubs.o  .libs/
libstdc++.lax/libsupc++convenience.a/del_op.o .libs/libstdc++.lax/
libsupc++convenience.a/del_opnt.o .libs/libstdc++.lax/libsupc++convenience.a/
del_opv.o .libs/libstdc++.lax/libsupc++convenience.a/del_opvnt.o .libs/
libstdc++.lax/libsupc++convenience.a/eh_alloc.o .libs/libstdc++.lax/
libsupc++convenience.a/eh_aux_runtime.o .libs/libstdc++.lax/
libsupc++convenience.a/eh_catch.o .libs/libstdc++.lax/libsupc++convenience.a/
eh_exception.o .libs/libstdc++.lax/libsupc++convenience.a/eh_globals.o .libs/
libstdc++.lax/libsupc++convenience.a/eh_personality.o .libs/libstdc++.lax/
libsupc++convenience.a/eh_term_handler.o .libs/libstdc++.lax/
libsupc++convenience.a/eh_terminate.o .libs/libstdc++.lax/libsupc++convenience.
a/eh_throw.o .libs/libstdc++.lax/libsupc++convenience.a/eh_type.o .libs/
libstdc++.lax/libsupc++convenience.a/eh_unex_handler.o .libs/libstdc++.lax/
libsupc++convenience.a/guard.o .libs/libstdc++.lax/libsupc++convenience.a/
new_handler.o .libs/libstdc++.lax/libsupc++convenience.a/new_op.o .libs/
libstdc++.lax/libsupc++convenience.a/new_opnt.o .libs/libstdc++.lax/
libsupc++convenience.a/new_opv.o .libs/libstdc++.lax/libsupc++convenience.a/
new_opvnt.o .libs/libstdc++.lax/libsupc++convenience.a/pure.o .libs/libstdc++.
lax/libsupc++convenience.a/tinfo.o .libs/libstdc++.lax/libsupc++convenience.a/
tinfo2.o .libs/libstdc++.lax/libsupc++convenience.a/vec.o .libs/libstdc++.lax/
libsupc++convenience.a/vterminate.o .libs/libstdc++.lax/libsupc++convenience.a/
cp-demangle.o   -L/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/nof/
libstdc++-v3/src -L/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/nof/
libstdc++-v3/src/.libs -lm ../libmath/.libs/libmath.a -lm ../libsupc++/.libs/
libsupc++convenience.a -lm -L/usr/src/gcc-3.4.3-objdir/gcc/nof -L/usr/src/gcc-3.
4.3-objdir/gcc -L/usr/local/powerpc-unknown-linux-gnu/bin -L/usr/local/powerpc-
unknown-linux-gnu/lib -L/usr/local/lib/gcc/powerpc-unknown-linux-gnu/../../../
powerpc-unknown-linux-gnu/lib -L/usr/local/lib/gcc/powerpc-unknown-linux-gnu/../
.. -lgcc_s_nof -lc -lgcc_s_nof -lm -lgcc_s_nof -lc -lgcc_s_nof   /usr/src/gcc-3.
4.3-objdir/gcc/nof/crtsavres.o /usr/src/gcc-3.4.3-objdir/gcc/nof/crtendS.o /usr/
lib/crtn.o  -o .libs/libstdc++.so.6.0.3
/usr/lib/crti.o(.init+0x0): In function `_init':
: multiple definition of `_init'
/usr/lib/crti.o(.init+0x0): first defined here
/usr/lib/crti.o(.fini+0x0): In function `_fini':
: multiple definition of `_fini'
/usr/lib/crti.o(.fini+0x0): first defined here
/usr/src/gcc-3.4.3-objdir/gcc/nof/crtbeginS.o(.data.rel+0x0): multiple 
definition of `__dso_handle'
/usr/src/gcc-3.4.3-objdir/gcc/nof/crtbeginS.o(.data.rel+0x0): first defined here
/usr/src/gcc-3.4.3-objdir/gcc/nof/crtsavres.o(.text+0x0): In function 
`_savefpr_14':
: multiple definition of `_savefpr_14'
[repeat multiple definition errors for _savefpr_14 -> 31]
[repeat multiple definition errors for _savegpr_14 -> 31]
[repeat multiple definition errors for _restfpr_14 -> 31]
[repeat multiple definition errors for _restgpr_14 -> 31]
[repeat multiple definition errors for _restfpr_14_x -> 31]
[repeat multiple definition errors for _restgpr_14_x -> 31]
collect2: ld returned 1 exit status
make[7]: *** [libstdc++.la] Error 1
make[7]: Leaving directory `/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/
nof/libstdc++-v3/src'
make[6]: *** [all-recursive] Error 1
make[6]: Leaving directory `/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/
nof/libstdc++-v3'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/
nof/libstdc++-v3'
make[4]: *** [multi-do] Error 1
make[4]: Leaving directory `/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/
libstdc++-v3'
make[3]: *** [all-multi] Error 2
make[3]: Leaving directory `/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/
libstdc++-v3'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/
libstdc++-v3'
make[1]: *** [all-target-libstdc++-v3] Error 2
make[1]: Leaving directory `/usr/src/gcc-3.4.3-objdir'
make: *** [bootstrap] Error 2
bash-3.00:/usr/src/gcc-3.4.3-objdir$ 

configure (in this particular case) was run with:

../gcc-3.4.3/configure --with-cpu=603 --enable-languages=c,c++ --disable-
checking --disable-altivec

I previously tried configure with no options and got the same result.  Previous 
versions of GCC (3.3.3 and 3.4.0) both resulted in this same problem -- however 
I did not need a c++ compiler at the time, so I simply specified 'c' for enable-
languages and left it at that.

I've tried searching around for anything related to this and haven't had any 
luck -- am I the only one?  :/  Thanks to anyone who can help out.
Comment 1 Andrew Pinski 2004-12-08 16:20:58 UTC
libtool looks like it is messing up.
Comment 2 Andrew Pinski 2004-12-12 21:35:20 UTC
Can you attach the config.log that is in libstdc++ directory?
Comment 3 Mike Tedder 2004-12-14 16:23:44 UTC
Created attachment 7740 [details]
requested config.log from failed compile

taken from "/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/libstdc++-v3"
Comment 4 Mike Tedder 2004-12-14 16:24:35 UTC
Created attachment 7741 [details]
requested config.log from failed compile (in nof)

taken from
"/usr/src/gcc-3.4.3-objdir/powerpc-unknown-linux-gnu/nof/libstdc++-v3"
Comment 5 Mike Tedder 2004-12-14 16:31:58 UTC
I attached the config.log file you requested.  I wasn't sure if you were 
interested in the one also located in nof/, so I attached them both.

If it matters at all, I'm using binutils-2.13.90.0.10 (built with gcc-3.4.3) and 
 glibc-2.2.3.

Let me know if I can be of any more help.  I'm still trying to trace it down on 
my end here.  Thanks!
Comment 6 Benjamin Kosnik 2005-01-06 05:32:07 UTC
Have you noticed the successful build reports? They are here:

http://gcc.gnu.org/gcc-3.4/buildstat.html

So, this is possible. You just need to figure out how your setup differs from
the successful reports.

I don't see what version of binutils you are using. You might want to specify,
or try something like:

%ld --version
GNU ld version 2.15.92.0.2 20040927

-benjamin

Comment 7 Andrew Pinski 2005-01-06 06:18:52 UTC
Can you try a newer binutils than 2.13.90.0.10, since that is known to have bugs?

And since this is known to work for other people?
Comment 8 Mike Tedder 2005-01-06 13:37:48 UTC
Sorry for the late reply.  Yes, I've noticed that gcc-3.4.0 and 3.4.1 has been 
successfully built for powerpc, which is why I figured I might have done 
something wrong.

I upgraded to binutils-2.14 and glibc-2.3.3.  Still, libstdc++-v3 would not 
successfully build.  I looked through the link process, and found what .o files 
were causing the multiple definition errors, and determined that libtool was 
calling gcc incorrectly (as Andrew mentioned).

As a test, I then downloaded and built libtool-1.5.10 locally, and when 
libstdc++-v3 failed to link, I overwrote the libtool script included with gcc 
(looks to be "1.4a-GCC3.0") with the one installed in /usr/bin, and ran make 
again.  Aside from getting a "libtool: ignoring unknown tag CXX" error, 
libstdc++-v3 linked fine.  I can compile, link, and run C++ programs which use 
the stdc library without problems.

After continuing the build process, libjava also ran into exactly the same 
problem.  Replacing libtool and running make again made the build process 
complete successfully.

So... it looks like the version of libtool included with gcc just needs a small 
version up, perhaps?
Comment 9 Andrew Pinski 2005-08-06 15:19:24 UTC
This works for everyone else, I have no idea what your problem is here.

Maybe you are over writting the libtool in GCC which is just wrong, you should be able to just mkdir 
objdir;cd objdir;$(srcdir)/configure && make bootstrap && make install and it will just work.

Since this works for me and others I am closing as works for me.
Comment 10 Mike Tedder 2005-08-06 18:16:30 UTC
I wouldn't have opened this bug if the standard configure && make bootstrap && 
make install had worked in the first place.  It might have helped more if you 
had asked me more questions about my system and/or configuration instead of just 
saying "it works for me".

My suggestion of updating the libtool included with gcc was only that -- a 
suggestion.  While it may be "wrong", it did fix the linker errors, so I simply 
let everyone know what I had found out.

I have plans to upgrade to gcc-4.0.1 in the near future.  If I still have the 
same problem, I will be opening a new bug report.
Comment 11 Mike Tedder 2007-02-12 10:45:52 UTC
Whatever this bug was in 3.4.3, does not occur or has been fixed in gcc-3.4.6 or gcc-4.1.1.  Both of these compile bootstrap without any problems.

For the record (and just to make sure it wasn't anything specific with my setup), after successfully building with 3.4.6, trying to make bootstrap on 3.4.3 again results in the above compilation error when trying to build libstdc++-v3.