Bug 804282 - virt-what fails to build with PIE on i686: error: can't find a register in class ‘BREG’ while reloading ‘asm’
virt-what fails to build with PIE on i686: error: can't find a register in cl...
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: virt-what (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-17 06:22 EDT by Richard W.M. Jones
Modified: 2012-03-17 09:27 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-03-17 09:27:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Richard W.M. Jones 2012-03-17 06:22:35 EDT
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 06:56:18 EDT
Created attachment 570775 [details]
https://bugzilla.redhat.com/show_bug.cgi?id=804282

Proposed patch.
Comment 2 Richard W.M. Jones 2012-03-17 09:27:15 EDT
Fixed upstream in virt-what 1.12.

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