Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 236372 - sys-power/powertop-1.10 - intelcstates.c:48: error: can't find a register in class `BREG' while reloading `asm'
Summary: sys-power/powertop-1.10 - intelcstates.c:48: error: can't find a register in ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-01 17:51 UTC by Cédric Krier
Modified: 2009-04-04 02:43 UTC (History)
3 users (show)

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


Attachments
Modified ebuild applies a PIC patch for the Assembly code (powertop-1.10-r1.ebuild,1.07 KB, text/plain)
2008-09-13 20:56 UTC, Attila Tóth
Details
Modifications for the cpuid Asembly code (powertop-1.10-pic.diff,1.09 KB, patch)
2008-09-13 20:57 UTC, Attila Tóth
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Cédric Krier gentoo-dev 2008-09-01 17:51:11 UTC
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
Comment 1 Gordon Malm (RETIRED) gentoo-dev 2008-09-02 01:02:55 UTC
No time to look deeper right now but this can most likely be worked around by using -hardenednopie gcc specs.
Comment 2 Attila Tóth 2008-09-13 20:55:12 UTC
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.
Comment 3 Attila Tóth 2008-09-13 20:56:29 UTC
Created attachment 165361 [details]
Modified ebuild applies a PIC patch for the Assembly code

Modified ebuild applies a PIC patch for the Assembly code
Comment 4 Attila Tóth 2008-09-13 20:57:13 UTC
Created attachment 165365 [details, diff]
Modifications for the cpuid Asembly code

Modifications for the cpuid Asembly code
Comment 5 Gordon Malm (RETIRED) gentoo-dev 2008-09-13 21:05:31 UTC
Thank you Attila Tóth!  Adding mobile@g.o to CC.
Comment 6 Attila Tóth 2008-09-14 07:49:58 UTC
(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
Comment 7 Xake 2008-11-11 00:19:08 UTC
Reported upstream. Preliminary comments positive. We have to see what enters git, tho.

http://www.bughost.org/pipermail/power/2008-November/001463.html
Comment 8 Attila Tóth 2008-11-11 08:23:18 UTC
(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.
Comment 9 Gordon Malm (RETIRED) gentoo-dev 2009-03-24 21:57:21 UTC
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. ;)
Comment 10 Gordon Malm (RETIRED) gentoo-dev 2009-04-04 02:43:16 UTC
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.