[CMAKE] Explicitly target Pentium for clang. CORE-17202

The MSVC-compatible /arch:IA32 option switches to i386 mode, which
makes clang avoid 486/Pentium-specific instructions, e.g. cmpxchg8b.
This commit is contained in:
Thomas Faber 2020-08-15 21:41:32 +02:00
parent 8275c1f991
commit a81788e5bf
No known key found for this signature in database
GPG key ID: 076E7C3D44720826

View file

@ -51,7 +51,12 @@ endif()
# HACK: for VS 11+ we need to explicitly disable SSE, which is off by
# default for older compilers. See CORE-6507
if(ARCH STREQUAL "i386")
add_compile_flags("/arch:IA32")
# Clang's IA32 means i386, which doesn't have cmpxchg8b
if(USE_CLANG_CL)
add_compile_flags("-march=${OARCH}")
else()
add_compile_flags("/arch:IA32")
endif()
endif()
# VS 12+ requires /FS when used in parallel compilations