--as-needed problem

Michael Matz matz at kde.org
Thu Nov 18 14:37:32 GMT 2004


Hi David,

On Thu, 18 Nov 2004, David Faure wrote:

> g++ -shared -nostdlib -Wl,--no-undefined -Wl,--allow-shlib-undefined
> -Wl,-t -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 -g -O2
> -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 -D_GNU_SOURCE -Q -v
> /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/../../../crti.o
> /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/crtbeginS.o
> ../kicker/.libs/dummy.o -Wl,--whole-archive
> ../kicker/core/.libs/libkicker_core.a
> ../kicker/buttons/.libs/libkicker_buttons.a
> ../kicker/ui/.libs/libkicker_ui.a-Wl,--no-whole-archive -Wl,--rpath
> -Wl,/mnt/devel/kde/kdedir/lib -Wl,--rpath -Wl,/usr/lib/qt3/lib
> -Wl,--rpath -Wl,/usr/X11R6/lib -Wl,--rpath
> -Wl,/mnt/devel/kde/kdecvs/qt-copy/lib -L/mnt/devel/kde/kdedir/lib
> -L/mnt/devel/kde/kdecvs/qt-copy/lib -L/usr/X11R6/lib -L/usr/lib -lXtst
> /mnt/devel/kde/kdecvs/build/kdebase/libkonq/.libs/libkonq.so
> /mnt/devel/kde/kdedir/lib/libkparts.so -L/usr/lib/qt3/lib
> /usr/lib/libkdecore.so /usr/lib/libDCOP.so /usr/lib/libkdefx.so

Well.  Look at these.  It explicitely mentions /usr/lib/libXXX.so in the 
link line, so it's no wonder that the linker later picks them up.  So, 
it's not clear that as-needed is the problem, but instead the Makefile, 
which has /usr/lib/kdecore.so in the libs, or libtool, which somehow adds 
it to its flags (perhaps because of some stale .la file?).


Ciao,
Michael.




More information about the kde-core-devel mailing list