Merge pull request #4339 from unknownbrackets/linux-minor

Fix Linux x86 pic build (Qt) for some versions of gcc
This commit is contained in:
Henrik Rydgård 2013-10-27 11:54:15 -07:00
commit e5d802e82f
3 changed files with 11 additions and 4 deletions

View file

@ -1275,6 +1275,7 @@ endif()
# installs
file(INSTALL ${NativeAssets} DESTINATION assets)
file(INSTALL flash0 lang DESTINATION .)
# Fix CMake some Xcode settings.
if(APPLE)

View file

@ -20,6 +20,7 @@
#include <assert.h>
#include <stdarg.h>
#include <stddef.h>
// For cache flushing on Symbian/iOS/Blackberry
#ifdef __SYMBIAN32__

View file

@ -57,13 +57,18 @@ void __cpuidex(int regs[4], int cpuid_leaf, int ecxval)
} else {
ELOG("CPUID %08x failed!", cpuid_leaf);
}
#elif defined(__i386__) && defined(__PIC__)
asm (
"xchgl %%ebx, %1;\n\t"
"cpuid;\n\t"
"xchgl %%ebx, %1;\n\t"
:"=a" (regs[0]), "=r" (regs[1]), "=c" (regs[2]), "=d" (regs[3])
:"a" (cpuid_leaf), "c" (ecxval));
#else
asm (
"cpuid;\n\t"
"movl %%ebx, %1;\n\t"
:"=a" (regs[0]), "=m" (regs[1]), "=c" (regs[2]), "=d" (regs[3])
:"a" (cpuid_leaf), "c" (ecxval)
:"%ebx");
:"=a" (regs[0]), "=b" (regs[1]), "=c" (regs[2]), "=d" (regs[3])
:"a" (cpuid_leaf), "c" (ecxval));
#endif
}
void __cpuid(int regs[4], int cpuid_leaf)