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

Bug 486124

Summary: sys-power/powertop-2.4 - ld: powertop-display.o: undefined reference to symbol 'cbreak'
Product: Gentoo Linux Reporter: Andrea Arteaga (RETIRED) <spiros>
Component: [OLD] Core systemAssignee: Rick Farina (Zero_Chaos) <zerochaos>
Status: RESOLVED FIXED    
Severity: normal CC: alex_y_xu, jer
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 457530    
Attachments: build.log
powertop-2.4-tinfo.patch

Description Andrea Arteaga (RETIRED) gentoo-dev 2013-09-26 22:49:31 UTC
As you can see I'm using gentoo-sources-3.10.1, gcc-4.6.4.

At the end of the build.log I read:

libtool: link: x86_64-pc-linux-gnu-g++ -fno-omit-frame-pointer -fstack-protector -Wall -Wshadow -Wformat -I/usr/include/libnl3 -O2 -mtune=corei7-avx -march=corei7-avx -pipe -w -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed -o powertop parameters/powertop-persistent.o parameters/powertop-learn.o parameters/powertop-parameters.o powertop-display.o cpu/powertop-cpu_core.o cpu/powertop-cpudevice.o cpu/powertop-cpu.o cpu/powertop-cpu_linux.o cpu/powertop-abstract_cpu.o cpu/powertop-cpu_package.o cpu/powertop-intel_cpus.o powertop-devlist.o powertop-lib.o report/powertop-report.o process/powertop-process.o process/powertop-processdevice.o process/powertop-powerconsumer.o process/powertop-timer.o process/powertop-work.o process/powertop-do_process.o process/powertop-interrupt.o perf/powertop-perf.o perf/powertop-perf_bundle.o devices/powertop-i915-gpu.o devices/powertop-device.o devices/powertop-alsa.o devices/powertop-runtime_pm.o devices/powertop-thinkpad-fan.o devices/powertop-usb.o devices/powertop-ahci.o devices/powertop-thinkpad-light.o devices/powertop-rfkill.o devices/powertop-backlight.o devices/powertop-network.o tuning/powertop-bluetooth.o tuning/powertop-cpufreq.o tuning/powertop-tuning.o tuning/powertop-tuningusb.o tuning/powertop-ethernet.o tuning/powertop-tunable.o tuning/powertop-iw.o tuning/powertop-wifi.o tuning/powertop-tuningsysfs.o tuning/powertop-runtime.o calibrate/powertop-calibrate.o measurement/powertop-measurement.o measurement/powertop-power_supply.o measurement/powertop-acpi.o measurement/powertop-sysfs.o measurement/powertop-extech.o report/powertop-report-maker.o report/powertop-report-formatter-base.o report/powertop-report-formatter-csv.o report/powertop-report-formatter-html.o powertop-main.o cpu/powertop-intel_gpu.o cpu/rapl/powertop-rapl_interface.o cpu/powertop-cpu_rapl_device.o cpu/powertop-dram_rapl_device.o devices/powertop-gpu_rapl_device.o  -lpci -lnl-genl-3 -lnl-3 ../traceevent/.libs/libtraceevnet.a -lpthread -lncursesw
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/../../../../x86_64-pc-linux-gnu/bin/ld: powertop-display.o: undefined reference to symbol 'cbreak'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.4/../../../../x86_64-pc-linux-gnu/bin/ld: note: 'cbreak' is defined in DSO /lib64/libtinfow.so.5 so try adding it to the linker command line
/lib64/libtinfow.so.5: could not read symbols: Invalid operation
collect2: ld returned 1 exit status


