1
0
forked from 0ad/0ad
0ad/source/lib/sysdep
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
..
arch Fix cpuid call with -fPIC on i386 architectures. 2021-05-09 12:41:45 +00:00
os Reduces number of allocations during error message formatting. 2021-04-22 06:53:03 +00:00
rtl 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
tests 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
arch.h Enable support for powerpc64 systems. New problems with NVTT will be addressed in another diff. 2021-03-03 15:13:47 +00:00
compiler.h Add initial support for MCST Elbrus 2000 (e2k) CPU architecture 2020-12-31 15:52:12 +00:00
cpu.cpp 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
cpu.h 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
dir_watch.h Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
filesystem.h 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
gfx.cpp Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
gfx.h Remove obsolete GetVideoMode platform-specifics, replaces by platform-agnostic SDL2`s APIs. 2020-06-08 17:49:26 +00:00
numa.h 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
os_cpu.cpp 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
os_cpu.h 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
os.h 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
rtl.h 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
smbios.cpp Further header & precompiled cleanup, fix no-PCH builds. 2020-12-09 14:39:14 +00:00
smbios.h Fix compiler warnings on VS 2015, refs #3439, refs #5069. 2018-03-10 09:58:53 +00:00
stl.h Clean up header includes, add new forward declarations. 2020-11-21 11:20:29 +00:00
sysdep.h Remove not needed checks and code for VS2015 [VS2013 -> VS2015] 2020-01-19 12:43:41 +00:00
vm.h Remove UniqueRange custom code in favour of unique_ptr 2020-11-22 13:43:19 +00:00