Hi,
I couldn’t really find meaningful answers on how to deal with this so I’ll ask here.
Long story short, I want to compile Kitty term to target glibc version 2.17 to get it to work on a very specific system I use. For that, I am trying to use zig cc -target flag but I’m having issues compiling the glfw dependency.
My issue happens for now in compiling the glfw dependency for Kitty, at first I had some issues with the include files as I couldn’t figure out how to point it to the X11 headers (which in the end I just copied to another folder to isolate it from the rest of the system’s headers).
Now, I have another issue that glfw tries to use the glibc’s reallocarray function which is available for glibc 2.17 using the _GNU_SOURCE flag (which glfw already uses, therefore that should require no change afaik). In the end, I still get the issue that the function declaration cannot be found:
glfw/x11_window.c:2927:21: error: call to undeclared function 'reallocarray'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2927 | aa->array = reallocarray(aa->array, aa->capacity, sizeof(aa->array[0]));
| ^
glfw/x11_window.c:2927:19: error: incompatible integer to pointer conversion assigning to 'MimeAtom *' (aka 'struct MimeAtom *') from 'int' [-Wint-conversion]
2927 | aa->array = reallocarray(aa->array, aa->capacity, sizeof(aa->array[0]));
Given that I saw many people that have already compiled this library using zig cc, this problem should be solvable, but I do require some help here.
Thanks!