Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 547786

Summary: app-accessibility/brltty[ncurses] with sys-apps/ncurses[tinfo]: x86_64-pc-linux-gnu/bin/ld: brltty-ttb.o: undefined reference to symbol 'cbreak'
Product: Gentoo Linux Reporter: Gary Macindoe <gary>
Component: Current packagesAssignee: Gentoo Accessibility Team <accessibility>
Status: RESOLVED FIXED    
Severity: normal CC: alexeyp, ansla80, esigra, joost.ruis
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 457530    
Attachments: build.log

Description Gary Macindoe 2015-04-26 10:04:28 UTC
app-accessibility/brltty[ncurses] does not link with the tinfow library required when sys-apps/ncurses[tinfo] is installed.

brltty uses a custom build system which uses autoconf without the rest of autotools.  It uses a function BRLTTY_PACKAGE_CHOOSE defined in aclocal.m4 to find the correct curses library to use (settling on ncursesw on my system) but only links against -lncursesw and not -ltinfow leading to a linker error.  I have tried replacing the call to AC_CHECK_LIB in BRLTTY_CHOOSE_PACKAGE with a call to PKG_CHECK_MODULES and also with a call to ${PKG_CONFIG}.  I have also tried replacing BRLTTY_PACKAGE_CHOOSE with PKG_CHECK_MODULES.  I am not experienced enough with autotools to implement any of these solutions correctly without syntax errors causing configure to fail.

It is possible to fix this by patching configure in src_prepare after the call to eautoconf to replace -lncursesw with the output of $(pkg-config --libs ncursesw) but this is not portable.

Reproducible: Always

Steps to Reproduce:
1. USE="ncurses tinfo" emerge brltty
Actual Results:  
package fails at compile stage

Expected Results:  
package is installed successfully

emerge --info
Portage 2.2.18 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop/kde, gcc-4.9.2, glibc-2.20-r2, 3.19.3-tuxonice x86_64)
=================================================================
System uname: Linux-3.19.3-tuxonice-x86_64-Intel-R-_Core-TM-_i7-3630QM_CPU_@_2.40GHz-with-gentoo-2.2
KiB Mem:    16227020 total,  12717272 free
KiB Swap:    1028092 total,   1028092 free
Timestamp of repository gentoo: Tue, 14 Apr 2015 08:15:01 +0000
sh bash 4.2_p53
ld GNU ld (Gentoo 2.25 p1.0) 2.25
app-shells/bash:          4.2_p53::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.3.5-r1::gentoo, 3.4.3::gentoo
dev-util/cmake:           2.8.12.2-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.13.11::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo
sys-devel/binutils:       2.25::gentoo
sys-devel/gcc:            4.9.2::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

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

Local-Overlay
    location: /usr/local/portage
    sync-type: git
    sync-uri: https://github.com/garymacindoe/gentoo-overlay.git
    masters: gentoo
    priority: 0

proaudio
    location: /var/lib/layman/proaudio
    sync-type: laymansync
    sync-uri: svn://svn.tuxfamily.org/svnroot/proaudio/proaudio/trunk/overlays/proaudio
    masters: gentoo
    priority: 50

science
    location: /var/lib/layman/science
    sync-type: laymansync
    sync-uri: git://git.overlays.gentoo.org/proj/sci.git
    masters: gentoo
    priority: 50

Installed sets: @android-build, @steam
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/Visual_Paradigm_CE_12.0/Application/resources/product_edition.properties /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/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy clean-logs compress-build-logs config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync multilib-strict news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://mirror.bytemark.co.uk/gentoo/ http://mirror.bytemark.co.uk/gentoo/ http://mirror.qubenet.net/mirror/gentoo/ http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ ftp://ftp.mirrorservice.org/sites/www.ibiblio.org/gentoo/"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
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="/var/tmp"
USE="X a52 aac accessibility acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif expat fam ffmpeg fftw firefox flac fortran gdbm gif git glamor gnuplot gpm gstreamer hdf5 iconv icu ipv6 jack java jpeg kde kipi ladspa lapack latex lcms ldap libav libnotify libsamplerate lm_sensors mad midi mmx mmxext mng modules mp3 mp4 mpeg mpi mtp multilib mysql ncurses nls nptl ogg opengl openmp pam pango pcre pdf perl phonon plasma png policykit postscript ppds python qt3support qt4 readline ruby samba sdl semantic-desktop session sndfile spell sqlite sse sse2 ssl startup-notification subversion svg symlink taglib tcmalloc tcpd threads tiff timidity truetype udev udisks unicode upower usb vcd vdpau vorbis wavpack wxwidgets x264 xattr xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" 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" 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" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" DVB_CARDS="usb-dib0700 usb-dtt200u" 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="en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3 python3_4" QEMU_SOFTMMU_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19 ruby20" STEAMGAMES="tf2" USERLAND="GNU" VIDEO_CARDS="intel i915 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Gary Macindoe 2015-04-26 10:06:20 UTC
emerge --info
Portage 2.2.18 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop/kde, gcc-4.9.2, glibc-2.20-r2, 3.19.3-tuxonice x86_64)
=================================================================
System uname: Linux-3.19.3-tuxonice-x86_64-Intel-R-_Core-TM-_i7-3630QM_CPU_@_2.40GHz-with-gentoo-2.2
KiB Mem:    16227020 total,  12717272 free
KiB Swap:    1028092 total,   1028092 free
Timestamp of repository gentoo: Tue, 14 Apr 2015 08:15:01 +0000
sh bash 4.2_p53
ld GNU ld (Gentoo 2.25 p1.0) 2.25
app-shells/bash:          4.2_p53::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.3.5-r1::gentoo, 3.4.3::gentoo
dev-util/cmake:           2.8.12.2-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.13.11::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo
sys-devel/binutils:       2.25::gentoo
sys-devel/gcc:            4.9.2::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

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

