From 7b6b980178ddf686d1cceb37124b139828108808 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Mon, 28 Nov 2016 22:23:53 +0000 Subject: Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch The macro LLVM_ENABLE_ABI_BREAKING_CHECKS is moved to a new header abi-breaking.h, from llvm-config.h. Only headers that are using the macro are including this new header. LLVM will define a symbol, either EnableABIBreakingChecks or DisableABIBreakingChecks depending on the configuration setting for LLVM_ABI_BREAKING_CHECKS. The abi-breaking.h header will add weak references to these symbols in every clients that includes this header. This should ensure that a mismatch triggers a link failure (or a load time failure for DSO). On MSVC, the pragma "detect_mismatch" is used instead. Differential Revision: https://reviews.llvm.org/D26876 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288082 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index d90baefeb9e..82e0c5c8573 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -714,6 +714,9 @@ configure_file( configure_file( ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/llvm-config.h.cmake ${LLVM_INCLUDE_DIR}/llvm/Config/llvm-config.h) +configure_file( + ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/abi-breaking.h.cmake + ${LLVM_INCLUDE_DIR}/llvm/Config/abi-breaking.h) configure_file( ${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/DataTypes.h.cmake ${LLVM_INCLUDE_DIR}/llvm/Support/DataTypes.h) -- cgit v1.2.3