Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 69475 - kde packages fail to compile with undefined STL references
Summary: kde packages fail to compile with undefined STL references
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://www.nomorepasting.com/paste.ph...
Whiteboard:
Keywords:
: 72687 81428 84606 91721 99109 99798 100182 100596 102604 103971 106107 114943 117642 119886 124438 126210 155435 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-29 17:32 UTC by Andrew
Modified: 2006-11-16 18:14 UTC (History)
22 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew 2004-10-29 17:32:28 UTC
When I try to emerge kdegraphics 3.3.1-r1 that compile halts at the following place.

Reproducible: Always
Steps to Reproduce:
1. ACCEPT_KEYWORDS="~x86" emerge -u kdegraphics
2.
3.

Actual Results:  
/bin/sh ../../libtool --silent --mode=link --tag=CXX i686-pc-linux-gnu-g++ 
-Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500
-D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W
-Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -march=pentium4 -O3
-pipe -Wformat-security -Wmissing-format-attribute -fno-exceptions
-fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL
-DQT_NO_COMPAT -DQT_NO_TRANSLATION   -o kcm_kgamma.la -rpath
/usr/kde/3.3/lib/kde3 -L/usr/X11R6/lib -L/usr/qt/3/lib -L/usr/kde/3.3/lib 
-module -avoid-version -module -no-undefined -Wl,--no-undefined
-Wl,--allow-shlib-undefined -R /usr/kde/3.3/lib -R /usr/qt/3/lib -R
/usr/X11R6/lib  xf86configpath.lo xvidextwrap.lo displaynumber.lo gammactrl.lo
kgamma.lo -lXxf86vm -lkdeui -lkdecore -lqt-mt  -lz -lpng -lz -lm -lXext -lX11 
-lSM -lICE -lpthread
.libs/xf86configpath.o(.text+0x1c): In function `XF86ConfigPath::XF86ConfigPath()':
: undefined reference to `std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_S_empty_rep_storage'
.libs/xf86configpath.o(.text+0x300): In function `XF86ConfigPath::XF86ConfigPath()':
: undefined reference to `std::__default_alloc_template<true,
0>::deallocate(void*, unsigned int)'
.libs/xf86configpath.o(.text+0x4f8): In function `XF86ConfigPath::XF86ConfigPath()':
: undefined reference to `std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_S_empty_rep_storage'
.libs/xf86configpath.o(.text+0x7dc): In function `XF86ConfigPath::XF86ConfigPath()':
: undefined reference to `std::__default_alloc_template<true,
0>::deallocate(void*, unsigned int)'
.libs/xf86configpath.o(.gnu.linkonce.t._ZNSt6vectorISsSaISsEE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPSsS1_EERKSs+0x1d6):
In function `std::vector<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >*,
std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char>
>, std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&)':
: undefined reference to `std::__default_alloc_template<true,
0>::deallocate(void*, unsigned int)'
.libs/xf86configpath.o(.gnu.linkonce.t._ZNSt6vectorISsSaISsEE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPSsS1_EERKSs+0x20b):
In function `std::vector<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >>
>::_M_insert_aux(__gnu_cxx::__normal_iterator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >*,
std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char>
>, std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > >, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > const&)':
: undefined reference to `std::__default_alloc_template<true,
0>::allocate(unsigned int)'
.libs/xvidextwrap.o(.text+0x2e7): In function `XVidExtWrap::_ScreenCount()':
: undefined reference to `std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_S_empty_rep_storage'
.libs/xvidextwrap.o(.text+0x947): In function `XVidExtWrap::_ScreenCount()':
: undefined reference to `std::__default_alloc_template<true,
0>::deallocate(void*, unsigned int)'
.libs/xvidextwrap.o(.gnu.linkonce.t._ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE7seekposESt4fposI11__mbstate_tESt13_Ios_Openmode+0x110):
In function `std::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >::seekpos(std::fpos<__mbstate_t>, std::_Ios_Openmode)':
: undefined reference to `std::basic_streambuf<char, std::char_traits<char>
>::_M_out_cur_move(long)'
.libs/xvidextwrap.o(.gnu.linkonce.t._ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE8overflowEi+0x140):
In function `std::basic_stringbuf<char, std::char_traits<char>,
std::allocator<char> >::overflow(int)':
: undefined reference to `std::basic_streambuf<char, std::char_traits<char>
>::_M_out_cur_move(long)'
.libs/xvidextwrap.o(.gnu.linkonce.t._ZNSs12_S_constructIPcEES0_T_S1_RKSaIcESt20forward_iterator_tag+0x39):
In function `char* std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_S_construct<char*>(char*, char*, std::allocator<char>
const&, std::forward_iterator_tag)':
: undefined reference to `std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_Rep::_S_create(unsigned int, std::allocator<char> const&)'
.libs/xvidextwrap.o(.gnu.linkonce.t._ZNSs12_S_constructIPcEES0_T_S1_RKSaIcESt20forward_iterator_tag+0x8c):
In function `char* std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_S_construct<char*>(char*, char*, std::allocator<char>
const&, std::forward_iterator_tag)':
: undefined reference to `std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_S_empty_rep_storage'
collect2: ld returned 1 exit status
make[4]: *** [kcm_kgamma.la] Error 1
make[4]: Leaving directory
`/var/tmp/portage/kdegraphics-3.3.1-r1/work/kdegraphics-3.3.1/kgamma/kcmkgamma'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/var/tmp/portage/kdegraphics-3.3.1-r1/work/kdegraphics-3.3.1/kgamma/kcmkgamma'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory
`/var/tmp/portage/kdegraphics-3.3.1-r1/work/kdegraphics-3.3.1/kgamma'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/var/tmp/portage/kdegraphics-3.3.1-r1/work/kdegraphics-3.3.1'
make: *** [all] Error 2

