Skip to content

Commit 0f62129

Browse files
committed
win32: skip some CPU detection on Windows with MinGW like amd64 MSVC
The only known working implementation is for i686 MSVC. - detection was already disabled and marked at not working with amd64 MSVC, - detection was already disabled on amd64 MinGW because amd64 Windows was tested, not just amd64 MSVC, - there is no MinGW implementation in the code, - this disables detection on MinGW explicitely whatever the architecture.
1 parent 7c7dadf commit 0f62129

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • src/trusted/platform_qualify/arch/x86

src/trusted/platform_qualify/arch/x86/vcpuid.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ const int kMagicConst_ROUNDSS = 0xc0000000;
3838
const int kMagicConst_POPCNT = 13;
3939
const int kMagicConst_CRC32 = 0xb906c3ea;
4040

41-
#if !(NACL_WINDOWS && (NACL_BUILD_SUBARCH == 64))
41+
#if (NACL_WINDOWS && defined(_MSC_VER) && (NACL_BUILD_SUBARCH == 64))
42+
# define NACL_WINDOWS_MSC_64
43+
#endif
44+
45+
#if (NACL_WINDOWS && !defined(_MSC_VER))
46+
# define NACL_WINDOWS_MINGW
47+
#endif
48+
49+
#if !defined(NACL_WINDOWS_MSC_64) && !defined(NACL_WINDOWS_MINGW)
4250
static int asm_HasMMX(void) {
4351
volatile int before, after;
4452
before = kMagicConst;
@@ -386,7 +394,7 @@ static int asm_HasCX8(void) {
386394
#endif /* 0 */
387395
#endif /* 64-bit Windows */
388396

389-
#if NACL_WINDOWS && (NACL_BUILD_SUBARCH == 64)
397+
#if defined(NACL_WINDOWS_MSC_64) || defined(NACL_WINDOWS_MINGW)
390398
static int CheckCPUFeatureDetection(NaClCPUFeaturesX86 *cpuf) {
391399
/* Unfortunately the asm_ tests will not work on 64-bit Windows */
392400
return 0;

0 commit comments

Comments
 (0)