Add warning about missing but required CPU features

Useful to debug why you're getting SIGILL, like running under Valgrind:

Processor features:  sse3[required] sse2[required] ssse3[required] fma
cmpxchg16b sse4.1[required] sse4.2[required] movbe popcnt[required]
aes[required] avx[required] f16c[required] bmi[required] avx2[required]
bmi2[required]
!!!!!!!!!!!!!!!!!!!!
!!! Missing required features: rdrand rdseed
!!! Applications will likely crash with "Invalid Instruction"
!!!!!!!!!!!!!!!!!!!!

Change-Id: Ia3e896da908f42939148fffd14c556557419b091
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This commit is contained in:
Thiago Macieira 2017-06-05 14:16:16 -07:00
parent 79a77f7def
commit efd9016ea1

View File

@ -721,6 +721,14 @@ void qDumpCPUFeatures()
printf("%s%s", features_string + features_indices[i],
minFeature & (Q_UINT64_C(1) << i) ? "[required]" : "");
}
if ((features = (qCompilerCpuFeatures & ~features))) {
printf("\n!!!!!!!!!!!!!!!!!!!!\n!!! Missing required features:");
for (int i = 0; i < features_count; ++i) {
if (features & (Q_UINT64_C(1) << i))
printf("%s", features_string + features_indices[i]);
}
printf("\n!!! Applications will likely crash with \"Invalid Instruction\"\n!!!!!!!!!!!!!!!!!!!!");
}
puts("");
}