GNOME Bugzilla – Bug 522335
Fails to build: glib/gtester.c:276: error: 'ARG_MAX' undeclared
Last modified: 2008-03-31 07:42:51 UTC
glib-2.16.1 fails to build on GNU/Hurd: gcc -DHAVE_CONFIG_H -I. -I/build/buildd/glib2.0-2.16.1/glib -I.. -I/build/buildd/glib2.0-2.16.1 -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -DPCRE_STATIC -pthread -Wall -g -O2 -MT gtester.o -MD -MP -MF .deps/gtester.Tpo -c -o gtester.o /build/buildd/glib2.0-2.16.1/glib/gtester.c /build/buildd/glib2.0-2.16.1/glib/gtester.c: In function 'launch_test_binary': /build/buildd/glib2.0-2.16.1/glib/gtester.c:276: error: 'ARG_MAX' undeclared (first use in this function) /build/buildd/glib2.0-2.16.1/glib/gtester.c:276: error: (Each undeclared identifier is reported only once /build/buildd/glib2.0-2.16.1/glib/gtester.c:276: error: for each function it appears in.) /build/buildd/glib2.0-2.16.1/glib/gtester.c:276: warning: unused variable 'argv' make[5]: *** [gtester.o] Error 1 make[5]: Leaving directory `/build/buildd/glib2.0-2.16.1/debian/build/deb/glib' This is because the GNU system does not have a length limit for exec, so ARG_MAX is not defined.
I guess that a patch would be welcome.
Created attachment 107789 [details] [review] drop usage of facultative ARG_MAX macro And actually the use of ARG_MAX here is bogus: ARG_MAX gives the maximum size in bytes, not in number of arguments. The attached patch just uses a dynamically allocated array and will also fix bug #515910
*** Bug 523833 has been marked as a duplicate of this bug. ***
Created attachment 107798 [details] [review] hurd-arg-max.patch Use g_free and g_malloc instead of non-existing functions. Ok to commit this? Works fine for me on Linux too (i.e. builds and testsuite runs successfully.
2008-03-30 Matthias Clasen <mclasen@redhat.com> * glib/gtester.c: Don't use ARG_MAX. (#522335, patch by Sebastian Dröge)
Well, the patch is by Samuel Thibault and only adapted to actually work by me...