Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 499450 - media-libs/libsndfile-1.0.25-r1 fails with ld.gold - ../src/.libs/libsndfile.so: error: undefined reference to 'vorbis_synthesis_read'
Summary: media-libs/libsndfile-1.0.25-r1 fails with ld.gold - ../src/.libs/libsndfile....
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-gold underlinking
  Show dependency tree
 
Reported: 2014-01-27 14:34 UTC by Justin Lecher (RETIRED)
Modified: 2016-01-26 08:52 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,238.68 KB, text/plain)
2014-01-27 14:34 UTC, Justin Lecher (RETIRED)
Details
select ld.bfd or fail early to keep away failures (patch3,1.25 KB, patch)
2014-11-10 18:47 UTC, Ian Stakenvicius (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Lecher (RETIRED) gentoo-dev 2014-01-27 14:34:35 UTC
libtool: link: x86_64-pc-linux-gnu-gcc -O2 -pipe -ftracer -march=native -frecord-gcc-switches -g -Wimplicit-function-declaration -std=gnu99 -Wall -Wextra -Wdeclaration-after-statement -Wpointer-arith -funsigned-char -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast -Wwrite-strings -Wundef -Wl,-O1 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common -o .libs/sndfile-play sndfile-play.o common.o  -Wl,--as-needed ../src/.libs/libsndfile.so -lFLAC -lvorbisenc -lasound -lm
../src/.libs/libsndfile.so: error: undefined reference to 'vorbis_synthesis_read'
../src/.libs/libsndfile.so: error: undefined reference to 'vorbis_synthesis_pcmout'
../src/.libs/libsndfile.so: error: undefined reference to 'ogg_stream_packetout'
../src/.libs/libsndfile.so: error: undefined reference to 'vorbis_synthesis'
../src/.libs/libsndfile.so: error: undefined reference to 'ogg_sync_buffer'
../src/.libs/libsndfile.so: error: undefined reference to 'ogg_sync_wrote'
../src/.libs/libsndfile.so: error: undefined reference to 'ogg_page_eos'
../src/.libs/libsndfile.so: error: undefined reference to 'ogg_sync_pageout'
../src/.libs/../src/.libs/libsndfile.so: error: undefined reference to 'vorbis_synthesis_read'



$ einfo =media-libs/libsndfile-1.0.25-r1
Portage 2.2.8-r1 (default/linux/amd64/13.0, gcc-4.8.2-asneeded, glibc-2.18-r1, 3.12.8-lh x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.12.8-lh-x86_64-Intel-R-_Core-TM-_i7-2600_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:    16468040 total,    199080 free
KiB Swap:    4194300 total,   4159748 free
Timestamp of tree: Mon, 27 Jan 2014 06:30:01 +0000
ld GNU gold (GNU Binutils 2.24) 1.11
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45-r1
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.6, 3.3.3
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.1-r4
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.10.3, 1.11.6, 1.12.6, 1.13.4, 1.14.1
sys-devel/binutils:       2.24-r2
sys-devel/gcc:            4.1.2, 4.7.3-r1, 4.8.2-r1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           4.0-r1
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.18-r1
Repositories: gentoo sunrise bicatali betagarden dummy Neurogeek science last-hope
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -ftracer   -march=native -frecord-gcc-switches -g -Wimplicit-function-declaration"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/eselect/ /usr/share/gnupg/qualified.txt /usr/share/nano/ /var/lib/hsqldb /var/spool/munin-async/.ssh /var/spool/torque"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -ftracer   -march=native -frecord-gcc-switches -g -Wenum-compare"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS=" -vt --keep-going --autounmask-write --autounmask --quiet-build=n"
FCFLAGS="-O2 -pipe -ftracer   -march=native -frecord-gcc-switches -g"
FEATURES="assume-digests binpkg-logs buildsyspkg ccache cgroup collision-protect compressdebug distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news noinfo parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms sign split-log splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -ftracer   -march=native -frecord-gcc-switches -g"
GENTOO_MIRRORS=" /mnt/tmpfs/ http://gentoo.j-schmitz.net/mirror/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo ftp://ftp.tu-clausthal.de/pub/linux/gentoo/"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -Wl,--sort-common"
MAKEOPTS="-j8 -l3"
PKGDIR="/usr/portage/packages"
PORTAGE_COMPRESS="xz"
PORTAGE_COMPRESS_FLAGS="-z -e -9 -v"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--omit-dir-times"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/local/overlays/sunrise-reviewed /local/overlays/bicatali /local/overlays/betagarden /local/overlays/dummy /local/overlays/neurogeek /local/overlays/sci /local/overlays/lh-overlay"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl alsa amd64 avx bash-completion berkdb branding bzip2 cairo caps cli cracklib crypt cups cxx dbus dri fortran gdbm gif gmp gstreamer gtk iconv icu ipv6 jpeg jpeg2k ldap logrotate mmx mmxext modules multilib ncurses network-cron nls nptl nsplugin numa opengl openmp pam pcre pgo png pulseaudio qt3support readline session smp sse sse2 sse2_4way sse2check sse3 sse4 sse41 sse4_1 sse4a sse5 ssl ssse3 startup-notification tcpd threads tiff truetype unicode vaapi vdpau xattr xinerama zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 cgi cgid 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="plymouth" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-32 efi-64" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer pdfimport scripting-javascript wiki-publisher nlpsolver" LINGUAS="en" NGINX_MODULES_HTTP="access auth_basic autoindex browser charset empty_gif fastcgi geo gzip limit_conn limit_req map memcached proxy referer rewrite scgi split_clients ssi upstream_ip_hash userid uwsgi stub_status" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386 x86_64 arm armeb" QEMU_USER_TARGETS="i386 x86_64 arm armeb" RUBY_TARGETS="ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7 3.3"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND

=================================================================
                        Package Settings
=================================================================

media-libs/libsndfile-1.0.25-r1 was built with the following:
USE="alsa -minimal -sqlite -static-libs -test" ABI_X86="32 64 -x32"
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2014-01-27 14:34:59 UTC
Created attachment 368872 [details]
build.log

build.log
Comment 2 Julian Ospald 2014-01-27 14:38:17 UTC
must be related to binutils version, cannot reproduce with 2.23.2
Comment 3 Alex Xu (Hello71) 2014-02-02 21:07:26 UTC
repro here on ~amd64, binutils 2.24-r2 and ld.gold
Comment 4 Alex Xu (Hello71) 2014-02-03 14:29:03 UTC
works with ld.bfd
Comment 5 Ian Stakenvicius (RETIRED) gentoo-dev 2014-11-10 18:22:05 UTC
hit this today too -- just updating the comment to help with searches
Comment 6 Ian Stakenvicius (RETIRED) gentoo-dev 2014-11-10 18:47:10 UTC
Created attachment 389040 [details, diff]
select ld.bfd or fail early to keep away failures

Here's a workaround patch i stole from sys-boot/grub -- it selects ld.bfd if possible and dies during pkg_pretend if not possible.  At least with this we won't keep getting broken emerges.
Comment 7 Marco Ziebell 2014-11-27 15:05:36 UTC
run into the same bug.
A workaround was to add the "minimal" useflag
Comment 8 Ian Stakenvicius (RETIRED) gentoo-dev 2015-04-13 17:42:39 UTC
Bug is still here ..  any chance sound herd could OK my committing of this patch sometime in the next month?
Comment 9 Tony Vroon (RETIRED) gentoo-dev 2015-04-14 08:48:44 UTC
Sorry for the delay Ian, please go right ahead.
Comment 10 Steffen Hau 2015-04-28 14:14:19 UTC
I don't see any need to disable ld.gold, as in my opinion it is an issue with libsndfile not correctly defining needed libraries for the linker. The file ogg_vorbis.c is using all of the mentioned symbols, so libsndfile.so should be linked against -logg and -lvorbis.

This trivial patch adds the required libraries to the linker command:
--- a/src/Makefile.am.orig      2015-04-28 15:50:32.582535481 +0200
+++ b/src/Makefile.am   2015-04-28 15:50:58.972534537 +0200
@@ -50,7 +50,7 @@
 libsndfile_la_SOURCES = $(FILESPECIFIC) $(noinst_HEADERS)
 nodist_libsndfile_la_SOURCES = $(nodist_include_HEADERS)
 libsndfile_la_LIBADD = libcommon.la GSM610/libgsm.la G72x/libg72x.la \
-               @EXTERNAL_LIBS@ -lm
+               @EXTERNAL_LIBS@ -lm @OGG_LIBS@ @VORBIS_LIBS@

 libcommon_la_SOURCES = $(COMMON)

Afterwards libsndfile can be linked with ld.gold as it does with ld.bfd.

@Ian #6: even though this is not a gold issue, there is now a better approach to disable the gold linker when needed: use tc-ld-disable-gold (see https://bugs.gentoo.org/show_bug.cgi?id=439082#c15 and https://bugs.gentoo.org/show_bug.cgi?id=470634#c30). But you should only do that for packages where ld.gold causes breakage of the linked binary/library or does not have the needed functionality (like the default-symver switch from sys-libs/db https://bugs.gentoo.org/show_bug.cgi?id=470634 or the VERSION stuff in dev-db/mariadb https://bugs.gentoo.org/show_bug.cgi?id=508724)
Comment 11 Steffen Hau 2015-04-28 16:40:08 UTC
(In reply to Steffen Hau from comment #10)
> I don't see any need to disable ld.gold, as in my opinion it is an issue
> with libsndfile not correctly defining needed libraries for the linker. The
> file ogg_vorbis.c is using all of the mentioned symbols, so libsndfile.so
> should be linked against -logg and -lvorbis.
> 
> This trivial patch adds the required libraries to the linker command:
> --- a/src/Makefile.am.orig      2015-04-28 15:50:32.582535481 +0200
> +++ b/src/Makefile.am   2015-04-28 15:50:58.972534537 +0200
> @@ -50,7 +50,7 @@
>  libsndfile_la_SOURCES = $(FILESPECIFIC) $(noinst_HEADERS)
>  nodist_libsndfile_la_SOURCES = $(nodist_include_HEADERS)
>  libsndfile_la_LIBADD = libcommon.la GSM610/libgsm.la G72x/libg72x.la \
> -               @EXTERNAL_LIBS@ -lm
> +               @EXTERNAL_LIBS@ -lm @OGG_LIBS@ @VORBIS_LIBS@
> 
>  libcommon_la_SOURCES = $(COMMON)
> 
> Afterwards libsndfile can be linked with ld.gold as it does with ld.bfd.
> 
> @Ian #6: even though this is not a gold issue, there is now a better
> approach to disable the gold linker when needed: use tc-ld-disable-gold (see
> https://bugs.gentoo.org/show_bug.cgi?id=439082#c15 and
> https://bugs.gentoo.org/show_bug.cgi?id=470634#c30). But you should only do
> that for packages where ld.gold causes breakage of the linked binary/library
> or does not have the needed functionality (like the default-symver switch
> from sys-libs/db https://bugs.gentoo.org/show_bug.cgi?id=470634 or the
> VERSION stuff in dev-db/mariadb
> https://bugs.gentoo.org/show_bug.cgi?id=508724)
Comment 12 Roman Gruber 2015-08-24 22:04:25 UTC
still fails with gold linker with gcc 5.2

Can we please get a fix for the ebuild? thanks
Comment 13 Justin Lecher (RETIRED) gentoo-dev 2016-01-26 08:48:59 UTC
I just checked it again

1.0.25-r1 fails
1.0.26 works
Comment 14 Justin Lecher (RETIRED) gentoo-dev 2016-01-26 08:52:34 UTC
commit 6f4d6d4e5f9402581ccb90dcba045a509b03a99a
Author: Justin Lecher <jlec@gentoo.org>
Date:   Tue Jan 26 09:51:14 2016 +0100

    media-libs/libsndfile: Drop version vulnerable for CVE-2015-7805

    Package-Manager: portage-2.2.27
    Signed-off-by: Justin Lecher <jlec@gentoo.org>

    https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f4d6d4e5f9402581ccb90dcba045a509b03a99a