[libcxx-commits] [libcxx] [libc++] Introduce a new attribute keyword for Clang improves compatibility with Mingw-GCC (PR #141040)
Martin Storsjö via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jun 11 03:51:48 PDT 2025
mstorsjo wrote:
> 6\. Modify Clang more to inherit dllexport to inner-type and export it
> I guess this option works without any breakage of existing binaries but introduce a new incompatibility with MinGW-GCC.
> Additionally, same as 3., MinGW-GCC will be left incompatible with libc++.
I don't see how this would leave GCC incompatible with libc++. If you build the libc++ DLL with Clang, it would dllexport the necessary inner classes. When building user code with GCC, it does not instantiate the inner classes, and it would be able to link them from the libc++ DLL, right? The only issue would be if you'd try to build the libc++ DLL with GCC, where it wouldn't have sufficient dllexports (linking with `-Wl,--export-all-symbols` would help though).
https://github.com/llvm/llvm-project/pull/141040
More information about the libcxx-commits
mailing list