"can't find a register in class ‘BREG’ while reloading ‘asm’" - problem with dynamic link libraries
When compiling the cpuid package with dynamic link libraries I get the following error:
$ cabal install --enable-shared cpuid-0.2
...
cbits/cpuid.c: In function ‘cpuid’:
cbits/cpuid.c:7:0:
error: can't find a register in class ‘BREG’ while reloading ‘asm’
cbits/cpuid.c:7:0: error: ‘asm’ operand has impossible constraints
...
The shortest call of ghc to reproduce this error is:
cpuid-0.2/cbits$ ghc -fPIC -c cpuid.c
The shortest call of gcc to reproduce this error is:
cpuid-0.2/cbits$ gcc -fPIC -c cpuid.c
The content of cpuid.c is:
void cpuid(int in, int * aa, int * bb, int * cc, int * dd)
{
int a, b, c, d;
asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in));
*aa = a;
*bb = b;
*cc = c;
*dd = d;
}
Shall I consider this a bug of GHC or of the cpuid package? Since GCC complains about this problem, I'm afraid it must be solved in the cpuid package. Just wanted to make sure the problem is reported somewhere.
Trac metadata
Trac field | Value |
---|---|
Version | 6.12.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | ghc@henning-thielemann.de |
Operating system | |
Architecture |