On Tuesday 2021-09-07 01:36, Zebediah Figura wrote:
[3] But because of the way the Win32 loader works, you can generally only have one DLL of a given name loaded in a process. [...] further attempts to dlopen() [as it were] "libfreetype-6.dll" will return the handle to the already loaded library
"generally" is a vague word. Generally, ld.so behaves quite similar, so there is no problem. Outside the generality, one can load two libs with the same basename, so there is also no problem.
[A library like libfreetype] can be ahead of Wine's system libraries, behind them, or even built with custom patches. Accordingly we really don't want to load "our" freetype in place of "their" freetype, or "theirs" in place of "ours".
(1) Should we build via source import, or link statically, or dynamically?
Anything that is static can not be overridden. But overriding is at the heart of your operation AIUI.
Note however that if they are linked dynamically, we need to make sure that we load our packages instead of MinGW builds of open-source libraries with applications ship with. [...] We will probably need to compile each library, and its dependencies, with a separate, wine-specific name, e.g. "libwinefreetype-6.dll"
Not a big deal. If game.exe can load its own freetype.dll in favor of wine's freetype.dll, then wine can load its own freetype.dll in favor of mingw's freetype.dll. And that works best if they do have the same filename.