[libc++] Encode additional ODR-affecting properties in the ABI tag (#69669)
authorLouis Dionne <ldionne.2@gmail.com>
Thu, 26 Oct 2023 13:05:16 +0000 (09:05 -0400)
committerTobias Hieta <tobias@hieta.se>
Mon, 30 Oct 2023 09:17:40 +0000 (10:17 +0100)
commit8909a24d0af1892ec1f5b7d78d844e639a3c9400
tree7161943ce6ea76929865705c52c604453a9eeb90
parente9dcc15f514a96a71c2ebab7831ec2a2d942c808
[libc++] Encode additional ODR-affecting properties in the ABI tag (#69669)

As explained in `__config`, we have an ABI tag that we use to ensure
that we don't run into ODR issues when mixing different versions of
libc++ in multiple TUs. However, the reasoning behind that extends not
only to different versions of libc++, but also to different
configurations of the same version of libc++. In fact, we've been aware
of this for a while but never really bothered to make the change because
ODR issues are often thought to be benign.

Well, it turns out that I just spent over an hour banging my head
against an issue that boils down to our lack of encoding of some ODR
properties in the ABI tag, so here's the patch we should have done a
long time ago.

For now, the ODR properties we encode in the ABI tag are:
- library version
- exceptions vs no-exceptions
- hardening mode

Those are all things that we support different values for on a per-TU
basis and they definitely affect ODR in a meaningful way. We can add
more properties later as we see fit.

(cherry picked from commit bc792a284362696c91599f9ab01f74eda4b9108f)
libcxx/include/__config
libcxx/test/libcxx/odr_signature.exceptions.sh.cpp [new file with mode: 0644]
libcxx/test/libcxx/odr_signature.hardening.sh.cpp [new file with mode: 0644]