On Tue, 1 Sep 2026, Zhongteng Gui wrote:

I think the best choice is to use "-Wl,--start-group" and "-Wl,--end-group", but I'm not sure whether it fits for different compilers, and whether it will causes compatiablity issues regarding different ld.

Yes, I also think some form of --start-group around the libraries would be ideal, this would avoid many issues with circular dependencies between the libraries.

This is not an issue when using LLD, since LLD implicitly looks for symbols in earlier static libraries as well (like MS link.exe does) - essentially as if all libraries had been enclosed in --start-group --end-group.

Exactly which libraries should belong to the group is hard to say; I'd say at least the CRT library, mingw32+mingwex, and maybe also the main system libraries (kernel32, which may be substituted with windowsapp for UWP target). If using winstorecompat or similar shims, they should also ideally be included in the same group, as they can reference other CRT functions.

Even if we change how the compilers link things, it will take a long time before we can rely on it in mingw-w64. But on the other hand, the sooner we make such a change, the sooner we can consider relying on it.

// Martin



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to