Skip to content

Commit 53e4e19

Browse files
committed
build: add a workaround for ARM64 Windows
MSVC 17.6p3 introduced new ARM64 intrinsics for atomic (load-acquire/store-release) operations. Since clang does not support this yet, force the fallback path to temporarily unblock the build while we implement support for the `__stlr[8|16|32|64]` intrinsics in clang. See: llvm/llvm-project#62103
1 parent 3676379 commit 53e4e19

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ function(_add_host_variant_c_compile_flags target)
259259
# (see revision d913eefcc93f8c80d6d1a6de4ea898a2838d8b6f)
260260
# This is required to build with VS2017 15.8+
261261
_ENABLE_EXTENDED_ALIGNED_STORAGE=1>)
262+
if(SWIFT_HOST_VARIANT_ARCH MATCHES "ARM64|aarch64")
263+
target_compile_options(${target} PRIVATE
264+
$<$<COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX>:-D_STD_ATOMIC_USE_ARM64_LDAR_STLR=0>)
265+
endif()
262266

263267
# msvcprt's std::function requires RTTI, but we do not want RTTI data.
264268
# Emulate /GR-.

0 commit comments

Comments
 (0)