--as-needed problem

David Faure faure at kde.org
Tue Nov 9 17:32:24 GMT 2004


On Tuesday 09 November 2004 18:27, Matt Rogers wrote:
> On Tuesday 09 November 2004 11:17 am, Szombathelyi György wrote:
> > 2004. november 9. 13.52 dátummal Lubos Lunak ezt írta:
> > >  Hello,
> > >
> > >  there seems to be a problem with --enable-as-needed. I updated kdelibs,
> > > and I get the following error when building it:
> > >
> > > ./kdoctools/meinproc --srcdir=/home/llunak/build/src/kdelibs/kdoctools
> > > --check --cache ./doc/kspell/index.cache.bz2
> > > /home/llunak/build/src/kdelibs/doc/kspell/index.docbook
> > > /home/llunak/build/suse/kdelibs/kdoctools/.libs/lt-meinproc: symbol
> > > lookup error: /home/llunak/build/suse/kdelibs/kio/.libs/libkio.so.4:
> > > undefined symbol: _ZN9KIconView8takeItemEP13QIconViewItem
> > > Error creating ./doc/kspell/index.cache.bz2. Exit status 127.
> > >
> > >  That's a clean checkout and clean build, from today about 12:00 CET.
> > > Using --disable-as-needed with configure and relinking avoids the
> > > problem.
> > >
> > >  The undefined symbol above is from KIconView, i.e. libkdeui. Using ldd
> > > on lt-meinproc shows that e.g. libkio is used from builddir, but libkdeui
> > > is used from $KDEDIR/lib . Since it's been a couple of days since my last
> > > update, the installed libkdeui doesn't have the symbol yet.
> > >
> > >  Can somebody fix it please?
> >
> > The problem is that libtool puts all paths to direct and indirect
> > dependencies into the RPATH section of lt-meinproc, but since libkdeui is
> > not a direct dependency, it's not listed in the NEEDED section.
> >
> > $ objdump -p lt-meinproc (only relevant parts):
> >
> >   NEEDED      libkio.so.4
> >   NEEDED      libkdecore.so.4
> >   NEEDED      libqt-mt.so.3
> >   NEEDED      libbz2.so.1
> >   NEEDED      libxslt.so.1
> >   NEEDED      libxml2.so.2
> >   NEEDED      libstdc++.so.5
> >   NEEDED      libc.so.6
> >   RPATH      
> > /home/gyuri/cvs/kdelibs/kio/.libs:/home/gyuri/cvs/kdelibs/kdeui/.libs:/home
> >/gyuri/cvs/kdelibs/kdesu/.libs:/home/gyuri/cvs/kdelibs/kwallet/client/.libs:
> >/home/gyuri/cvs/kdelibs/kdecore/.libs:/home/gyuri/cvs/kdelibs/dcop/.libs:/ho
> >me/gyuri/cvs/kdelibs/kdefx/.libs:/opt/kde3/lib:/usr/lib/qt-3.3/lib:/usr/X11R
> >6/lib:/usr/lib
> >
> > $ objdump -p lt-meinproc:
> >   RPATH       /opt/kde3/lib:/usr/lib/qt-3.3/lib:/usr/X11R6/lib
> >
> >
> > So the library path for libkdeui is picked from libkio (libkio is depend
> > directly on libkdeui), which has the RPATH set to $KDEDIR/lib. But if you
> > remove $KDEDIR/lib/libkio.so.4, the dynamic linker falls back to the RPATH
> > in lt-meinproc, and everything will work again.
> > I hope this small(?) inconvenience will not end in removing the --as-needed
> > patch (if you're a developer, and disturbed by this behavior you can always
> > compile with --disable-as-needed), it's _very_ useful for making KDE
> > packages.

If it prevents compiling kdelibs, it won't be any good to packagers either.

This sounds like two conflicting libtool features - can't it be fixed in libtool somehow?
(hacking the RPATH or something)

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list