Attempting to upgrade to media-plugins/alsa-plugins-1.0.19, build repeatably fails with the linker reporting broken references to "floor", "sin", etc. This is a canonical example of missing libm in the linker chain. Reproducible: Always Steps to Reproduce: [ebuild U ] media-plugins/alsa-plugins-1.0.19 [1.0.18] USE="ffmpeg libsamplerate* speex -debug -jack -pulseaudio" 0 kB Actual Results: Build failed. Expected Results: Build succeeded! /bin/sh ../libtool --tag=CC --mode=link x86_64-pc-linux-gnu-gcc -DVAR_ARRAYS -DRANDOM_PREFIX=alsa_lib -DOUTSIDE_SPEEX -Wall -g -I/usr/include/alsa -march=athlon64 -O3 -pipe -funroll-loops -fomit-frame-pointer -DNDEBUG -module -avoid-version -export-dynamic -no-undefined -Wl,--no-undefined -Wl,-O1 -o libasound_module_rate_speexrate.la -rpath /usr/lib64/alsa-lib rate_speexrate.lo resample.lo -lasound -lasound x86_64-pc-linux-gnu-gcc -shared .libs/rate_speexrate.o .libs/resample.o /usr/lib64/libasound.so -march=athlon64 -Wl,--no-undefined -Wl,-O1 -Wl,-soname -Wl,libasound_module_rate_speexrate.so -o .libs/libasound_module_rate_speexrate.so .libs/resample.o: In function `compute_func': /var/tmp/portage/media-plugins/alsa-plugins-1.0.19/work/alsa-plugins-1.0.19/pph/resample.c:226: undefined reference to `floorf' .libs/resample.o: In function `sinc': /var/tmp/portage/media-plugins/alsa-plugins-1.0.19/work/alsa-plugins-1.0.19/pph/resample.c:277: undefined reference to `sin' .libs/resample.o: In function `alsa_lib_resampler_process_int': /var/tmp/portage/media-plugins/alsa-plugins-1.0.19/work/alsa-plugins-1.0.19/pph/resample.c:915: undefined reference to `floor' /var/tmp/portage/media-plugins/alsa-plugins-1.0.19/work/alsa-plugins-1.0.19/pph/resample.c:915: undefined reference to `floor' /var/tmp/portage/media-plugins/alsa-plugins-1.0.19/work/alsa-plugins-1.0.19/pph/resample.c:915: undefined reference to `floor' /var/tmp/portage/media-plugins/alsa-plugins-1.0.19/work/alsa-plugins-1.0.19/pph/resample.c:915: undefined reference to `floor' /var/tmp/portage/media-plugins/alsa-plugins-1.0.19/work/alsa-plugins-1.0.19/pph/resample.c:915: undefined reference to `floor' .libs/resample.o:/var/tmp/portage/media-plugins/alsa-plugins-1.0.19/work/alsa-plugins-1.0.19/pph/resample.c:915: more undefined references to `floor' follow collect2: ld returned 1 exit statuslithium ~ # emerge --info Portage 2.1.6.4 (default/linux/amd64/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.28 x86_64) ================================================================= System uname: Linux-2.6.28-x86_64-AMD_Athlon-tm-_64_Processor_3800+-with-glibc2.2.5 Timestamp of tree: Fri, 30 Jan 2009 22:15:01 +0000 ccache version 2.4 [enabled] app-shells/bash: 3.2_p39 dev-java/java-config: 1.3.7-r1, 2.1.6-r1 dev-lang/python: 2.4.4-r13, 2.5.2-r7 dev-python/pycrypto: 2.0.1-r6 dev-util/ccache: 2.4-r7 dev-util/cmake: 2.4.8 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2 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.27-r2 ABI="amd64" ACCEPT_KEYWORDS="amd64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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" ARCH="amd64" ASFLAGS_x86="--32" AUTOCLEAN="yes" CBUILD="x86_64-pc-linux-gnu" CCACHE_SIZE="2G" CDEFINE_amd64="__x86_64__" CDEFINE_x86="__i386__" CFLAGS="-march=athlon64 -O3 -pipe -funroll-loops -fomit-frame-pointer" CFLAGS_x86="-m32" CHOST="x86_64-pc-linux-gnu" CHOST_amd64="x86_64-pc-linux-gnu" CHOST_x86="i686-pc-linux-gnu" CLASSPATH="." CLEAN_DELAY="5" COLLISION_IGNORE="/lib/modules" 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/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d" CVS_RSH="ssh" CXXFLAGS="-march=athlon64 -O3 -pipe -funroll-loops -fomit-frame-pointer" DEFAULT_ABI="amd64" DISPLAY=":0.0" DISTDIR="/usr/portage/distfiles" EDITOR="/bin/nano" ELIBC="glibc" EMERGE_DEFAULT_OPTS="--ask --verbose" EMERGE_WARNING_DELAY="10" FEATURES="ccache collision-protect distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" FETCHCOMMAND="/usr/bin/wget -t 5 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}"" FLTK_DOCDIR="/usr/share/doc/fltk-1.1.7-r2/html" GCC_SPECS="" GDK_USE_XFT="1" GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" HG="/usr/bin/hg" HOME="/root" INFOPATH="/usr/share/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.18/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/info" INPUT_DEVICES="keyboard mouse joystick" JAVAC="/etc/java-config-2/current-system-vm/bin/javac" JAVA_HOME="/etc/java-config-2/current-system-vm" JDK_HOME="/etc/java-config-2/current-system-vm" KDEDIRS="/usr:/usr/local:/usr/kde/3.5" KDE_IS_PRELINKED="1" KERNEL="linux" LCD_DEVICES="imon" LDFLAGS="-Wl,-O1" LDFLAGS_x86="-m elf_i386" LESS="-R -M --shift 5" LESSOPEN="|lesspipe.sh %s" LIBDIR_amd64="lib64" LIBDIR_ppc="lib32" LIBDIR_ppc64="lib64" LIBDIR_sparc32="lib32" LIBDIR_sparc64="lib64" LIBDIR_x86="lib32" LIBGL_DRIVERS_PATH="/usr/lib64/dri:/usr/lib32/dri" LINGUAS="en_GB fi" LOGNAME="root" LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:" MAKEOPTS="-j1" MANPATH="/etc/java-config-2/current-system-vm/man:/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.18/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.1.2/man:/etc/java-config/system-vm/man/:/usr/kde/3.5/share/man:/usr/qt/3/doc/man" MULTILIB_ABIS="amd64 x86" MULTILIB_STRICT_DENY="64-bit.*shared object" MULTILIB_STRICT_DIRS="/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib" MULTILIB_STRICT_EXEMPT="(perl5|gcc|gcc-lib|binutils|eclipse-3|debug|portage)" NETBEANS="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OPENGL_PROFILE="ati" PAGER="/usr/bin/less" PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/lib/subversion/bin" PKGDIR="/usr/portage/packages" PKG_CONFIG_PATH="/usr/qt/3/lib64/pkgconfig" PORTAGE_ARCHLIST="ppc s390 amd64 x86 ppc64 x86-fbsd m68k arm sparc sh mips ia64 alpha hppa sparc-fbsd" PORTAGE_BINHOST_CHUNKSIZE="3000" PORTAGE_BIN_PATH="/usr/lib64/portage/bin" PORTAGE_COMPRESS_EXCLUDE_SUFFIXES="css gif htm[l]? jp[e]?g js pdf png" PORTAGE_CONFIGROOT="/" PORTAGE_COUNTER_HASH="5926d57304c50ea3b51ddc89f453c81b" PORTAGE_DEBUG="0" PORTAGE_DEPCACHEDIR="/var/cache/edb/dep" PORTAGE_ELOG_CLASSES="warn error log" PORTAGE_ELOG_MAILFROM="portage@localhost" PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for ${PACKAGE} on ${HOST}" PORTAGE_ELOG_MAILURI="root" PORTAGE_ELOG_SYSTEM="save_summary echo" PORTAGE_FETCH_CHECKSUM_TRY_MIRRORS="5" PORTAGE_FETCH_RESUME_MIN_SIZE="350K" PORTAGE_GID="250" PORTAGE_INST_GID="0" PORTAGE_INST_UID="0" PORTAGE_PYM_PATH="/usr/lib64/portage/pym" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_RSYNC_RETRIES="3" PORTAGE_TMPDIR="/var/tmp" PORTAGE_TMPFS="/dev/shm" PORTAGE_VERBOSE="1" PORTAGE_WORKDIR_MODE="0700" PORTDIR="/usr/portage" PRELINK_PATH_MASK="/lib/modules:/usr/lib64/locale:/usr/lib64/wine:/usr/lib64/valgrind:*.la:*.png:*.py:*.pl:*.pm:*.sh:*.xml:*.xslt:*.a:*.js" PROFILE_ONLY_VARIABLES="ARCH ELIBC KERNEL USERLAND" PWD="/root" PYTHONDOCS="/usr/share/doc/python-docs-2.5.1/html/lib" QMAKESPEC="linux-g++" QTDIR="/usr/qt/3" RESUMECOMMAND="/usr/bin/wget -c -t 5 -T 60 --passive-ftp -O "${DISTDIR}/${FILE}" "${URI}"" ROOT="/" ROOTPATH="/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.1.2:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/lib/subversion/bin" RPMDIR="/usr/portage/rpm" SGML_CATALOG_FILES="/etc/sgml/xml-docbook-4.4.cat:/etc/sgml/sgml-docbook.cat:/etc/sgml/openjade-1.3.2.cat:/etc/sgml/xml-simple-docbook-1.0.cat:/etc/sgml/sgml-docbook-4.4.cat:/etc/sgml/sgml-docbook-4.1.cat:/etc/sgml/sgml-docbook-4.0.cat:/etc/sgml/sgml-docbook-3.1.cat:/etc/sgml/sgml-lite.cat:/etc/sgml/sgml-ent.cat:/etc/sgml/sgml-docbook-4.2.cat:/etc/sgml/sgml-docbook-3.0.cat:/etc/sgml/xml-docbook-4.1.2.cat:/etc/sgml/xml-simple-docbook-4.1.2.4.cat:/etc/sgml/dsssl-docbook-stylesheets.cat" SHELL="/bin/bash" SHLVL="1" STAGE1_USE="multilib nptl nptlonly unicode" SYMLINK_LIB="yes" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" TERM="xterm" USE="3dnow 3dnowext 7zip X a52 aac aalib acl acpi alsa amd64 ao aotuv arts artswrappersuid berkdb bittorrent bluetooth branding bzip2 cairo cdr cli cracklib crypt cups cupsddk dbus dga dirac doc docbook dri dts dv dvb dvbplayer dvbsetup dvd dvdr dvdread eds emboss encode esd evo examples extras fam ffmpeg firefox flac fortran gdbm ggi gif gmp gpm gstreamer gtk hal iconv id3 id3tag ieee1394 imap imlib infowidget ipv6 isdnlog jadetex java java5 javascript jpeg justify kde latex ldap libnotify libsamplerate mad midi mikmod mjpeg mmx mp2 mp3 mp3rtp mp4 mp4live mpeg mpeg2 mudflap multilib musicbrainz ncurses nls nptl nptlonly ocaml ocamlopt ode offensive ogg ogg123 openal opengl openmp pam pcre pdf perl png povray ppds pppd python qt3 qt3support qt4 quicktime readline reflection schroedinger sdl session sndfile speex spell spl sse sse2 ssl startup-notification svg svnserve sysfs tb4 tcpd theora threads threadsafe tiff timezone truetype unicode usb v4l v4l2 vdr video videos vlm vorbis vorbis-psy wavpack x264 xcb xcomposite xml xorg xscreensaver xulrunner xv xvmc yv12 zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci 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="imon" LINGUAS="en_GB fi" USERLAND="GNU" VIDEO_CARDS="vesa fglrx v4l" USER="root" USERLAND="GNU" USE_EXPAND="ALSA_CARDS ALSA_PCM_PLUGINS APACHE2_MODULES APACHE2_MPMS CAMERAS CROSSCOMPILE_OPTS DVB_CARDS ELIBC FCDSL_CARDS FOO2ZJS_DEVICES FRITZCAPI_CARDS INPUT_DEVICES KERNEL LCD_DEVICES LINGUAS LIRC_DEVICES MISDN_CARDS NETBEANS_MODULES USERLAND VIDEO_CARDS" USE_EXPAND_HIDDEN="CROSSCOMPILE_OPTS ELIBC KERNEL USERLAND" USE_ORDER="env:pkg:conf:defaults:pkginternal:env.d" VIDEO_CARDS="vesa fglrx v4l" XAUTHORITY="/root/.xauth6jmZLb" XDG_DATA_DIRS="/usr/share:/usr/kde/3.5/share:/usr/local/share" _="/usr/bin/emerge" make[2]: *** [libasound_module_rate_speexrate.la] Error 1
Ugh, that's too big. Figuring out how to edit the damn thing...
If I say USE="-speex", it emerges correctly. The problem is thus isolated to the speex support. I see there's already a bug about a different aspect of that.
(In reply to comment #2) > If I say USE="-speex", it emerges correctly. The problem is thus isolated to > the speex support. I see there's already a bug about a different aspect of > that. > Yep, that fixed the crash-problem for me. Hopefully next version will work with +speex :)
Just from preliminarily looking at it, I think the cause is that resample.c is not being linked with -lm
in a "works for me" kinda approach ( I use speex in my system, wanted my plugins to build with it ) I did the following: sed -i 's/speex_LIBS: $speex_LIBS/speex_LIBS: $speex_LIBS -lm/g' configure in the ebuild, in src_prepare section. This permits alsa-plugins 1.0.19 to build with USE=speex on. Probably NOT the best way to do this, and likely horribly b0rken, but works for me.
3rd "me too" - broke for me too, and "-speex" worked around the problem
(In reply to comment #5) > in a "works for me" kinda approach ( I use speex in my system, wanted my > plugins to build with it ) I did the following: > > sed -i 's/speex_LIBS: $speex_LIBS/speex_LIBS: $speex_LIBS -lm/g' configure Yes, I suspected that something like that would help. Shouldn't this be sent upstream though? I reported this ages ago and there's been no concrete activity.
A patch has been added to alsa 1.0.19, please remerge and test. 1.0.20 should be unaffected, too.