Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 128216

Summary: kdelibs-3.5.2 does not compile on amd64 probably LDFLAGS related
Product: Gentoo Linux Reporter: Benjamin Schindler (RETIRED) <config>
Component: [OLD] KDEAssignee: Gentoo KDE team <kde>
Status: RESOLVED INVALID    
Severity: normal CC: patrizio.bassi
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Benjamin Schindler (RETIRED) gentoo-dev 2006-03-31 02:00:12 UTC
Kdelibs fails to compile on my amd64 system. I have a patched glibc/binutils (bdirect support) and specified appropriate LDFLAGS here. I'm posting this here as kde-3.5.1 did not have these issues. Could be related to --as-needed LDFLAG, but I'm not sure. I will try with other combinations of LDFLAGS etc, but I would really love to have those enabled.

First, I get this: 

/bin/sh ../libtool --silent --tag=CXX --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../dcop -I../kdecore -I../kio/kssl -I../kjs -I./.. -I../dcop -I../libltdl -I../kdefx -I../kdecore -I../kdecore -I../kdeui -I../kio -I../kio/kio -I../kio/kfile -I.. -I/usr/qt/3/include -I. -I/usr/kde/3.5/include   -D_LARGEFILE64_SOURCE -DQT_THREAD_SUPPORT  -D_REENTRANT  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -Os -pipe -march=k8 -fomit-frame-pointer -ftracer -fweb -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION  -c -o dummy.lo dummy.cpp
/bin/sh ../libtool --silent --tag=CXX --mode=link x86_64-pc-linux-gnu-g++  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -Os -pipe -march=k8 -fomit-frame-pointer -ftracer -fweb -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION   -Wl,-O1 -Wl,--sort-common -Wl,--enable-new-dtags -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort -o libkio.la -rpath /usr/kde/3.5/lib64 -version-info 6:0:2 -no-undefined -Wl,--no-undefined -Wl,--allow-shlib-undefined -L/usr/kde/3.5/lib64 -L/usr/qt/3/lib64 -L/usr/lib64     dummy.lo kssl/libkssl.la kio/libkiocore.la kio/libksycoca.la bookmarks/libkbookmarks.la kfile/libkfile.la ../kdeui/libkdeui.la ../kdesu/libkdesu.la ../kwallet/client/libkwalletclient.la -lz -lfam

*** Warning: linker path does not have real file for library -lrpcsvc.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with librpcsvc and none of the candidates passed a file format test
*** using a file magic. Last file checked: /usr/lib64/librpcsvc.a
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.

Then, the build-system does something similar to libkio:

/bin/sh ../../libtool --silent --tag=CXX --mode=link x86_64-pc-linux-gnu-g++  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -Os -pipe -march=k8 -fomit-frame-pointer -ftracer -fweb -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION   -Wl,-O1 -Wl,--sort-common -Wl,--enable-new-dtags -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort -o kded_kpasswdserver.la -rpath /usr/kde/3.5/lib64/kde3 -L/usr/kde/3.5/lib64 -L/usr/qt/3/lib64 -L/usr/lib64    -module -avoid-version kded_kpasswdserver_la.all_cpp.lo  ../../kwallet/client/libkwalletclient.la ../../kio/libkio.la

*** Warning: This system can not link to static lib archive ../../kio/libkio.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** But as you try to build a module library, libtool will still create
*** a static module, that should work as long as the dlopening application
*** is linked with the -dlopen flag to resolve symbols at runtime.

