qsimd: don't enforce shstk (CET) feature on launch

Clang with -march=tigerlake or -march=sapphirerapids pre-defines
__SHSTK__, which QtCore require the feature, even if the OS does not
have support for it. That's of no consequence because the compiler does
not generate shadow stack operations on its own.

Change-Id: Id0fb9ab0089845ee8843fffd16fa1ad910f008b8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit d531c4b65dc47312256f9de2786a852f6ac4c1f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2022-06-19 12:02:12 -07:00 committed by Qt Cherry-pick Bot
parent d4a0781cd6
commit f298d347f5

View File

@ -564,6 +564,12 @@ uint64_t QT_MANGLE_NAMESPACE(qDetectCpuFeatures)()
// Yocto hard-codes CRC32+AES on. Since they are unlikely to be used
// automatically by compilers, we can just add runtime check.
minFeatureTest &= ~(CpuFeatureAES|CpuFeatureCRC32);
#endif
#if defined(Q_PROCESSOR_X86_64) && defined(cpu_feature_shstk)
// Controlflow Enforcement Technology (CET) is an OS-assisted
// hardware-feature, meaning the CPUID bit may be disabled if the OS
// doesn't support it, but that's ok.
minFeatureTest &= ~CpuFeatureSHSTK;
#endif
QCpuFeatureType f = detectProcessorFeatures();