Bug 814031: Allow GCC 4.6.3 to compile freebl_cpuid with the -O3

-fvisibility=hidden -fno-omit-frame-pointer flags in 32-bit x86 PIC builds.
The patch is contributed by Søren Gjesse of Google. r=wtc,sleevi.


git-svn-id: svn://10.0.0.236/trunk@264474 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
wtc%google.com 2012-11-21 23:26:22 +00:00
parent 61bad55ea5
commit 6b73cbf1fd

View File

@ -74,13 +74,13 @@ void freebl_cpuid(unsigned long op, unsigned long *eax,
unsigned long *edx)
{
/* sigh GCC isn't smart enough to save the ebx PIC register on it's own
* in this case, so do it by hand. */
__asm__("pushl %%ebx\n\t"
* in this case, so do it by hand. Use edi to store ebx and pass the
* value returned in ebx from cpuid through edi. */
__asm__("mov %%ebx,%%edi\n\t"
"cpuid\n\t"
"mov %%ebx,%1\n\t"
"popl %%ebx\n\t"
"xchgl %%ebx,%%edi\n\t"
: "=a" (*eax),
"=r" (*ebx),
"=D" (*ebx),
"=c" (*ecx),
"=d" (*edx)
: "0" (op));