Then, I get more of those warnings, and finally, compilation bails out here:
/bin/sh ../../libtool --silent --tag=CXX --mode=link x86_64-pc-linux-gnu-g++  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -Os -pipe -march=k8 -fomit-frame-pointer -ftracer -fweb -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION   -Wl,-O1 -Wl,--sort-common -Wl,--enable-new-dtags -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort -o kio_uiserver.la -rpath /usr/kde/3.5/lib64/kde3 -L/usr/kde/3.5/lib64 -L/usr/qt/3/lib64 -L/usr/lib64    -module -avoid-version kio_uiserver_dummy.lo libkdeinit_kio_uiserver.la
/bin/sh ../../libtool --silent --tag=CXX --mode=link x86_64-pc-linux-gnu-g++  -Wno-long-long -Wundef -ansi -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -Wcast-align -Wconversion -Wchar-subscripts -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -Os -pipe -march=k8 -fomit-frame-pointer -ftracer -fweb -Wformat-security -Wmissing-format-attribute -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common  -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION   -Wl,-O1 -Wl,--sort-common -Wl,--enable-new-dtags -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort -o kio_uiserver -R /usr/kde/3.5/lib64 -R /usr/kde/3.5/lib64 -R /usr/qt/3/lib64 -R /usr/lib64 -no-undefined -L/usr/kde/3.5/lib64 -L/usr/qt/3/lib64 -L/usr/lib64    kio_uiserver.la.o libkdeinit_kio_uiserver.la

*** Warning: This system can not link to static lib archive libkdeinit_kio_uiserver.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
*** But as you try to build a module library, libtool will still create
*** a static module, that should work as long as the dlopening application
*** is linked with the -dlopen flag to resolve symbols at runtime.
/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio/.libs/libkio.a(libkiocore_la.all_cpp.o): In function `Observer_stub::killJob(int)':libkiocore_la.all_cpp.cpp:(.text+0x1b910): multiple definition of `Observer_stub::killJob(int)'
./.libs/libkdeinit_kio_uiserver.a(libkdeinit_kio_uiserver_la.all_cpp.o):libkdeinit_kio_uiserver_la.all_cpp.cpp:(.text+0x5d7c): first defined here
/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.4/../../../../x86_64-pc-linux-gnu/bin/ld: Warning: size of symbol `Observer_stub::killJob(int)' changed from 509 in ./.libs/libkdeinit_kio_uiserver.a(libkdeinit_kio_uiserver_la.all_cpp.o) to 510 in /var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio/.libs/libkio.a(libkiocore_la.all_cpp.o)
/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio/.libs/libkio.a(libkiocore_la.all_cpp.o): In function `Observer_stub::metadata(int)':libkiocore_la.all_cpp.cpp:(.text+0x3c918): multiple definition of `Observer_stub::metadata(int)'
./.libs/libkdeinit_kio_uiserver.a(libkdeinit_kio_uiserver_la.all_cpp.o):libkdeinit_kio_uiserver_la.all_cpp.cpp:(.text+0x7070): first defined here
/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio/.libs/libkio.a(libkiocore_la.all_cpp.o): In function `Observer_stub::Observer_stub(QCString const&, QCString const&)':libkiocore_la.all_cpp.cpp:(.text+0x14036): multiple definition of `Observer_stub::Observer_stub(QCString const&, QCString const&)'
./.libs/libkdeinit_kio_uiserver.a(libkdeinit_kio_uiserver_la.all_cpp.o):libkdeinit_kio_uiserver_la.all_cpp.cpp:(.text+0x5854): first defined here
/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio/.libs/libkio.a(libkiocore_la.all_cpp.o): In function `Observer_stub::Observer_stub(QCString const&, QCString const&)':libkiocore_la.all_cpp.cpp:(.text+0x16d08): multiple definition of `Observer_stub::Observer_stub(QCString const&, QCString const&)'
./.libs/libkdeinit_kio_uiserver.a(libkdeinit_kio_uiserver_la.all_cpp.o):libkdeinit_kio_uiserver_la.all_cpp.cpp:(.text+0x587a): first defined here
/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio/.libs/libkio.a(libkiocore_la.all_cpp.o): In function `Observer_stub::Observer_stub(DCOPClient*, QCString const&, QCString const&)':libkiocore_la.all_cpp.cpp:(.text+0x16d1c): multiple definition of `Observer_stub::Observer_stub(DCOPClient*, QCString const&, QCString const&)'
./.libs/libkdeinit_kio_uiserver.a(libkdeinit_kio_uiserver_la.all_cpp.o):libkdeinit_kio_uiserver_la.all_cpp.cpp:(.text+0x588e): first defined here
/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio/.libs/libkio.a(libkiocore_la.all_cpp.o): In function `Observer_stub::Observer_stub(DCOPClient*, QCString const&, QCString const&)':libkiocore_la.all_cpp.cpp:(.text+0x16d30): multiple definition of `Observer_stub::Observer_stub(DCOPClient*, QCString const&, QCString const&)'
./.libs/libkdeinit_kio_uiserver.a(libkdeinit_kio_uiserver_la.all_cpp.o):libkdeinit_kio_uiserver_la.all_cpp.cpp:(.text+0x58a2): first defined here
/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio/.libs/libkio.a(libkiocore_la.all_cpp.o): In function `Observer_stub::Observer_stub(DCOPRef const&)':libkiocore_la.all_cpp.cpp:(.text+0x16d56): multiple definition of `Observer_stub::Observer_stub(DCOPRef const&)'
./.libs/libkdeinit_kio_uiserver.a(libkdeinit_kio_uiserver_la.all_cpp.o):libkdeinit_kio_uiserver_la.all_cpp.cpp:(.text+0x58c8): first defined here
/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio/.libs/libkio.a(libkiocore_la.all_cpp.o): In function `Observer_stub::Observer_stub(DCOPRef const&)':libkiocore_la.all_cpp.cpp:(.text+0x16d6a): multiple definition of `Observer_stub::Observer_stub(DCOPRef const&)'
./.libs/libkdeinit_kio_uiserver.a(libkdeinit_kio_uiserver_la.all_cpp.o):libkdeinit_kio_uiserver_la.all_cpp.cpp:(.text+0x58dc): first defined here
collect2: ld returned 1 exit status
make[4]: *** [kio_uiserver] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio/misc'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio/misc'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2/kio'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/kdelibs-3.5.2/work/kdelibs-3.5.2'
make: *** [all] Error 2