Here is my # emerge --info "=sys-power/powertop-2.4"
Portage 2.2.7 (default/linux/amd64/13.0/desktop/kde, gcc-4.6.4, glibc-2.17, 3.10.1-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-3.10.1-gentoo-x86_64-Intel-R-_Core-TM-_i7-2640M_CPU_@_2.80GHz-with-gentoo-2.2
KiB Mem:     3995904 total,    616212 free
KiB Swap:    6731196 total,   6252072 free
Timestamp of tree: Thu, 26 Sep 2013 20:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
distcc 3.1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.5-r2, 3.2.5-r2, 3.3.2-r2
dev-util/cmake:           2.8.11.1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12
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
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.6.4, 4.7.3
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.11 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo science
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA PUEL AdobeFlash-11.x google-chrome googleearth Google-TOS Intel-SDP skype-4.0.0.7-copyright NVIDIA-CUDA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -mtune=corei7-avx -march=corei7-avx -pipe -w -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /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="-O2 -mtune=corei7-avx -march=corei7-avx -pipe -w -fomit-frame-pointer"
DISTDIR="/var/cache/distdir"
EMERGE_DEFAULT_OPTS="--quiet-unmerge-warn --quiet-build --keep-going"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nodoc noinfo parallel-fetch parallel-install preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.switch.ch/ftp/mirror/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
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"
PORTDIR="/var/portage"
PORTDIR_OVERLAY="/var/lib/layman/science"
USE="X a52 aac acl acpi alsa amd64 avx bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx daap dbus declarative dri dts dvd dvdr emboss encode exif fam ffmpeg firefox flac fortran gdbm gif google gpm gtk iconv irc jpeg kde kipi lcms libnotify mad mmx mng modules mp3 mp4 mpeg mpeg2 mudflap multilib ncurses networkmanager nls nptl offensive ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qt3support qt4 readline sdl semantic-desktop sensord session sip spell sqlite sse sse2 sse3 sse4 sse4_1 sse4_2 sse4a ssl ssse3 startup-notification svg tcpd threads tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 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" 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 ubx" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby18 ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="intel 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"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON

Reproducible: Always
Comment 1 Andrea Arteaga (RETIRED) gentoo-dev 2013-09-26 22:50:59 UTC
Created attachment 359560 [details]
build.log
Comment 2 Alex Xu (Hello71) 2013-09-26 23:15:38 UTC
I had no issues compiling it.

As a side note, -fomit-frame-pointer is enabled by default on amd64 at levels -O, -O2, -O3, -Os.
Comment 3 Rick Farina (Zero_Chaos) gentoo-dev 2013-09-27 15:49:39 UTC
May I see the output of "emerge -vp ncurses" please?  Also it may help for you to just rebuild ncurses as it looks like the problem is somewhere around there.
Comment 4 Andrea Arteaga (RETIRED) gentoo-dev 2013-09-27 20:55:56 UTC
Alex: thanks for the side note :-)

I'm sorry, it's my problem with ncurses, as Rick said, not a bug. Anyway "emerge -pv ncurses" gives:

