https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a81788e5bfb95e2db2281…
commit a81788e5bfb95e2db22812c268f35a6de59b793f
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sat Aug 15 21:41:32 2020 +0200
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sun Aug 23 12:07:37 2020 +0200
[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.
---
sdk/cmake/msvc.cmake | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sdk/cmake/msvc.cmake b/sdk/cmake/msvc.cmake
index 0039d71e9de..94847a84167 100644
--- a/sdk/cmake/msvc.cmake
+++ b/sdk/cmake/msvc.cmake
@@ -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