I am trying to emerge media-libs/gmyth-0.7 and it fails with the following message: i686-pc-linux-gnu-gcc -g -O3 -march=athlon-xp -fomit-frame-pointer -pipe -m3dnow -msse -mmmx -fprefetch-loop-arrays -ggdb -g3 -Wall -I/usr/include -O2 -DG_DISABLE_CHECKS -pthread -Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed -o .libs/gmyth-ls gmyth_ls.o /usr/lib/libgobject-2.0.so /usr/lib/libgthread-2.0.so -lrt /usr/lib/libglib-2.0.so /usr/lib/libcurl.so -L/usr/lib ../src/.libs/libgmyth.so i686-pc-linux-gnu-gcc -g -O3 -march=athlon-xp -fomit-frame-pointer -pipe -m3dnow -msse -mmmx -fprefetch-loop-arrays -ggdb -g3 -Wall -I/usr/include -O2 -DG_DISABLE_CHECKS -pthread -Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed -o .libs/gmyth-cat gmyth_cat.o /usr/lib/libgobject-2.0.so /usr/lib/libgthread-2.0.so -lrt /usr/lib/libglib-2.0.so /usr/lib/libcurl.so -L/usr/lib ../src/.libs/libgmyth.so ../src/.libs/libgmyth.so: undefined reference to `curl_easy_setopt' ../src/.libs/libgmyth.so: undefined reference to `curl_easy_init' ../src/.libs/libgmyth.so: undefined reference to `curl_easy_perform' ../src/.libs/libgmyth.so: undefined reference to `curl_easy_cleanup' ../src/.libs/libgmyth.so: undefined reference to `curl_global_init' collect2: ld returned 1 exit status make[2]: *** [gmyth-cat] Error 1 make[2]: *** Waiting for unfinished jobs.... ../src/.libs/libgmyth.so: undefined reference to `curl_easy_setopt' ../src/.libs/libgmyth.so: undefined reference to `curl_easy_init' ../src/.libs/libgmyth.so: undefined reference to `curl_easy_perform' ../src/.libs/libgmyth.so: undefined reference to `curl_easy_cleanup' ../src/.libs/libgmyth.so: undefined reference to `curl_global_init' collect2: ld returned 1 exit status make[2]: *** [gmyth-ls] Error 1 make[2]: Leaving directory `/mnt/ramdisk/portage/media-libs/gmyth-0.7/work/gmyth/samples' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/mnt/ramdisk/portage/media-libs/gmyth-0.7/work/gmyth' make: *** [all] Error 2 * * ERROR: media-libs/gmyth-0.7 failed. * Call stack: * ebuild.sh, line 49: Called src_compile * environment, line 432: Called die * The specific snippet of code: * emake || die "emake failed." * The die message: * emake failed. * * If you need support, post the topmost build error, and the call stack if relevant. * A complete build log is located at '/var/log/portage/media-libs:gmyth-0.7:20080815-102415.log'. * The ebuild environment file is located at '/mnt/ramdisk/portage/media-libs/gmyth-0.7/temp/environment'. * I thought I've already remerged "curl", but if I try to do that, It wants to emerge python (which fails and I've already filed a bug against that). muelli@rootbox ~ $ sudo emerge -uDav curl WARNING: repository at /usr/local/portage/muelli is missing a repo_name entry These are the packages that would be merged, in order: Calculating dependencies \ * Missing digest for '/usr/local/portage/muelli/app-crypt/sims/sims-0.2.ebuild' - * Missing digest for '/usr/local/portage/muelli/media-plugins/xmms-goom/xmms-goom-1.99.5.ebuild' ... done! [ebuild NS ] dev-lang/python-2.5.2-r6 [2.4.4-r9] USE="gdbm ipv6 ncurses readline sqlite ssl threads tk -berkdb -bootstrap -build -doc -examples -ucs2 -wininst" 0 kB Total: 1 package (1 in new slot), Size of downloads: 0 kB !!! The following installed packages are masked: - dev-libs/nspr-4.7.1 (masked by: ~x86 keyword) - dev-util/giggle-0.4 (masked by: ~x86 keyword) - dev-util/eclipse-sdk-3.1.2-r3 (masked by: ~x86 keyword) - media-plugins/live-2008.07.06 (masked by: ~x86 keyword) - media-video/ffmpeg-0.4.9_p20070616-r20 (masked by: ~x86 keyword) - x11-libs/gtksourceview-2.2.2 (masked by: ~x86 keyword) - net-libs/obby-0.4.5 (masked by: ~x86 keyword) - dev-libs/gnome-build-0.3.0 (masked by: ~x86 keyword) For more information, see the MASKED PACKAGES section in the emerge man page or refer to the Gentoo Handbook. Would you like to merge these packages? [Yes/No] Note this is portage-2.2 with the 2008.0/desktop profile
Well, if I'd be into guessing (I am, actually), then I'd say you've run into a standard --as-needed bug. A standard fix for it (for automake-based projects) is to add the required lib to the LIBADD of the built lib. curl is most probably fine there, you may check it by running `ldd -r /usr/lib/libcurl.so`.
Please run `emerge -vuaDN world' to the finish and try emerging media-libs/gmyth again after that. If you then find you still have this problem, reopen this bug report and post your `emerge --info' here too.
Well, you are right, I am running --as-needed. And indeed, this patch fixes the problem for me :) --- samples/Makefile.am 2008-08-15 13:28:48.462796098 +0200 +++ samples/Makefile.am.orig 2008-08-15 13:31:27.705399410 +0200 @@ -17,7 +17,6 @@ LDADD = \ $(top_builddir)/src/libgmyth.la + libcurl.la AM_CFLAGS
Jeroen, I'm pretty confident that this is due to --as-needed as many packages in gentoo were and some still are. I'd say you'd better appreciate bugreports instead of INVALIDating them right away without even trying to reproduce. Rafal even mentioned the cause of this issue now there is a fix. Thus reopening.
Please post your `emerge --info' here too.
muelli@rootbox /dev/shm $ sudo emerge --info Password: WARNING: repository at /usr/local/portage/muelli is missing a repo_name entry Portage 2.2_rc8 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r7 i686) ================================================================= System uname: Linux-2.6.25-gentoo-r7-i686-AMD_Athlon-tm-_XP_2400+-with-glibc2.0 Timestamp of tree: Wed, 13 Aug 2008 00:06:01 +0000 ccache version 2.4 [enabled] app-shells/bash: 3.2_p33 dev-java/java-config: 1.3.7, 2.1.6 dev-lang/python: 2.4.4-r9 dev-python/pycrypto: 2.0.1-r6 dev-util/ccache: 2.4-r7 sys-apps/baselayout: 2.0.0 sys-apps/openrc: 0.2.2 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.61-r2 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.23-r3 ACCEPT_KEYWORDS="x86" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe -m3dnow -msse -mmmx -fprefetch-loop-arrays -ggdb -g3" 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/config" CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/rc.d /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d /etc/wget" CXXFLAGS="-O3 -march=athlon-xp -fomit-frame-pointer -pipe -m3dnow -msse -mmmx -fprefetch-loop-arrays -ggdb -g3" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache confcache distcc distlocks parallel-fetch preserve-libs sandbox sfperms splitdebug strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -Wl,--as-needed" LINGUAS="de en_GB eo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/mnt/ramdisk" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage/muelli" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow 3dnowext X X509 a52 aac accessibility acl acpi ada adns aiglx alsa amarok amr amuled async auctex audacious audiofile authfile automount avahi bash-completion bindist bittorrent bl blender-game bluetooth bonjour branding browserplugin buttons bzip2 cairo ccache cdb cdda cddb cdinstall cdio cdparanoia cdr cli cracklib crypt css csv curl cyrus d daap dbase dbus dc1394 devhelp disk-partition divx divx4linux djvu drac dri dts dvb dvd dvdnav dvdr dvdread dvi dynagraph eds effects emboss emerald encode enscript epiphany escreen ethereal evo exif extrafilters extras fasttrack fat ffmpeg firefox flac fuse gajim galago garmin gcrypt gd gdbm gedit geldkarte geoip ggi gif gkrellm glade glitz glsa glut gmedia gmp gnokii gnome gnome-keyring gnomecd gnuplot gnustep gnutella gnutls gpg gpgme gpm graphviz gs gsm gstreamer gtalk gtk gtk2 gtkhtml hal hbci hddtemp hfs html http iconv id3 id3tag idn imagemagick imlib inherit-graph ipod ipv6 irc irda isdnlog jabber javascript jfs jingle joystick jpeg jpeg2k junit justify keyring lame latex libcaca libnotify libsexy libwww logrotate logwatch lzo mad madwifi matroska midi mikmod mmx mmxext mng mod mod_muc mod_pubsub moneyplex mono moonlight mozdevelop mozilla moznoirc moznomail mozsvg mp3 mp4 mp4live mpe mpeg mpeg2 mpeg4 mplayer mtp mudflap multiuser musepack musicbrainz mythtv nautilus ncurses net njb nls nntp nogg nptl nptlonly nsplugin ntfs nvidia nvtv offensive ofx ogg ole on-the-fly-crypt opengl openssl pam pcap pcre pdf perl plugin plugins png postscript ppds pppd pulseaudio pvr python pyx qt3 qt3support qt4 quicktime rar readline real realmedia recode reflection reiser4 reiserfs remote replytolist restrict-javascript rss rtsp ruby sasl screen sdl sendfile sensord session sftp shaper shorten shout skins slang smi sms socks5 softquota sourceview speech speedo speex spell spl sqlite sqlite3 srv sse sse2 ssl startup-notification stream stroke subversion svg svga symlink sysfs taglib tagwriting tcl tcpd tetex tga theora thesaurus thumbnail thumbnailing thunderbird tiff tk tordns tos tracker trayicon truetype twolame unicode upnp usb utf8 uuencode v4l v4l2 valgrind vcd videos vidix visual visualization vnc vorbis vrml win32codecs wma wmf wmp x264 x86 xanim xatrix xattr xchat xcomposite xemacs xforms xfs xine xml xorg xulrunner xv xvid xvmc zeroconf zip zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de en_GB eo" USERLAND="GNU" VIDEO_CARDS="nvidia nv vesa" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS muelli@rootbox /dev/shm $
Your "fix" may not be quite correct. This may work, but the proper fix will probably be adding libcurl.la to src/libgmyth.la LIBADD.
Sorry, that should have been "-lcurl", not "libcurl.la".
what happens if you remove the --as-needed from your LDFLAGS?
(In reply to comment #9) > what happens if you remove the --as-needed from your LDFLAGS? > I mean, it gets compiled flawlessly?
Yes. Works for me w/o the --as-needed
Unless I'm missing something, the point of this bug is to make it work with --as-needed, not to state the obvious (that it works without it).
Reassigning to herd since zaheerm has left Gentoo, bug #68473.
I've posted patches for 0.7 and 0.7.1 in bug #247748.
Sorry if it should have been the other way around, but the other bug has the patches… *** This bug has been marked as a duplicate of bug 247748 ***