powertop-1.10 failed to compile with an haredened gcc: >>> Emerging (1 of 1) sys-power/powertop-1.10 to / * powertop-1.10.tar.gz RMD160 SHA1 SHA256 size ;-) ... [ ok ] * checking ebuild checksums ;-) ... [ ok ] * checking auxfile checksums ;-) ... [ ok ] * checking miscfile checksums ;-) ... [ ok ] * checking powertop-1.10.tar.gz ;-) ... [ ok ] >>> Unpacking source... >>> Unpacking powertop-1.10.tar.gz to /var/tmp/portage/sys-power/powertop-1.10/work >>> Source unpacked. >>> Compiling source in /var/tmp/portage/sys-power/powertop-1.10/work/powertop-1.10 ... i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o powertop.o powertop.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o config.o config.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o process.o process.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o misctips.o misctips.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o bluetooth.o bluetooth.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o display.o display.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o suggestions.o suggestions.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o wireless.o wireless.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o cpufreq.o cpufreq.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o sata.o sata.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o xrandr.o xrandr.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o ethernet.o ethernet.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o cpufreqstats.o cpufreqstats.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o usb.o usb.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o urbnum.o urbnum.c i686-pc-linux-gnu-gcc -O2 -march=nocona -fomit-frame-pointer -pipe -c -o intelcstates.o intelcstates.c intelcstates.c: In function `print_intel_cstates': intelcstates.c:48: error: can't find a register in class `BREG' while reloading `asm' make: *** [intelcstates.o] Error 1 make: *** Waiting for unfinished jobs.... * * ERROR: sys-power/powertop-1.10 failed. * Call stack: * ebuild.sh, line 49: Called src_compile * environment, line 2030: Called die * The specific snippet of code: * emake || die * The die message: * (no error message) * * If you need support, post the topmost build error, and the call stack if relevant. * A complete build log is located at '/var/tmp/portage/sys-power/powertop-1.10/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/sys-power/powertop-1.10/temp/environment'. * Reproducible: Always It works with the vanilla gcc
No time to look deeper right now but this can most likely be worked around by using -hardenednopie gcc specs.
I've created a modified ebuild based on Sam Hocevar's discussion on PIC-aware Assembly code. Works for me. http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well Regards, Dw.
Created attachment 165361 [details] Modified ebuild applies a PIC patch for the Assembly code Modified ebuild applies a PIC patch for the Assembly code
Created attachment 165365 [details, diff] Modifications for the cpuid Asembly code Modifications for the cpuid Asembly code
Thank you Attila Tóth! Adding mobile@g.o to CC.
(In reply to comment #5) > Thank you Attila Tóth! Adding mobile@g.o to CC. > It may worth to be reported upstreams. Regards, Dwokfur
Reported upstream. Preliminary comments positive. We have to see what enters git, tho. http://www.bughost.org/pipermail/power/2008-November/001463.html
(In reply to comment #7) > Reported upstream. Preliminary comments positive. We have to see what enters > git, tho. > > http://www.bughost.org/pipermail/power/2008-November/001463.html > Thanks, Xake. Fortunately cpuid is not a performance limiting instruction of powertop. I don't know how many users are running hardened toolchain on their laptops, but the reporter of the bug probably does, so at least two persons can benefit.. :) Regards, Dw.
Fix is in sys-power/powertop-1.11 as per upstream. Many thanks to Attila Tóth for the patch and Xake for pushing it upstream. mobile@ - will you (or may I?) remove sys-power/powertop-1.10 and close out this bug? No reported bugs in sys-power/powertop-1.11. In fact, this is the only bug for sys-power/powertop. ;)
sys-power/powertop-1.11 in the tree for 30+ days, works great, no open bugs and no response in this bug. As such, sys-power/powertop-1.10 has been removed, closing.