Skip to content

Commit 0cd0a36

Browse files
committed
Try to fix the ASAN build
We want to use the 'just built' compiler for the runtime tests because of the recently added `swiftasync` parameter support. But ASAN won't link if we use the 'just built' compiler because libgtest and LLVMSupport are compiled by the host compiler. Disable the runtime test when running under ASAN. rdar://73664504
1 parent 50032a6 commit 0cd0a36

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

unittests/runtime/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
# We can't currently build the runtime tests under ASAN
2+
# The problem is that we want to use the just-build compiler (just like the
3+
# runtime) but ASAN will complain if we link against libgtest and LLVMSupport
4+
# libraries because they were compiled with the host compiler.
15
if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
2-
("${SWIFT_HOST_VARIANT_ARCH}" STREQUAL "${SWIFT_PRIMARY_VARIANT_ARCH}"))
6+
("${SWIFT_HOST_VARIANT_ARCH}" STREQUAL "${SWIFT_PRIMARY_VARIANT_ARCH}") AND
7+
(NOT (LLVM_USE_SANITIZER STREQUAL "Address")))
38

49
if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
510
if(NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER)

0 commit comments

Comments
 (0)