# Add check to verify libc\+\+ is shared by LLVM/Clang · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/b0525344a2b0b158369251c031159bef241048da)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: b0525344a2b0b158369251c031159bef241048da

Requested commit: b0525344a2b0b158369251c031159bef241048da

Commit: b0525344a2b0b158369251c031159bef241048da

Tree: ff088aec78d7471d1d2f6c92ee5a05ec9f2439fb

Author: Cody Tapscott

Committer: Cody Tapscott

## Message

```
Add check to verify libc++ is shared by LLVM/Clang

This check is needed because if static/dynamic linking is mixed incorrectly,
it's possible for Clang and LLVM to end up with duplicate "copies" of libc++.

This is not benign: Static variables are not shared, so equality comparisons
that depend on pointers to static variables will fail. One such failure is
std::generic_category(), which causes POSIX error codes to compare as unequal
when passed between LLVM and Clang.

I believe this is the cause of https://github.com/ziglang/zig/issues/11168

In order to avoid affecting build times when Zig is repeatedly invoked,
we only enable this check for "zig env" and "zig version"

```

## Parents

- [0fc79d602bf9b3a5c97cfc28b59193b005692cb2](https://git.cafe/gitcafe/zig/commit/0fc79d602bf9b3a5c97cfc28b59193b005692cb2?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/b0525344a2b0b158369251c031159bef241048da?format=markdown)
