Skip to content

Commit c94da3b

Browse files
committed
[CMake] Set -DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1 for runtime/overlays
Whenever we're building C++ code as part of the Swift runtime or overlays, disable the ABI-breaking checks. We are only using header content from LLVM's ADT library. Fixes rdar://problem/48618250.
1 parent b6517c5 commit c94da3b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,15 @@ function(_add_swift_library_single target name)
12091209
"${SWIFTLIB_SINGLE_FORCE_BUILD_OPTIMIZED_keyword}"
12101210
RESULT_VAR_NAME c_compile_flags
12111211
)
1212+
1213+
if(SWIFTLIB_IS_STDLIB)
1214+
# We don't ever want to link against the ABI-breakage checking symbols
1215+
# in the standard library, runtime, or overlays because they only rely
1216+
# on the header parts of LLVM's ADT.
1217+
list(APPEND c_compile_flags
1218+
"-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1")
1219+
endif()
1220+
12121221
if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS)
12131222
if(libkind STREQUAL SHARED)
12141223
list(APPEND c_compile_flags -D_WINDLL)

0 commit comments

Comments
 (0)