File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -265,29 +265,14 @@ function(_add_target_variant_c_compile_flags)
265265 # uses a spin lock for this, so to get reasonable behavior we have to
266266 # implement it ourselves using _InterlockedCompareExchange128.
267267 # clang-cl requires us to enable the `cx16` feature to use this intrinsic.
268- if (SWIFT_HOST_VARIANT_ARCH STREQUAL x86_64)
268+ if (CFLAGS_ARCH STREQUAL x86_64)
269269 if (SWIFT_COMPILER_IS_MSVC_LIKE)
270270 list (APPEND result /clang:-mcx16)
271271 else ()
272272 list (APPEND result -mcx16)
273273 endif ()
274274 endif ()
275275
276- if (${CFLAGS_SDK} STREQUAL ANDROID)
277- if (${CFLAGS_ARCH} STREQUAL x86_64)
278- # NOTE(compnerd) Android NDK 21 or lower will generate library calls to
279- # `__sync_val_compare_and_swap_16` rather than lowering to the CPU's
280- # `cmpxchg16b` instruction as the `cx16` feature is disabled due to a bug
281- # in Clang. This is being fixed in the current master Clang and will
282- # hopefully make it into Clang 9.0. In the mean time, workaround this in
283- # the build.
284- if (CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_VERSION
285- VERSION_LESS 9.0.0)
286- list (APPEND result -mcx16)
287- endif ()
288- endif ()
289- endif ()
290-
291276 if (CFLAGS_ENABLE_ASSERTIONS)
292277 list (APPEND result "-UNDEBUG" )
293278 else ()
You can’t perform that action at this time.
0 commit comments