0ad/source/lib/sysdep/arch
wraitii abb124a36f Fix cpuid call with -fPIC on i386 architectures.
GCC < 5 used to reserve the ebx register for PIC (position-independent
code) metadata. This meant that we needed to save the state of ebx
before calling cpuid (fixed in #2675)
However, the original patch from 03eaf9b461 did not force a particular
register to store this value in. Following the GCC 5 upgrade, GCC
stopped reserving ebx, and that register silently got used instead. The
code became non-sensical, and our ASM __cpuidex started returning random
garbage in edx.

Since we now only support GCC7 and above, the PIC-specific branch is no
longer necessary and is removed.

Fixes #6028. The assertion was a result of random data in ebx.
Refs #2675 / reverts 6334ee3f8b and reverts 03eaf9b461.

Patch by: nwtour
Comments by: vladislavbelov
Differential Revision: https://code.wildfiregames.com/D3575
This was SVN commit r25405.
2021-05-09 12:41:45 +00:00
..
aarch64 Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
amd64 Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
arm Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
e2k Add initial support for MCST Elbrus 2000 (e2k) CPU architecture 2020-12-31 15:52:12 +00:00
ia32 Make all Wildfire Games copyright headers consistent by always ending with a period and using (C) instead of (c). 2017-07-10 14:26:24 +00:00
ppc64 Add missing file in previous commit. 2021-03-03 15:18:44 +00:00
x86_x64 Fix cpuid call with -fPIC on i386 architectures. 2021-05-09 12:41:45 +00:00