Open bwhiteley opened 6 months ago
@shahmishal, in case you are interested. It also happens in macOS ASAN, from what I was able to test.
@bwhiteley try to change the value of COMPILER_RT_ENABLE_IOS
to TRUE
in the files utils/swift_build_support/swift_build_support/products/cmake_product.py
and utils/build-script-impl
.
@pudge62 the problem was also happening when building for macOS, which I imagine COMPILER_RT_ENABLE_IOS
would not help. In any case, I tried and I got the same results as before. Xcode 16 changed the error to "Unable to copy Address Sanitizer library: Could not determine where it lives." but still the same results.
@drodriguez In my case, the toolchain can build tsan for macos, but not work for ios simulator. These sanitizer libraries are at xxx.xctoolchain/usr/lib/clang/xxx/lib/darwin
, you can check if libclang_rt.asan_xxx_dynamic.dylib
exists.
The files exist, and trying to use them with the right command line flags works correctly in our tests. The only thing that doesn't seem to collaborate is the checkmark in the scheme editor in Xcode. It is probably checking for the existence of the file somehow, but for some reason it doesn't find it where the open source toolchains leave it.
Description
If I install a toolchain from Swift.org and enable Address Sanitizer for an iOS scheme, Xcode quickly fails the build with
If I use the Xcode default toolchain, it will work.
What does the Swift.org toolchain need to make it compatible with Xcode + asan? Is there a workaround for this?
Reproduction
You'll need an iOS project with Xcode.
Download and install a toolchain from https://www.swift.org/download/ . For example, swift-5.10-RELEASE for Xcode 15.3.
Select the Swift.org toolchain in Xcode: Xcode -> Toolchains -> Swift 5.10 Release ...
Enable Address Sanitizer in the build scheme.
Build The build will quickly fail with
Expected behavior
The build should work with asan support.
Environment
Xcode 15.3 with the toolchain downloaded from https://download.swift.org/swift-5.10-release/xcode/swift-5.10-RELEASE/swift-5.10-RELEASE-osx.pkg
Additional information
No response