libsigc++-1.0.4-r3 fails to compile with LDFLAGS="-Wl,--as-needed". /bin/sh ../libtool --mode=link c++ -O2 -march=athlon-xp -fomit-frame-pointer -pipe -Wl,--as-needed -o libsigc.la -rpath /usr/lib -version-info 0:0:0 -release 1.0 -no-undefined object.lo scope.lo marshal.lo slot.lo basic_signal.lo adaptor.lo thread.lo rm -fr .libs/libsigc.la .libs/libsigc.* .libs/libsigc-1.0.* gcc -shared object.lo scope.lo marshal.lo slot.lo basic_signal.lo adaptor.lo thread.lo -lc -Wl,-soname -Wl,libsigc-1.0.so.0 -o .libs/libsigc-1.0.so.0.0.0 (cd .libs && rm -f libsigc-1.0.so.0 && ln -s libsigc-1.0.so.0.0.0 libsigc-1.0.so.0) (cd .libs && rm -f libsigc.so && ln -s libsigc-1.0.so.0.0.0 libsigc.so) ar cru .libs/libsigc.a object.o scope.o marshal.o slot.o basic_signal.o adaptor.o thread.o ranlib .libs/libsigc.a creating libsigc.la (cd .libs && rm -f libsigc.la && ln -s ../libsigc.la libsigc.la) make[2]: Leaving directory `/var/tmp/portage/libsigc++-1.0.4-r3/work/libsigc++-1.0.4/sigc++' make[1]: Leaving directory `/var/tmp/portage/libsigc++-1.0.4-r3/work/libsigc++-1.0.4/sigc++' Making all in tests make[1]: Entering directory `/var/tmp/portage/libsigc++-1.0.4-r3/work/libsigc++-1.0.4/tests' Making all in handles make[2]: Entering directory `/var/tmp/portage/libsigc++-1.0.4-r3/work/libsigc++-1.0.4/tests/handles' c++ -DHAVE_CONFIG_H -I. -I. -I../../sigc++/config -I../.. -O2 -march=athlon-xp -fomit-frame-pointer -pipe -c ctor.cc /bin/sh ../../libtool --mode=link c++ -O2 -march=athlon-xp -fomit-frame-pointer -pipe -Wl,--as-needed -o ctor ctor.o ../../sigc++/libsigc.la -lpthread mkdir .libs c++ -O2 -march=athlon-xp -fomit-frame-pointer -pipe -Wl,--as-needed -o .libs/ctor ctor.o ../../sigc++/.libs/libsigc.so -lpthread ../../sigc++/.libs/libsigc.so: undefined reference to `pthread_create' ../../sigc++/.libs/libsigc.so: undefined reference to `pthread_getspecific' ../../sigc++/.libs/libsigc.so: undefined reference to `pthread_key_delete' ../../sigc++/.libs/libsigc.so: undefined reference to `pthread_detach' ../../sigc++/.libs/libsigc.so: undefined reference to `pthread_key_create' ../../sigc++/.libs/libsigc.so: undefined reference to `pthread_mutex_trylock' ../../sigc++/.libs/libsigc.so: undefined reference to `pthread_setspecific' collect2: ld returned 1 exit status make[2]: *** [ctor] Fehler 1 make[2]: Leaving directory `/var/tmp/portage/libsigc++-1.0.4-r3/work/libsigc++-1.0.4/tests/handles' make[1]: *** [all-recursive] Fehler 1 make[1]: Leaving directory `/var/tmp/portage/libsigc++-1.0.4-r3/work/libsigc++-1.0.4/tests' make: *** [all-recursive] Fehler 1 !!! ERROR: dev-libs/libsigc++-1.0.4-r3 failed. Call stack: ebuild.sh, line 1545: Called dyn_compile ebuild.sh, line 940: Called src_compile libsigc++-1.0.4-r3.ebuild, line 26: Called die !!! (no error message) !!! If you need support, post the topmost build error, and the call stack if relevant.
# emerge --info Portage 2.1.1_pre2-r8 (default-linux/x86/2006.0, gcc-4.1.1/vanilla, glibc-2.4-r3, 2.6.17-gentoo-r1 i686) ================================================================= System Settings ================================================================= System uname: 2.6.17-gentoo-r1 i686 AMD Athlon(tm) XP 3000+ Gentoo Base System version 1.12.1 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.4 [enabled] app-admin/eselect-compiler: 2.0.0_rc2-r1 dev-lang/python: 2.3.5-r2, 2.4.3-r1 dev-python/pycrypto: 2.0.1-r5 dev-util/ccache: 2.4-r2 dev-util/confcache: [Not Present] sys-apps/sandbox: 1.2.18.1 sys-devel/autoconf: 2.13, 2.60 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2 sys-devel/binutils: 2.17 sys-devel/gcc-config: 2.0.0_rc1 sys-devel/libtool: 1.5.22 virtual/os-headers: 2.6.11-r5 ACCEPT_KEYWORDS="x86 ~x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c" CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache collision-detect cvs distlocks metadata-transfer parallel-fetch sandbox sfperms sign strict" GENTOO_MIRRORS="ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/" LANG="de_DE.UTF-8" LDFLAGS="-Wl,--as-needed" LINGUAS="de" MAKEOPTS="-j4" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/home/matze/gentoo/overlays/sci /home/matze/gentoo/overlays/de /home/matze/gentoo/overlays/zzam" SYNC="cvs://zzam@cvs.gentoo.org:/var/cvsroot" USE="x86 3dnow 3dnowext X a52 aac acl alsa apache2 apm artswrappersuid audacious avi berkdb bitmap-fonts bluetooth bzip2 cap caps cddb cdparanoia cli crypt cups dbus dlloader doc dri dts dvb dvd dvdr eds emboss encode fbcon ffmpeg font-server foomaticdb fortran fuse gcj gdbm gif gimpprint glut gpm gstreamer gtk gtk2 hal imap imlib ipv6 isdnlog java jpeg jpeg2k kde kdexdeltas libg++ libwww lirc logitech-mouse mad mikmod mmx mmxext mng motif mp3 mpeg mplayer musicbrainz mysql ncurses nls nogecko-sdk nptl nptlonly nvram ogg opengl oss pam pcre pdf pdflib perl png ppds pppd python qt qt3 qt4 quotes readline reflection samba session sms sndfile softmmu spell spl sqlite sse ssl svg taglib tcltk tcpd tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales vcd vdr visualization vorbis win32codecs wma wmf xinerama xml xorg xrandr xslt xv zlib zvbi elibc_glibc input_devices_mouse input_devices_keyboard kernel_linux linguas_de lirc_devices_all userland_GNU video_cards_v4l video_cards_vesa video_cards_vbdev video_cards_nv" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_RSYNC_EXTRA_OPTS
Adding "-lpthread" for linking in sigc++ is enough but I don't know where in the original Makefile this belongs.
Created attachment 101467 [details, diff] libsigc++-1.0.4-r3.ebuild patch This ebuild has many problems: 1) the as-needed problem 2) problem to cross-compile 3) problem with keeptemp/keepwork This patch should fix all the problems
(Spam administratively removed, by robbat2@gentoo.org, at Tue Jan 15 00:37:28 UTC 2008)
drizzt, you posted the ebuild patch, but not the as-needed patch.
The build failure was in the tests, so I've just removed them altogether. They were never really used. Fixed in cvs without a revbump.
Bleh... I shouldn't have opened my mouth. They are used, I've just disabled them for now. Real fix on its way.
Ok so this is fixed for real. Here's the fix : # fix --as-needed, see bug #140248 sed -i -e 's:^libsigc_la_LIBADD =:& $(THREAD_LIB):' \ sigc++/Makefile.in || die I tried doing it properly with a real patch to Makefile.am, but the configure.in is _really_ old, and does a lot of crappy things. Fixing it all was not worth it for a package which is used by maybe 5 other ebuilds that should be treecleaned. So I'm lazy and did this instead, pretty much like Timothy's patch. Again, fixed without a revbump. Cheers