You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the current cpuid logic clobbers %ebx. this is OK if the code is not PIC, but
if you're building PIEs, it'll fail because %ebx is the PIC register and gcc
doesn't let you clobber it.
simple fix:
int ax, bx, cx, dx;
__asm__ __volatile__ (
"mov %%ebx, %%edi;"
"cpuid;"
"mov %%ebx, %%esi;"
"mov %%edi, %%ebx;"
:"=a" (ax), "=S" (bx), "=c" (cx), "=d" (dx) : "a"(1) :"edi");
it's a few more insns on x86_64 or i386/non-pic, so if you want, you could do
something like:
#if defined(STRESSAPPTEST_CPU_I686) && defined(__PIC__)
... do pic version here ...
#else
... do non-pic version here ...
#endif
Original issue reported on code.google.com by vapier@gmail.com on 27 Nov 2012 at 7:19
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
vapier@gmail.com
on 27 Nov 2012 at 7:19The text was updated successfully, but these errors were encountered: