From ea1b22232f88a2b996f1bf4d09beaa9fe5a821ea Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Wed, 1 Feb 2017 15:56:47 -0800 Subject: [PATCH] Disable LLVM ABI breaking checks by default when building swift The LLVM ABI breaking checks require that all uses of llvm's ADT library must also link libSupport. Parts of the Swift standard library use ADT without Support intentionally. To make this work we must disable the ABI breaking checks when building swift. This patch changes the default value of the option that controls the ABI breaking checks to disable the checks by default if the swift source directory is present in the LLVM build tree. --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24323e0a492..2807dd64c09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -414,8 +414,13 @@ option(LLVM_ENABLE_EXPENSIVE_CHECKS "Enable expensive checks" OFF) set(LLVM_ABI_BREAKING_CHECKS "WITH_ASSERTS" CACHE STRING "Enable abi-breaking checks. Can be WITH_ASSERTS, FORCE_ON or FORCE_OFF.") +set(default_LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING OFF) +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tools/swift) + set(default_LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING ON) +endif() option(LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING - "Disable abi-breaking checks mismatch detection at link-tim." OFF) + "Disable abi-breaking checks mismatch detection at link-tim." + ${default_LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING}) option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN "Set to ON to force using an old, unsupported host toolchain." OFF)