mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch
Summary: LLVM will define a symbol, either EnableABIBreakingChecks or DisableABIBreakingChecks depending on the configuration setting for LLVM_ABI_BREAKING_CHECKS. The llvm-config.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. Reviewers: rnk, jroelofs Subscribers: llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D26841 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287352 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -112,3 +112,19 @@ void report_fatal_error(Error Err, bool GenCrashDiag) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifndef _MSC_VER
|
||||
namespace llvm {
|
||||
|
||||
// One of these two variables will be referenced by a symbol defined in
|
||||
// llvm-config.h. We provide a link-time (or load time for DSO) failure when
|
||||
// there is a mismatch in the build configuration of the API client and LLVM.
|
||||
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
|
||||
int EnableABIBreakingChecks;
|
||||
#else
|
||||
int DisableABIBreakingChecks;
|
||||
#endif
|
||||
|
||||
} // end namespace llvm
|
||||
#endif
|
||||
Reference in New Issue
Block a user