Bug 804282

Summary: virt-what fails to build with PIE on i686: error: can't find a register in class ‘BREG’ while reloading ‘asm’
Product: [Fedora] Fedora Reporter: Richard W.M. Jones <rjones>
Component: virt-whatAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mbooth, rjones, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-17 13:27:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
https://bugzilla.redhat.com/show_bug.cgi?id=804282 none

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.