[libcxx-commits] [libcxx] [libc++] Introduce ABI sensitive areas to avoid requiring _LIBCPP_HIDE_FROM_ABI everywhere (PR #131156)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 13 09:19:46 PDT 2025


https://github.com/ldionne commented:

This is an interesting patch but I think it would be important to tackle the GCC/visibility situation first to simplify things. Per our conversation just now, I would suggest this:

We drop all visibility/ODR guarantees on GCC and always make everything `default vis`. That's what libstdc++ does IIRC, so GCC users should be used to controlling the symbols they export themselves when they need to. This would allow us to get rid of `_LIBCPP_TEMPLATE_VIS` and `_LIBCPP_ALWAYS_INLINE` on GCC, which would also greatly improve our QOI on GCC for e.g. `<format>` and other things that are just broken right now.

Once that's done, the next step could be to use explicit function lists for all the class template instantiation declarations we have in the headers (like `ofstream`). And we keep the class template instantiation declaration itself only on Clang to control the vtable's visibility (until we have a syntax to do that more specifically).

Those steps are worth doing in themselves. And once that's done, I think the conversation here will be a lot simpler to have.

https://github.com/llvm/llvm-project/pull/131156


More information about the libcxx-commits mailing list