Search code examples
cglibcglib

glib : glib 2.5 installation issue


I am working on Red Hat 6 with kernal version 2.6.32 , I am trying build glib 2.5 on my machine. And fail with following error:-

Log:-

../../gio/gfile.c: In function ‘splice_stream_with_progress’:
../../gio/gfile.c:3019: error: ‘F_SETPIPE_SZ’ undeclared (first use in this function)
../../gio/gfile.c:3019: error: (Each undeclared identifier is reported only once
../../gio/gfile.c:3019: error: for each function it appears in.)
../../gio/gfile.c:3023: error: ‘F_GETPIPE_SZ’ undeclared (first use in this function)
make[4]: *** [libgio_2_0_la-gfile.lo] Error 1

I can find the solution of at F_SETPIPE_SZ undeclared , placing #define _GNU_SOURCE before all includes in file gfile.c, But it didn't work. As mentioned in second answer: Older kernels (e.g. 2.6.32 as used in RHEL6) don't have them and we need bypass it in whatever you're building. How could we do that?

Appreciate your help .

Thanks in Advance.


Solution

  • The bug is fixed in this commit.

    architectures without F_SETPIPE_SZ and F_GETPIPE_SZ such as or1k. If those variables are undefined, put back previous behavior, buffer size set to 1024 * 64

    https://gitlab.gnome.org/GNOME/glib/-/commit/0beb62f564072f3585762c9c55fe894485993b62

    You can apply the patch to your code.