Menu

#53 mingw-w64-i686-glib2 g_fopen mode

1.0
closed
Alexx83
glib2 (3)
2014-07-17
2014-06-29
No

GLib 2.0 used for package mingw-w64-i686-glib2 seems not to have been properly compiled.

According glib sources for same version (2.40), if G_OS_WIN32 g_fopen should use _wfopen, using given file mode (e.g. "r", "w", ...).

Using binary dist of glib2 installed by pacman, file mode is not honored: even passing "rb" (binary read), translation is applied which is wrong and prevent from recognizing signature or binary file (e.g. as required by gdk-pixbuf to detect image format).

Using attached test code with gnome-fs-directory.png, with glib2 package provided by msys2, line carriage is translated (5th byte translated to 10 instead of original 13).

Building same glib version from sources with following configure command, same test code is back to expected behaviour (read untranslated):

CPPFLAGS="-march=i686 -D_WIN32_WINNT=0x0601" LIBFFI_CFLAG=pkgconfig --cflags libffi LIBFFI_LIBS="-lffi -L/mingw32/lib/" ./configure --prefix=/mingw32 --with-python=which python

2 Attachments

Discussion

  • Alexx83

    Alexx83 - 2014-07-02

    This is strange because:
    $ nm /mingw64/lib/libglib-2.0.dll.a | grep g_fopen
    0000000000000000 I __imp_g_fopen
    0000000000000000 T g_fopen

     
  • Cedric Chantepie

    I don't see your point. Yes symbols are therre, but for me it doesn't help to see whay is the implementation of the function. Do you have tried the test code?

     
  • Alexx83

    Alexx83 - 2014-07-17
    • status: open --> closed
    • assigned_to: Alexx83
     
  • Alexx83

    Alexx83 - 2014-07-17

    Fixed in 2.41.2-1