Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 548004 - app-cdr/cdrdao-1.2.3-r1 fails with ld.gold - dao.cc:191: error: undefined reference to 'pthread_sigmask'
Summary: app-cdr/cdrdao-1.2.3-r1 fails with ld.gold - dao.cc:191: error: undefined ref...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-gold underlinking
  Show dependency tree
 
Reported: 2015-04-28 12:58 UTC by Steffen Hau
Modified: 2016-02-14 12:50 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Hau 2015-04-28 12:58:24 UTC
x86_64-pc-linux-gnu-g++ -DDRIVER_TABLE_FILE=\"/usr/share/cdrdao/drivers\" -march=native -O2 -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure -ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin  -Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure -ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin -Wl,-znow -Wl,--sort-common -Wl,--hash-style=gnu -Wl,--enable-new-dtags -o cdrdao  main.o ./libdao.a ../paranoia/libcdda_paranoia.a ../trackdb/libtrackdb.a -lmad -lm  -lvorbisfile  -lao  
[snip]
dao.cc:191: error: undefined reference to 'pthread_sigmask'
dao.cc:170: error: undefined reference to 'pthread_sigmask'
dao.cc:693: error: undefined reference to 'pthread_create'
dao.cc:778: error: undefined reference to 'pthread_join'
collect2: error: ld returned 1 exit status
Makefile:408: recipe for target 'cdrdao' failed
make[2]: *** [cdrdao] Error 1
make[2]: Leaving directory '/home/gentoo/tmp/portage/app-cdr/cdrdao-1.2.3-r1/work/cdrdao-1.2.3/dao'

ld.bfd does not show this issue. 


Following trivial patch fixes the issue with ld.gold:
--- a/dao/Makefile.orig	2015-04-28 14:49:51.856665620 +0200
+++ b/dao/Makefile	2015-04-28 14:50:23.653664483 +0200
@@ -322,7 +322,7 @@
 
 cdrdao_LDADD = ./libdao.a $(top_builddir)/paranoia/libcdda_paranoia.a \
 	$(top_builddir)/trackdb/libtrackdb.a  \
-	 $(am__append_1) $(am__append_2) -lao 
+	 $(am__append_1) $(am__append_2) -lao -pthread
 cdrdao_DEPENDENCIES = \
 	$(top_builddir)/paranoia/libcdda_paranoia.a	\
 	$(top_builddir)/trackdb/libtrackdb.a		\


Portage 2.2.18 (python 3.4.3-final-0, default/linux/amd64/13.0, gcc-5.1.0, glibc-2.20-r2, 4.0.0-HAUIHAU x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.0.0-HAUIHAU-x86_64-Intel-R-_Core-TM-_i7-2620M_CPU_@_2.70GHz-with-gentoo-2.2
KiB Mem:     8101940 total,   2939980 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Tue, 28 Apr 2015 06:00:01 +0000
sh bash 4.3_p33-r2
ld GNU gold (Gentoo 2.25 p1.0 2.25) 1.11
ccache version 3.2.1 [disabled]
app-shells/bash:          4.3_p33-r2::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r2::gentoo, 3.4.3::gentoo
dev-util/ccache:          3.2.1-r1::gentoo
dev-util/cmake:           3.2.1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25::gentoo
sys-devel/gcc:            4.9.2::gentoo, 5.1.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

hauihau
    location: /usr/local/portage/hauihau
    masters: gentoo
    priority: 0

x11
    location: /var/lib/layman/x11
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/x11
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure -ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure -ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n --keep-going=y --quiet-build=y --quiet-fail=y --with-bdeps=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs compressdebug config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles merge-sync metadata-transfer news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -fira-loop-pressure -ftree-vectorize -ftree-loop-linear -flto=5 -fuse-linker-plugin -Wl,-znow -Wl,--sort-common -Wl,--hash-style=gnu -Wl,--enable-new-dtags"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
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="/home/gentoo/tmp/"
USE="X a52 aac aalib acl alsa amd64 apache2 avx bash-completion berkdb bluetooth branding bzip2 cairo caps cdda cddb cdparanoia cdr cli cracklib crypt cups curl cxx dbus dga dri dts dv dvd encode exif ffmpeg flac fontconfig fortran ftp gd gdbm gif gmp gnome gnome-keyring gphoto2 gstreamer gtk iconv icu imagemagick imlib ipv6 jpeg jpeg2k kde lame latex libcaca libnotify libsamplerate lzma lzo mad matroska mmx mmxext mng modemmanager modules mp3 mpeg mtp multilib musepack mysql mysqli ncurses networkmanager nls nptl nsplugin ogg openal opengl openmp pam pcre pdf png policykit postscript pulseaudio qt4 quicktime readline samba session sndfile spell sqlite sse sse2 sse3 sse4 sse4_1 sse4_2 ssl ssse3 svg syslog systemd tcpd theora threads tiff truetype udev unicode usb v4l vaapi vcd vim-syntax vorbis wavpack webkit x264 xattr xcb xcomposite xinerama xml xmp xorg xosd xpm xv xvid zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="access_compat actions alias auth_basic auth_digest authn_alias authn_anon authn_core authn_dbd authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgid dav dav_fs dav_lock dbd deflate dir env expires ext_filter file_cache filter headers ident imagemap include info lbmethod_bybusyness lbmethod_byrequests lbmethod_bytraffic lbmethod_heartbeat log_config log_forensic logio mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_fcgi proxy_ftp proxy_http ratelimit reqtimeout rewrite setenvif slotmem_shm socache_shmcb speling status substitute unique_id unixd userdir usertrack version vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="canon" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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-64" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python3_4" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="intel i965" 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="3.4"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

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

app-cdr/cdrdao-1.2.3-r1::gentoo was built with the following:
USE="encode mad vorbis -gcdmaster" ABI_X86="64"


Reproducible: Always

Steps to Reproduce:
1. try to compile app-cdr/cdrdao with ld.gold
2.
3.
Actual Results:  
linking of cdrdao binary failes

Expected Results:  
linking should succeed

https://blog.flameeyes.eu/2010/11/it-s-not-all-gold-that-shines-why-underlinking-is-a-bad-thing
Comment 1 David Seifert gentoo-dev 2016-01-26 08:36:46 UTC
Hi Steffen, could you please retry? It works for me, likely as some dependency is pulling in pthreads.
Comment 2 Steffen Hau 2016-01-26 10:27:32 UTC
Hi David,

I checked again an it still fails. I think it's not good to rely on other packages to include -pthread, as the package uses it it should check and add it on its own. My simple patch still works.

Best regards,
Steffen
Comment 3 David Seifert gentoo-dev 2016-02-13 18:15:22 UTC
Hi Steffen,
I've added AX_PTHREAD to the configure.ac and include PTHREAD_CFLAGS unconditionally in the LIBS. This should hopefully solve the issue, could you give it another go once -r3 trickles down to you?

commit 75ec4101484a7b273c2913ab02813d122bdf44c7
Author: David Seifert <soap@gentoo.org>
Date:   Sat Feb 13 19:11:45 2016 +0100

    app-cdr/cdrdao: Link to libpthread unconditionally
    
    Gentoo-Bug: 548004, 520988
    * EAPI=6
    * Use AX_PTHREAD to properly detect pthread flags
    * Use AM_PROG_AR instead of toolchain-funcs.eclass
    * Amend patches for -p1
    * Fix -Werror=format-security errors