Bug 804282 - virt-what fails to build with PIE on i686: error: can't find a register in class ‘BREG’ while reloading ‘asm’
Summary: virt-what fails to build with PIE on i686: error: can't find a register in cl...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-what
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-17 10:22 UTC by Richard W.M. Jones
Modified: 2012-03-17 13:27 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-03-17 13:27:15 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
https://bugzilla.redhat.com/show_bug.cgi?id=804282 (1.10 KB, patch)
2012-03-17 10:56 UTC, Richard W.M. Jones
no flags Details | Diff

Description Richard W.M. Jones 2012-03-17 10:22:35 UTC
Description of problem:

See this Gentoo bug report:
https://bugs.gentoo.org/show_bug.cgi?id=341271

See also this:
https://bugs.gentoo.org/show_bug.cgi?id=362167

Version-Release number of selected component (if applicable):

1.11 and git

How reproducible:

100%

Steps to Reproduce:
1. Download virt-what 1.11 or git.
2. Install glibc-devel.i686
3. Compile virt-what-cpuid-helper as a 32 bit object file with PIE:

  gcc -fpie -std=gnu99 -DHAVE_CONFIG_H -I.  -Wall   -Os -march=i686 -m32 -mtune=core2 -fomit-frame-pointer -c virt-what-cpuid-helper.c
  
Actual results:

I get a different error (but still an error) from the Gentoo report.
For me it says:

virt-what-cpuid-helper.c:33:3: error: inconsistent operand constraints in an ‘asm’
virt-what-cpuid-helper.c:33:3: error: inconsistent operand constraints in an ‘asm’

Removing the -fpie option makes this error go away.

Expected results:

No error.

Additional info:

When using PIE, %ebx is used by the compiler for relative addressing.
(Doesn't happen with x86-64, presumably because rip-relative
addressing is used there)

Comment 1 Richard W.M. Jones 2012-03-17 10:56:18 UTC
Created attachment 570775 [details]
https://bugzilla.redhat.com/show_bug.cgi?id=804282

Proposed patch.

Comment 2 Richard W.M. Jones 2012-03-17 13:27:15 UTC
Fixed upstream in virt-what 1.12.


Note You need to log in before you can comment on or make changes to this bug.