Local-Overlay
    location: /usr/local/portage
    sync-type: git
    sync-uri: https://github.com/garymacindoe/gentoo-overlay.git
    masters: gentoo
    priority: 0

proaudio
    location: /var/lib/layman/proaudio
    sync-type: laymansync
    sync-uri: svn://svn.tuxfamily.org/svnroot/proaudio/proaudio/trunk/overlays/proaudio
    masters: gentoo
    priority: 50

science
    location: /var/lib/layman/science
    sync-type: laymansync
    sync-uri: git://git.overlays.gentoo.org/proj/sci.git
    masters: gentoo
    priority: 50

Installed sets: @android-build, @steam
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/Visual_Paradigm_CE_12.0/Application/resources/product_edition.properties /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/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy clean-logs compress-build-logs config-protect-if-modified distlocks ebuild-locks fail-clean fixlafiles merge-sync multilib-strict news parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://mirror.bytemark.co.uk/gentoo/ http://mirror.bytemark.co.uk/gentoo/ http://mirror.qubenet.net/mirror/gentoo/ http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ ftp://ftp.mirrorservice.org/sites/www.ibiblio.org/gentoo/"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j9"
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="/var/tmp"
USE="X a52 aac accessibility acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif expat fam ffmpeg fftw firefox flac fortran gdbm gif git glamor gnuplot gpm gstreamer hdf5 iconv icu ipv6 jack java jpeg kde kipi ladspa lapack latex lcms ldap libav libnotify libsamplerate lm_sensors mad midi mmx mmxext mng modules mp3 mp4 mpeg mpi mtp multilib mysql ncurses nls nptl ogg opengl openmp pam pango pcre pdf perl phonon plasma png policykit postscript ppds python qt3support qt4 readline ruby samba sdl semantic-desktop session sndfile spell sqlite sse sse2 ssl startup-notification subversion svg symlink taglib tcmalloc tcpd threads tiff timidity truetype udev udisks unicode upower usb vcd vdpau vorbis wavpack wxwidgets x264 xattr xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64" 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" 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" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" DVB_CARDS="usb-dib0700 usb-dtt200u" 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="en_GB" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3 python3_4" QEMU_SOFTMMU_TARGETS="i386 x86_64" RUBY_TARGETS="ruby19 ruby20" STEAMGAMES="tf2" USERLAND="GNU" VIDEO_CARDS="intel i915 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Gary Macindoe 2015-04-26 10:07:50 UTC
Created attachment 402028 [details]
build.log
Comment 3 Steve Arnold archtester gentoo-dev 2016-03-29 20:13:14 UTC
Workaround:

 src_configure() {
+	strip-flags "_BSD_SOURCE"
+	append-cppflags -D_DEFAULT_SOURCE
+
+	if ( use ncurses && built_with_use sys-libs/ncurses tinfo ) ; then
+		append-libs " tinfo"
+	fi
+
Comment 4 Joost Ruis 2017-01-25 00:05:02 UTC
(In reply to Steve Arnold from comment #3)
> Workaround:
> 
>  src_configure() {
> +	strip-flags "_BSD_SOURCE"
> +	append-cppflags -D_DEFAULT_SOURCE
> +
> +	if ( use ncurses && built_with_use sys-libs/ncurses tinfo ) ; then
> +		append-libs " tinfo"
> +	fi
> +

That worked for me! Thanks!
Comment 5 Lagu 2017-04-10 16:27:01 UTC
Hi!, actually i have this bug https://bugs.gentoo.org/show_bug.cgi?id=562358, and your patch works fine too!
Comment 6 Steve Arnold archtester gentoo-dev 2017-12-02 23:51:11 UTC
This is now fixed in the main tree, along with a sysmacros.h patch for newer glibc.  Should be able to close this now.
Comment 7 Lagu 2018-06-05 14:59:26 UTC
Hi, the app continues failing, and the patch continues working.
Comment 8 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2019-03-22 14:37:41 UTC
This issue was fixed by the following commit:

commit 9972fed3f21b47e7315949e39f762d9b209c1fd5
Author: David Seifert <soap@gentoo.org>
Date:   Mon Dec 4 11:24:38 2017

    app-accessibility/brltty: [QA] Fix multiple issues

    * Don't add dead python impls to PYTHON_COMPAT
    * Don't remove python metadata vars (${PYTHON_REQUIRED_USE})
      from REQUIRED_USE
    * Don't remove the SLOT specifier for sys-libs/ncurses
    * Get rid of the awfully complicated, hacky and
      non-generalisable solution for the libtinfo split,
      which also doesn't generalise to Prefix.
      Using pkg-config is easier, safer, more portable and
      less brittle than the previous hacks.
    * Get rid of the totally unnecessary code paths
      created by dispatching on glibc versions.
      'sys/sysmacros.h' can always be included on glibc,
      packages just have relied on this include implicitly.

    Package-Manager: Portage-2.3.16, Repoman-2.3.6
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-01-09 06:28:30 UTC
*** Bug 562358 has been marked as a duplicate of this bug. ***