This is an archive of the discontinued LLVM Phabricator instance.

Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch
ClosedPublic

Authored by mehdi_amini on Nov 18 2016, 4:21 PM.

Details

Summary

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 include 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.

Diff Detail

Repository
rL LLVM

Event Timeline

mehdi_amini retitled this revision from to Add link-time detection of LLVM_ABI_BREAKING_CHECKS mismatch.
mehdi_amini updated this object.
mehdi_amini added reviewers: jroelofs, rnk.
mehdi_amini added a subscriber: llvm-commits.
tfiala added a subscriber: tfiala.Nov 18 2016, 6:42 PM

Thanks for working up the alternate solution, Mehdi!

rnk accepted this revision.Nov 21 2016, 10:48 AM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.Nov 21 2016, 10:48 AM
This revision was automatically updated to reflect the committed changes.