On Mon, 29 Dec 2025, Pali Rohár wrote:
The problem is that symbol cannot be in two of those def files as both
def files are "merged" into one import library.
Well it's not really that they _cannot_ be in both of them; it can just
fine be in both. But then it's not clear which one is chosen.
And then linker randomly chose one.
Saying that it is random sounds a bit surprising - it's probably
deterministic (possibly the one added first or the one added last), but
the exact rule for which one is chosen might not be obvious.
Anyway, for this matter - I would vote -1 for this patch:
While it's nice to be able to target XP, I don't see the reason for why
anybody would be linking against api-ms-win-core-*.dll while targeting XP.
You usually don't link directly against them with -lapi-ms-win-..., but
you link against it when linking against an umbrella library like
libwindowsapp.a, libmincore.a, libonecore.a etc. And I don't think anybody
expects to link against e.g. libonecore.a and still execute on XP.
We did spend some effort to sync our imports between the api-ms-win-*
import libraries and the WinSDK versions of the umbrella libraries
(onecore, windowsapp etc) - and if we change this, we increase the
discrepancy instead of decrease it.
For some specific cases where we really want to have different sets of
imports from one API set library between different umbrella libraries,
then we need to split the .def file into separate copies for each umbrella
lib; we have that for a number of libraries with a "_windowsapp.def"
suffix.
Although: In most cases, as far as I know, it's fine to import symbols
from an older version of the API set, even though the WinSDK import
libraries import it from a newer one. So if we would have applied this
patch, it would most probably be fine in all practical cases. But it would
increase the discrepancy against the WinSDK import libraries, which would
be annoying for no real gain.
// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public