mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 14:51:46 +00:00
Fix LZMA compilation on GCC with position-independent code (PIC) generation enabled
EBX register is used Global Offset Table in PIC http://www.greyhat.ch/lab/downloads/pic.html
This commit is contained in:
parent
bdddea541f
commit
0be30c782c
1 changed files with 16 additions and 0 deletions
|
@ -70,8 +70,24 @@ static void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)
|
||||||
*c = c2;
|
*c = c2;
|
||||||
*d = d2;
|
*d = d2;
|
||||||
|
|
||||||
|
#elif __PIC__
|
||||||
|
|
||||||
|
/* GCC or Clang WITH position-independent code generation */
|
||||||
|
|
||||||
|
__asm__ __volatile__ (
|
||||||
|
"xchgl %%ebx, %1\n"
|
||||||
|
"cpuid\n"
|
||||||
|
"xchgl %%ebx, %1\n"
|
||||||
|
: "=a" (*a) ,
|
||||||
|
"=r" (*b) ,
|
||||||
|
"=c" (*c) ,
|
||||||
|
"=d" (*d)
|
||||||
|
: "0" (function)) ;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
/* GCC or Clang WITHOUT position-independent code generation */
|
||||||
|
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"cpuid"
|
"cpuid"
|
||||||
: "=a" (*a) ,
|
: "=a" (*a) ,
|
||||||
|
|
Loading…
Reference in a new issue