Skip to content

Commit

Permalink
build: add a workaround for ARM64 Windows
Browse files Browse the repository at this point in the history
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
  • Loading branch information
compnerd committed Jun 22, 2023
1 parent 3676379 commit 53e4e19
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ function(_add_host_variant_c_compile_flags target)
# (see revision d913eefcc93f8c80d6d1a6de4ea898a2838d8b6f)
# This is required to build with VS2017 15.8+
_ENABLE_EXTENDED_ALIGNED_STORAGE=1>)
if(SWIFT_HOST_VARIANT_ARCH MATCHES "ARM64|aarch64")
target_compile_options(${target} PRIVATE
$<$<COMPILE_LANGUAGE:C,CXX,OBJC,OBJCXX>:-D_STD_ATOMIC_USE_ARM64_LDAR_STLR=0>)
endif()

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

0 comments on commit 53e4e19

Please sign in to comment.