Cross building GLib tests for Windows fails with '"libgio-2.0-0.dll" failed to initialize, aborting'
Inspection of the build log of #2571 (closed) revealed that there is a problem with not finding required libraries. The corresponding error message reads:
FAILED: gio/tests/test5.gresource
/usr/bin/meson --internal exe --unpickle /home/xxx/src/glib-mingw32-build/meson-private/meson_exe_glib-compile-resources_16a8b5f24d35fd284520af83700add8709157911.dat
Wine: call 0x7bc79a01 to unimplemented function libglib-2.0-0.dll.g_memdup2, termination
0033:err:module:LdrInitializeThunk "libgio-2.0-0.dll" could not be initialized, abort
0033:err:module:LdrInitializeThunk Failed to initialize dlls for "L "Z:\\home\xxx\\src\glib-mingw32-build\gio\glib-compile-resources.exe", status 80000100
while running ['/usr/bin/wine', '/home/xxx/src/glib-mingw32-build/gio/glib-compile-resources.exe', '--target=gio/tests/test5. gresource', '--sourcedir=/home/xxx/src/glib/gio/tests', '--sourcedir=/home/xxx/src/glib-mingw32-build/gio/tests', '../glib/gio/tests/test5.gresource.xml']
ninja: build stopped: subcommand failed.
This is because libglib-2.0-0.dll
is located in the glib
directory, which cannot be loaded by glib-compile-resources.exe
, which is located in the gio
subdirectory.
How to reproduce:
$ sudo zypper ar http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_15.2/windows:mingw:win32.repo
$ sudo zypper install mingw32-cross-gcc-c++ meson ninja mingw32-libglib-2_0-0
$ mkdir ~/src
$ cd ~/src
$ git clone https://gitlab.gnome.org/GNOME/glib.git
$ mkdir glib-mingw32-build
$ cd glib-mingw32-build
$ meson ../glib --cross-file ../meson-cross-file-i686-w64-mingw32.txt
$ ninja