<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/120278>120278</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Sanitizer common_interface_defs not actually common to all sanitizers
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          tavianator
      </td>
    </tr>
</table>

<pre>
    `<sanitizer/msan_interface.h>` includes `<sanitizer/common_interface_defs.h>`, so I assumed that those functions would be available under MSan as well as ASan.  But it seems not to be the case:

```console
$ cat foo.c
#include <sanitizer/msan_interface.h>
#include <stdlib.h>

int main(void) {
 char *buf = malloc(1024);
 __sanitizer_annotate_contiguous_container(buf, buf + 1024, buf + 512, buf + 1024);
        return 0;
}
$ clang -fsanitize=memory foo.c
/usr/bin/ld: /tmp/foo-072909.o: in function `main':
foo.c:(.text+0x171): undefined reference to `__sanitizer_annotate_contiguous_container'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ clang --version
clang version 18.1.8
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVMtu6zYQ_Rp6M7BAUrIlLbRQrmvgLrpK98aIGllsKdLgw3H69QVlO0mRLnoFAnzM-8zRYAj6bIk6tnthu8MGU5yd7yJeNVqMzm8GN753bM9Z-SOg1VH_TZ7J4xLQnrSN5CdUVMys_I3tOWirTBopwHcL5ZbFfbE5jTSFpyGTPyA4-AkYQlpohDhjhDi7QDAlq6J2NsCbS2aEgQCvqA0OhiDZkTz8_ooWMMAbGZP3_hVtAfCSIugIgWgJYF2E6LJ1nAkUBmJlz_i69vy-lLPBGcpPsgKFESbnCrXey0dt8D-Q-KYfR6OHDxnvtY2woLZMNlenRyZbYPUL4z2oGT0w2Q9pAlYeYEFjnGKyEVxWTLasXNVOp48cTmitixjppJyN-pxcCusRtc0ZNkOaMr6rR_kCd0ef952Q38XPOI_PU0zeAr-_svrwhMigPcN2eibDysNCi_PvX4A7ppBxGnK1RzOysgcmj3G5MHmcnNvyWra8LVwWaPvR7kyhO0T1vVF3j2XPZFNEukUmX_hN1GJNtl-ZMGlLI3iayJNVlPvN9vwXsKoZ79easkfy3vl8MNr-RR4yg9GOMKE2NMKbjjPQTUdQbiQQwGSTAsH2muMGItD26hTmYnKO_0JseyUfsuARDx53EE0hiobx_g_0Z4o5_K3Zn_bV9qK2Rtt0255tyvLZE46wuJFM1rq4oG-M9z9tiGgMjQftH1h_NuAL1zdjV45t2eKGOlGXVbVrhag3c8elGJq9KAfCimNZt6qpRYvNfk9qV4lmozvJZSWkqEUjxK4uxh3nXOywHaTi1TCwitOC2hTGXJfC-fNGh5CoE5LLutkYHMiEdeRIaekNVimTMk8g32Wj7ZDOgVXc6BDDp5uoo6Hu9dlN-M-Zsv7pqGJCY94fKrkjaAx8ECFskjfdHOMlrJQ6Mnk86zinoVBuyUQ11-e2vXj3J6nI5HHNNDB5fJRy7eQ_AQAA__-WYa2I">