[libcxx-commits] [libcxxabi] [libc++abi] Always enable -fvisibility=hidden (PR #207333)
Martin Storsjö via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jul 7 01:20:46 PDT 2026
mstorsjo wrote:
This change broke building for Windows (or at least mingw) if Clang is built with asserts enabled: https://github.com/mstorsjo/llvm-mingw/actions/runs/28837278474/job/85523635822
(Unfortunately for this case, the libcxx CI doesn't run with an asserts enabled Clang - although that would be a fair bit slower.)
Building with an asserts enabled Clang produces errors like this:
```
dllexport GlobalValue must have default or protected visibility
ptr @_ZTIv
[repeated for dozens of symbols]
fatal error: error in backend: Broken module found, compilation aborted!
```
So for symbols that are marked dllexport, you can't have hidden visibility. For the same set of symbols, you'd either have dllexport vs no-dllexport, or hidden vs default visibility. Intermixing the two probably doesn't give reasonable results, and specifically a symbol marked both dllexport and hidden is tautological.
Can we revert this for now? I think it would be safe to reland with the `target_add_compile_flags_if_supported()` enclosed in `if (NOT WIN32)`. (Or if you prefer I can try to post a patch to just add such conditions.)
https://github.com/llvm/llvm-project/pull/207333
More information about the libcxx-commits
mailing list