Skip to content

Commit cc27fd0

Browse files
committed
Core: check for -mcx16 flag
The Swift runtime requires the CMPXCHG16B ISA extension on x86. This is controlled by the `-mcx16` flag when targeting the CPU baseline that we use. Add a check and pass along the flag to repair the build.
1 parent 215db61 commit cc27fd0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Runtimes/Core/cmake/modules/CompilerSettings.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,8 @@ HAVE_SWIFT_ASYNC_CALL)
4444
if(NOT HAVE_SWIFT_ASYNC_CALL)
4545
message(SEND_ERROR "CXX Compiler must support Swift async calling conventions")
4646
endif()
47+
48+
check_compiler_flag(CXX "-mcx16" HAVE_CXX_MCX16)
49+
if(HAVE_CXX_MCX16)
50+
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-mcx16>)
51+
endif()

0 commit comments

Comments
 (0)