[ebuild   R    ] sys-libs/ncurses-5.9-r3:5  USE="cxx gpm tinfo unicode -ada -debug -doc -minimal -profile -static-libs -trace" ABI_X86="(64) -32 (-x32)"
Comment 5 Rick Farina (Zero_Chaos) gentoo-dev 2013-09-28 04:51:08 UTC
(In reply to Andrea Arteaga from comment #4)
> I'm sorry, it's my problem with ncurses, as Rick said, not a bug. Anyway
> "emerge -pv ncurses" gives:
> 
> [ebuild   R    ] sys-libs/ncurses-5.9-r3:5  USE="cxx gpm tinfo unicode -ada
> -debug -doc -minimal -profile -static-libs -trace" ABI_X86="(64) -32 (-x32)"

So was there a use flag change or something in here? An incompatible ncurses version? Or was it just something broken locally which needed a rebuild?
Comment 6 Jeroen Roovers gentoo-dev 2013-09-28 14:40:37 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #5)
> (In reply to Andrea Arteaga from comment #4)
> > [ebuild   R    ] sys-libs/ncurses-5.9-r3:5  USE="cxx gpm tinfo unicode -ada
> > -debug -doc -minimal -profile -static-libs -trace" ABI_X86="(64) -32 (-x32)"
> 
> So was there a use flag change or something in here? An incompatible ncurses
> version? Or was it just something broken locally which needed a rebuild?

Er, see the bug that this one blocks. When built with USE-tinfo, ncurses installs a separate library with terminal information. The proper fix is to use ncurses' pkg-config file to determine what to link against.
Comment 7 Jeroen Roovers gentoo-dev 2013-09-28 14:41:05 UTC
(In reply to Jeroen Roovers from comment #6)
> [...] USE-tinfo

USE=tinfo
Comment 8 Rick Farina (Zero_Chaos) gentoo-dev 2013-09-28 16:48:19 UTC
I'm setting this back to confirmed then since I'll have to see how it was solved in other places and fix it.
Comment 9 Andrea Arteaga (RETIRED) gentoo-dev 2013-09-28 20:30:51 UTC
Just confirming that rebuilding ncurses (with tinfo) does NOT solve the problem. I cannot build ncursses with -tinfo, as it is required by dev-util/nvidia-cuda-toolkit-5.5.22, that I need.
Comment 10 Jeroen Roovers gentoo-dev 2013-09-29 14:59:31 UTC
Created attachment 359742 [details, diff]
powertop-2.4-tinfo.patch
Comment 11 Jeroen Roovers gentoo-dev 2013-09-29 15:03:03 UTC
(In reply to Jeroen Roovers from comment #10)
> Created attachment 359742 [details, diff] [details, diff]
> powertop-2.4-tinfo.patch

Works for the 9999 ebuild as well.
Comment 12 Rick Farina (Zero_Chaos) gentoo-dev 2013-10-03 04:58:23 UTC
(In reply to Jeroen Roovers from comment #10)
> Created attachment 359742 [details, diff] [details, diff]
> powertop-2.4-tinfo.patch

Thanks a lot for the patch Jeroen, I've added it to the ebuild.

One remaining concern is that when people toggle ncurses[tinfo] it would appear to break things like powertop:

!!! existing preserved libs:
>>> package: sys-libs/ncurses-5.9-r2
 *  - /lib64/libtinfo.so.5
 *  - /lib64/libtinfo.so.5.9
 *      used by /usr/sbin/powertop (sys-power/powertop-2.4)


Is it completely crazy of me to add a USE=tinfo to powertop and change the ncurses dep to ncurses[tinfo=]?
Comment 13 Jeroen Roovers gentoo-dev 2013-10-03 13:07:15 UTC
(In reply to Rick Farina (Zero_Chaos) from comment #12)
> (In reply to Jeroen Roovers from comment #10)
> > Created attachment 359742 [details, diff] [details, diff] [details, diff]
> > powertop-2.4-tinfo.patch
> 
> Thanks a lot for the patch Jeroen, I've added it to the ebuild.

The patch changes configure.ac, and yet you don't run eautoreconf?

> One remaining concern is that when people toggle ncurses[tinfo] it would
> appear to break things like powertop:
> 
> !!! existing preserved libs:
> >>> package: sys-libs/ncurses-5.9-r2
>  *  - /lib64/libtinfo.so.5
>  *  - /lib64/libtinfo.so.5.9
>  *      used by /usr/sbin/powertop (sys-power/powertop-2.4)

So they should run `emerge @preserved-rebuild'.

> Is it completely crazy of me to add a USE=tinfo to powertop and change the
> ncurses dep to ncurses[tinfo=]?

Yes.
Comment 14 Rick Farina (Zero_Chaos) gentoo-dev 2013-10-03 19:52:39 UTC
(In reply to Jeroen Roovers from comment #13)
> (In reply to Rick Farina (Zero_Chaos) from comment #12)
> > (In reply to Jeroen Roovers from comment #10)
> > > Created attachment 359742 [details, diff] [details, diff] [details, diff] [details, diff]
> > > powertop-2.4-tinfo.patch
> > 
> > Thanks a lot for the patch Jeroen, I've added it to the ebuild.
> 
> The patch changes configure.ac, and yet you don't run eautoreconf?

Yeah, it was the middle of the night and my son was screaming, I read eautoreconf and completely ignored the conditional, and the fact that I never inherited autotools... Thanks, fixed.

+  03 Oct 2013; Rick Farina <zerochaos@gentoo.org> powertop-2.4.ebuild,
+  powertop-9999.ebuild:
+  proper fix for bug #486124, thanks again to Jer for pointing out obvious
+  failure