QEMU build system should halt, if glib version is lower than needed
When i run QEMU 8.2.7's configure, it reports that glib is available:
Run-time dependency glib-2.0 found: YES 2.66.8
Dependency glib-2.0 found: YES 2.66.8 (overridden)
However, when i try to make, it throws up errors at the very beginning:
/tmp/qemu-8.2.7/contrib/plugins/lockstep.c:133:38: error: call to undeclared function 'g_memdup2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
133 | g_memdup2(&divrec, sizeof(divrec)));
| ^
/tmp/qemu-8.2.7/contrib/plugins/lockstep.c:133:38: note: did you mean 'g_memdup'?
/usr/include/glib-2.0/glib/gstrfuncs.h:257:23: note: 'g_memdup' declared here
257 | gpointer g_memdup (gconstpointer mem,
| ^
/tmp/qemu-8.2.7/contrib/plugins/lockstep.c:133:38: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'gpointer' (aka 'void *') [-Wint-conversion]
133 | g_memdup2(&divrec, sizeof(divrec)));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/glib-2.0/glib/gslist.h:62:26: note: passing argument to parameter 'data' here
62 | gpointer data) G_GNUC_WARN_UNUSED_RESULT;
| ^
2 errors generated.
g_memdup2() is available since 2.68, so any QEMU which uses it, will fail to build with glib 2.67 and before. QEMU build system should halt and report the error if the available glib is not sufficient.
Edited by TCH68k