From 28aababf21d3f5897585b317ee94d05ff63c7570 Mon Sep 17 00:00:00 2001 From: Allan Shortlidge Date: Fri, 30 Aug 2024 18:12:53 -0700 Subject: [PATCH] build-script: Copy libclang_rt.a from the host toolchain for visionOS. During the toolchain build, when building the Swift standard library for platforms other than macOS the `libclang_rt.a` needs to be copied out of the host SDK. That wasn't happening for visionOS. Resolves rdar://135023111. --- stdlib/public/core/Availability.swift | 2 +- utils/swift_build_support/swift_build_support/products/llvm.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/public/core/Availability.swift b/stdlib/public/core/Availability.swift index d09eefde18d3f..c3ec893b577cf 100644 --- a/stdlib/public/core/Availability.swift +++ b/stdlib/public/core/Availability.swift @@ -37,7 +37,7 @@ import SwiftShims /// interpreter doesn't currently know how to load symbols from compiler-rt. /// Since `@_transparent` is only necessary for iOS apps, we only apply it on /// iOS, not any other which would inherit/remap iOS availability. -#if os(iOS) && !os(xrOS) +#if os(iOS) && !os(visionOS) @_effects(readnone) @_transparent public func _stdlib_isOSVersionAtLeast( diff --git a/utils/swift_build_support/swift_build_support/products/llvm.py b/utils/swift_build_support/swift_build_support/products/llvm.py index 96fae8e124c51..cdc656b49155e 100644 --- a/utils/swift_build_support/swift_build_support/products/llvm.py +++ b/utils/swift_build_support/swift_build_support/products/llvm.py @@ -134,7 +134,7 @@ def copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain( ' into the local clang build directory {}.'.format( host_cxx_builtins_dir, dest_builtins_dir)) - for _os in ['ios', 'watchos', 'tvos']: + for _os in ['ios', 'watchos', 'tvos', 'xros']: # Copy over the device .a when necessary lib_name = 'libclang_rt.{}.a'.format(_os) host_lib_path = os.path.join(host_cxx_builtins_dir, lib_name)