After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 522335 - Fails to build: glib/gtester.c:276: error: 'ARG_MAX' undeclared
Fails to build: glib/gtester.c:276: error: 'ARG_MAX' undeclared
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.16.x
Other GNU Hurd
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
: 523833 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-03-13 23:20 UTC by Michael Banck
Modified: 2008-03-31 07:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
drop usage of facultative ARG_MAX macro (1.52 KB, patch)
2008-03-22 11:04 UTC, Samuel Thibault
none Details | Review
hurd-arg-max.patch (1.42 KB, patch)
2008-03-22 12:46 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Michael Banck 2008-03-13 23:20:23 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.
Comment 1 Murray Cumming 2008-03-17 15:33:48 UTC
I guess that a patch would be welcome.
Comment 2 Samuel Thibault 2008-03-22 11:04:44 UTC
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
Comment 3 Sebastian Dröge (slomo) 2008-03-22 12:45:16 UTC
*** Bug 523833 has been marked as a duplicate of this bug. ***
Comment 4 Sebastian Dröge (slomo) 2008-03-22 12:46:35 UTC
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.
Comment 5 Matthias Clasen 2008-03-31 04:26:07 UTC
2008-03-30  Matthias Clasen  <mclasen@redhat.com>

        * glib/gtester.c: Don't use ARG_MAX.  (#522335, patch by
        Sebastian Dröge)

Comment 6 Sebastian Dröge (slomo) 2008-03-31 07:42:51 UTC
Well, the patch is by Samuel Thibault and only adapted to actually work by me...