COmpile of git source fails at GLIB

  • Good afternoon,

    In trying to compile the latest source for LibreElec, I run into an issue. When I try to compile for the Raspberry Pi 4, the compile stops at glib with an error.

    I thought it was a problem with the machine I was building on so I started from a fresh install of Ubuntu 21.10. - the machine is a VM so it's not a big deal to setup. The error still occurs.

    The error I get seems to imply that too few parameters are passed to the function "close_range" so I did a "Apt update" and "apt upgrade" but it seems to make no difference. The system is already up to date in terms of software or so it tells me.

    Here's a bit of the logs of the error:

    FAILED: glib/libglib-2.0.a.p/gspawn.c.o

    /home/pierre/http://LibreELEC.tv/build.LibreELEC-RPi4.arm-11.0-devel/toolchain/bin/host-gcc -Iglib/libglib-2.0.a.p -Iglib -I../glib -I. -I.. -I/home/pierre/http://LibreELEC.tv/build.LibreELEC-RPi4.arm-11.0-devel/toolchain/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -D_GNU_SOURCE -fno-strict-aliasing -Wduplicated-branches -Wimplicit-fallthrough -Wmisleading-indentation -Wstrict-prototypes -Wunused -Wno-unused-parameter -Wno-bad-function-cast -Wno-cast-function-type -Wno-pedantic -Wno-format-zero-length -Werror=declaration-after-statement -Werror=format=2 -Werror=implicit-function-declaration -Werror=init-self -Werror=missing-include-dirs -Werror=missing-prototypes -Werror=pointer-arith -march=native -O2 -Wall -pipe -Wno-format-security -fPIC -pthread '-DG_LOG_DOMAIN="GLib"' -DGLIB_COMPILATION -MD -MQ glib/libglib-2.0.a.p/gspawn.c.o -MF glib/libglib-2.0.a.p/gspawn.c.o.d -o glib/libglib-2.0.a.p/gspawn.c.o -c ../glib/gspawn.c

    ../glib/gspawn.c: In function 'safe_closefrom':

    ../glib/gspawn.c:1497:7: error: too few arguments to function 'close_range'

    1497 | if (close_range (lowfd, G_MAXUINT) != 0 && errno == ENOSYS)

    | ^~~~~~~~~~~

    In file included from /usr/include/unistd.h:1204,

    from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,

    from /usr/include/signal.h:328,

    from /usr/include/x86_64-linux-gnu/sys/wait.h:36,

    from ../glib/gspawn.c:25:

    /usr/include/x86_64-linux-gnu/bits/unistd_ext.h:56:12: note: declared here

    56 | extern int close_range (unsigned int __fd, unsigned int __max_fd,

    | ^~~~~~~~~~~

    ninja: build stopped: subcommand failed.

    ^[[1;31mFAILURE: scripts/build glib:host during make_host (default)^[[0m

    *********** FAILED COMMAND ***********

    ninja ${NINJA_OPTS} ${PKG_MAKE_OPTS_HOST}

    **************************************

    ^[[1;31mFAILURE: scripts/build glib:host has failed!^[[0m

    If anyone has any tips they can share on how to get past that, please let me know. This is by no means urgent. ;)

    Thank you.

    Pierre

    P.S.: I have attached the whole log file in case the error comes from somewhere else.