!!! ERROR: kde-base/kdegraphics-3.3.1-r1 failed.
!!! Function kde_src_compile, Line 142, Exitcode 2
!!! died running emake, kde_src_compile:make

Expected Results:  
kdegraphics 3.3.1-r1 compiled and installed

Portage 2.0.51-r2 (default-x86-2004.2, gcc-3.3.4, glibc-2.3.4.20041021-r0,
2.6.8-gentoo-r7 i686)
=================================================================
System uname: 2.6.8-gentoo-r7 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Gentoo Base System version 1.6.4
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.92.0.2-r1
Headers:  sys-kernel/linux-headers-2.4.22
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config
/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks sandbox"
GENTOO_MIRRORS="http://*******/mirrors/gentoo/ http://gentoo.oregonstate.edu
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X alsa apm arts avi berkdb bitmap-fonts cdr crypt cups encode esd f77
foomaticdb gdbm gif gnome gpm gtk gtk2 imlib ipv6 java jpeg kde libg++ libwww
lirc mad mikmod motif mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png
python qt quicktime readline sdl slang spell ssl svga tcltk tcpd tetex truetype
x86 xml2 xmms xv zlib"
Comment 1 Rich Vieira 2004-11-09 08:18:27 UTC
I am having the same issue but emerging kdegraphics 3.3.1-r2 with gcc-3.4.2-r2
Here is my error list:
 std::char_traits<char>, std::allocator<char> > > >::erase(__gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, __gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::basic_string<char, std::char_traits<char>,std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >)':
: undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)'
collect2: ld returned 1 exit status
make[4]: *** [kcm_kgamma.la] Error 1
make[4]: Leaving directory `/var/tmp/portage/kdegraphics-3.3.1-r2/work/kdegraphics-3.3.1/kgamma/kcmkgamma'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/kdegraphics-3.3.1-r2/work/kdegraphics-3.3.1/kgamma/kcmkgamma'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/kdegraphics-3.3.1-r2/work/kdegraphics-3.3.1/kgamma'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/kdegraphics-3.3.1-r2/work/kdegraphics-3.3.1'
make: *** [all] Error 2


Any new info on this?
Comment 2 Simone Gotti (RETIRED) gentoo-dev 2004-11-09 08:27:31 UTC
I'm of the idea that this is an issue with your build environment and not a kde bug. Maybe I'm wrong. 

Toolchain can you give us any thoughts?
Comment 3 Caleb Tennis (RETIRED) gentoo-dev 2004-11-09 10:12:16 UTC
Are you sure you have the same gcc and glibc versions on all of the machines if using distcc?

Try turning off ccache and see if that helps, too.
Comment 4 Gregorio Guidi (RETIRED) gentoo-dev 2004-11-09 14:30:49 UTC
This is another one similar to bug 70527 and bug 67926.
This must be a toolchain issue...
As said on bug 67926, after the recent troubles with libtool, my first
try would be to reemerge that, or a newer revision.
Comment 5 Simone Gotti (RETIRED) gentoo-dev 2004-11-28 04:17:13 UTC
*** Bug 72687 has been marked as a duplicate of this bug. ***
Comment 6 Tom Wolfe 2004-11-28 16:27:28 UTC
I tried reemerging libtool, then tried emerging kdegraphics and no luck yet again..
Comment 7 Simone Gotti (RETIRED) gentoo-dev 2004-11-28 16:32:39 UTC
All of you are using gcc 3.3 or also gcc 3.4?
Comment 8 Tro 2004-11-29 11:12:26 UTC
I'm using gcc 3.4.3 and getting the same error.
Comment 9 Tom Wolfe 2004-12-10 14:56:05 UTC
seems to be working with 3.3.2, compiled just fine.  Should this be closed?
Comment 10 Caleb Tennis (RETIRED) gentoo-dev 2004-12-10 15:10:07 UTC
lets see if it's a problem for anyone else
Comment 11 Tro 2004-12-10 21:52:47 UTC
Strange. Works for me now. The only thing I added to my CFLAGS was "-fstack-protector" to get arts to compile (different bug). Nothing else was changed.
Comment 12 Adam Jakubek 2005-01-20 14:18:22 UTC
This bug is caused by binutils-2.15.92.0.2-r1. It seems that this version treats undefined references to these libstdc++ symbols as errors. A possible workaround is to downgrade to version 2.15.90.0.1.1-r3, which emits warnings, but doesn't abort the compilation. Note, that these errors occur on gcc-3.3.4 only (at least on my machine). Switching to gcc-3.4.3 allows to build kdegraphics (and koffice, which is affected too) with latest binutils.
Comment 13 Torsten Kaiser 2005-01-21 19:06:55 UTC
Same bug here: kdegraphics-3.3.2-r2
Failed with both gcc-3.3.5 and gcc-3.4.3
Binutils: 2.15.92.0.2-r1

The command failing is:
/bin/sh ../../libtool --silent --mode=link --tag=CXX i686-pc-linux-gnu-g++  -Wnon-virtual-dtor -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -DNDEBUG -DNO_DEBUG -O2 -O3 -pipe -fomit-frame-pointer -march=athlon-xp -Wformat-security -Wmissing-format-attribute -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION    -o kcm_kgamma.la -rpath /usr/kde/3.3/lib/kde3 -L/usr/lib -L/usr/qt/3/lib -L/usr/kde/3.3/lib  -module -avoid-version -module -no-undefined -Wl,--no-undefined -Wl,--allow-shlib-undefined -R /usr/kde/3.3/lib -R /usr/qt/3/lib -R /usr/lib  xf86configpath.lo xvidextwrap.lo displaynumber.lo gammactrl.lo kgamma.lo -lXxf86vm -lkdeui -lkdecore -lqt-mt  -lz -lpng -lz -lm -lXext -lX11  -lSM -lICE -lpthread

Removing the -Wl,--no-undefined allows the command to succeed.

The binutils change might have change the way the parameters are parse and now it no longer ignores the --no-undefined.
But I would think this is a bug of the makefile (or configure?) rather than of binutils.

# cd /var/tmp/portage/kdegraphics-3.3.2-r2/work/kdegraphics-3.3.2/kgamma/kcmkgamma
# grep -e --no-undefined *
Makefile:KDE_NO_UNDEFINED = -Wl,--no-undefined -Wl,--allow-shlib-undefined
# grep KDE_NO_UNDEFINED *
Makefile:KDE_NO_UNDEFINED = -Wl,--no-undefined -Wl,--allow-shlib-undefined
Makefile:KDE_PLUGIN = -avoid-version -module -no-undefined $(KDE_NO_UNDEFINED) $(KDE_RPATH) $(KDE_MT_LDFLAGS)
Makefile.in:KDE_NO_UNDEFINED = @KDE_NO_UNDEFINED@
Comment 14 Matt Hargett 2005-01-22 17:49:03 UTC
same thing here with kdegraphics-3.3.2-r2. did an 'emerge sync' and then 'emerge world' after not updating 
for some time. kdegraphics failed the exact same way. re-emerging libtool didn't
 help. I tried gcc 3.3.3 and gcc 3.4.3, no difference. manually emerging 
binutils-2.15.94.0.2 and trying again didn't help either. any specific steps on
how to work around this other than stopping the build and manually editing the
makefile?
Comment 15 Torsten Kaiser 2005-01-23 06:34:55 UTC
Ok, found out was was the probable cause on my system.

I have a second gentoo-x86 system with the same versions of gcc, binutil, libtool etc. But there the problem did not surface.
emerge --info was identical except for USE flags, but on the failing system I had trouble with some .la files after upgrading gcc-3.3 (-> fix_libtool_files.sh), so I suspected the cause might be related.

What I found were that some kde-related .la files contained /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/libstdc++.la, some /usr/lib/gcc-lib/i686-pc-linux-gnu/3.4.3/libstdc++.la and some even *both* !

I would suspect this was cause by emerging parts of kde with gcc3.3 and other parts with gcc3.4. I probably missed a source /etc/profile after upgrading from 3.3.4 to 3.3.5 or something like this.

My solution: using gcc3.4 to reemerge the parts of kde that are needed by kdegraphics.

Running 'emerge --oneshot arts kdelibs kdebase kdegraphics' succeded and I now have kdegraphics-3.3.2-r2 installed.

'emerge -e kdegraphics' or 'emerge -e world' is probably overkill, but should solve the problem in all cases. (I hope.)
Comment 16 Simone Gotti (RETIRED) gentoo-dev 2005-01-23 08:27:55 UTC
I'm copying and pasting a comment I made on some other bugs:

In fact the mixing of libstdc++.so.5 and .6 caused by linking a library compiled with gcc 3.3 and the program compiled with gcc 3.4 will bring to these crashes and errors.

I've opened a thread on this in the italian forum: http://forums.gentoo.org/viewtopic.php?t=242168

A simple command to launch for fixing will be: (better than an emerge -e world)

1) assure that you are using gcc-3.4.x. 

2) rm ~/.revdep-rebuild*
revdep-rebuild -X --soname libstdc++.so.5

This will find all the libraries/programs linked to libstdc++.so.5 and recompile them with gcc 3.4.2.

if you get some errors, try launching emerge by hand editing the gived emerge command and removing "--oneshot" and the forcing to that version (=foo-ver). But remember to not remove any ebuild from the emerge command because the order is important, as you need to rebuild all in the dependencies order.
Comment 17 Gregorio Guidi (RETIRED) gentoo-dev 2005-02-09 16:44:46 UTC
*** Bug 81428 has been marked as a duplicate of this bug. ***
Comment 18 Gregorio Guidi (RETIRED) gentoo-dev 2005-03-09 02:26:52 UTC
*** Bug 84606 has been marked as a duplicate of this bug. ***
Comment 19 Gregorio Guidi (RETIRED) gentoo-dev 2005-05-06 14:33:00 UTC
*** Bug 91721 has been marked as a duplicate of this bug. ***
Comment 20 Carsten Lohrke (RETIRED) gentoo-dev 2005-05-07 10:20:39 UTC
toolchain herd, the problem seem still to persist with gcc-3.3.x and binutils-2.15.92.0.2-r7, any input?
Comment 21 Gregorio Guidi (RETIRED) gentoo-dev 2005-06-13 13:38:48 UTC
*** Bug 96008 has been marked as a duplicate of this bug. ***
Comment 22 Gregorio Guidi (RETIRED) gentoo-dev 2005-07-21 07:34:07 UTC
*** Bug 99798 has been marked as a duplicate of this bug. ***
Comment 23 Gregorio Guidi (RETIRED) gentoo-dev 2005-07-25 02:38:14 UTC
*** Bug 100182 has been marked as a duplicate of this bug. ***
Comment 24 Gregorio Guidi (RETIRED) gentoo-dev 2005-07-28 10:35:43 UTC
*** Bug 100596 has been marked as a duplicate of this bug. ***
Comment 25 Gregorio Guidi (RETIRED) gentoo-dev 2005-08-15 06:37:58 UTC
*** Bug 102604 has been marked as a duplicate of this bug. ***
Comment 26 Caleb Tennis (RETIRED) gentoo-dev 2005-09-18 07:18:41 UTC
*** Bug 106107 has been marked as a duplicate of this bug. ***
Comment 27 Gregorio Guidi (RETIRED) gentoo-dev 2005-09-19 03:07:59 UTC
*** Bug 103971 has been marked as a duplicate of this bug. ***
Comment 28 Mark Loeser (RETIRED) gentoo-dev 2005-12-12 07:02:02 UTC
Make sure all packages are merged with the same version of gcc, or you will have
fun errors like this one :)
Comment 29 Caleb Tennis (RETIRED) gentoo-dev 2005-12-12 07:28:10 UTC
This also commonly gets picked up from ccached files and leftovers 
in /var/tmp/portage, so a cleanout of some of those things might be very 
helpful in making this error go away. 
Comment 30 Caleb Tennis (RETIRED) gentoo-dev 2006-02-23 08:25:49 UTC
*** Bug 119886 has been marked as a duplicate of this bug. ***
Comment 31 Caleb Tennis (RETIRED) gentoo-dev 2006-02-23 08:48:54 UTC
*** Bug 117642 has been marked as a duplicate of this bug. ***
Comment 32 Caleb Tennis (RETIRED) gentoo-dev 2006-02-27 07:32:37 UTC
*** Bug 99109 has been marked as a duplicate of this bug. ***
Comment 33 Caleb Tennis (RETIRED) gentoo-dev 2006-02-27 07:44:17 UTC
*** Bug 114943 has been marked as a duplicate of this bug. ***
Comment 34 Jakub Moc (RETIRED) gentoo-dev 2006-02-28 10:16:34 UTC
*** Bug 124438 has been marked as a duplicate of this bug. ***
Comment 35 Caleb Tennis (RETIRED) gentoo-dev 2006-03-24 05:44:50 UTC
*** Bug 126210 has been marked as a duplicate of this bug. ***
Comment 36 Caleb Tennis (RETIRED) gentoo-dev 2006-11-16 18:14:07 UTC
*** Bug 155435 has been marked as a duplicate of this bug. ***