On Sunday 30 August 2026 17:14:32 Zhongteng Gui wrote: > On 2026/08/30 15:44, Pali Rohár wrote: > > On Sunday 30 August 2026 03:24:26 Kirill Makurin wrote: > >> Zhongteng Gui <[email protected]> wrote: > >> > >>> Hi, I found that many libraries provided by mingw-w64-crt are actually > >>> empty, > >>> for example, libmingwthrd and libmoldname. Unfortunately, they're still > >>> hardcoded in GCC's default specs, so I'd like to first remove them from > >>> there, > >>> then maybe in the future we can remove them from mingw-w64. > >> > >> These empty libraries are kept exactly to avoid breaking older gcc/clang > >> versions, as they hardcode them. > > > > Exactly. Those libraries need to stay here to make sure that older gcc > > versions will work. > > Fine, I understand these libraries cannot be removed from mingw-w64 for a long > time, I just want to be sure they're useless now, so I can remove them from > new > GCC's specs.
Note that gcc spec is a template for cygwin, mingw32 and mingw-w64 targets. So beware to not break remaining two targets, this needs to be mingw-w64 specific change. > I've submitted a slightly modified patch at > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127135 > > > > >> We also had briefly discussed an idea to move contents of libmingwex.a > >> directly into import libraries (e.g. libucrt.a). The interaction between > >> libmingwex.a and import libraries sometimes causes linker errors, e.g. > >> when LTO is involved and import library references symbol from > >> libmingwex.a or vice versa. If we did this, we would have to similarly > >> make libmingwex.a empty so that older gcc/clang versions continue to work. > > > > I like this idea. But I'm still not sure if this would not cause other > > issues. > > > > What I know is that there is still one problem that some symbols are > > duplicated in libmingwex.a and in individual CRT DLL import libs. I have > > tried to clean it up, but as I have figured out few days ago I found new > > such symbols (e.g. _Exit). > > I think this is a good idea. Currently every libraries (mingw32, mingwex, > msvcrt, etc.) are linked twice to solve circular dependencies in GCC > (implicit) > and Clang (explicit). If we finished this in the future maybe we could remove > the duplicate linking from newer GCC and Clang. > > > > >> Pali (CC'd) may also have something to say about it. > >> > >> - Kirill Makurin > _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