I'm posing my emerge --info:
Portage 2.1_pre7-r3 (default-linux/amd64/2006.0, gcc-3.4.4, glibc-2.4-r1, 2.6.16-gentoo x86_64)
=================================================================
System uname: 2.6.16-gentoo x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.12.0_pre16
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.91.0.5-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-Os -pipe -march=k8 -fomit-frame-pointer -ftracer -fweb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/share/X11/xkb /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="-Os -pipe -march=k8 -fomit-frame-pointer -ftracer -fweb"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig candy confcache distlocks metadata-transfer multilib-strict parallel-fetch prelink sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--enable-new-dtags -Wl,-Bdirect -Wl,--as-needed -Wl,-hashvals -Wl,-zdynsort"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="amd64 X acpi aim alsa apache2 avi bash-completion berkdb bitmap-fonts cairo cdparanoia cli crypt cscope ctype cups dba dri dvd dvdr emboss encode expat fastbuild flac foomaticdb force-cgi-redirect fortran ftp gd gif gimp gpm gstreamer gtk gtk2 hal icq imap imlib input_devices_evdev input_devices_mouse isdnlog jabber java jpeg kde kdeenablefinal lzw lzw-tiff memlimit mng mozdevelop moznocompose moznoirc moznomail mozsvg mp3 mpeg mplayer msn ncurses nls nogcj nptl nptlonly nsplugin oggvorbis openal opengl pam pcre pdf pdflib perl png posix pppd python qt quicktime readline samba sdl session simplexml soap sockets spell spl ssl svg tcpd tif tiff tokenizer transcode truetype truetype-fonts type1-fonts unicode usb video_cards_nv video_cards_nvidia video_cards_vesa video_cards_vga visualization vorbis xine xml xpm xsl xv xvid zeroconf zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, LANG, LC_ALL, LINGUAS
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-03-31 02:08:53 UTC
Well --as-needed is not the issue (both because KDE uses it and because I'm using it too). It's not even a problem with -Bdirect and -hashvals, as long as your binutils are correctly patched (without patched binutils, -hashvals sets the libraries' soname to "ashvals" that's not that good), and for what regards --enable-new-dtags, it's pointless on Gentoo, as it's always enabled, drop it if you want.

It seems rather that it doesn't find /usr/lib64/librcpsvc.a, do you have it?
Comment 2 Patrizio Bassi 2006-03-31 02:53:18 UTC
with same ldflags works perfectly on x86.
Comment 3 Benjamin Schindler (RETIRED) gentoo-dev 2006-03-31 05:00:01 UTC
Yes, having that library fixed the issue. Sorry for the noise