GNOME Bugzilla – Bug 708703
Support universal 32/64 bit builds on MacOSX
Last modified: 2013-11-23 16:10:16 UTC
glib currently generates a glibconfig.h that is wrong for universal builds; trying to do a universal build on macosx fails with gobs of errors like gchecksum.c:1122: warning: integer constant is too large for 'long' type gchecksum.c:1122: warning: large integer implicitly truncated to unsigned type because gint64 is defined the same regardless of whether building for 32 or 64 bits. The problem is, glib's configure script detects size and endianness at configure time, and generates glibconfig.h... but when building universal binaries, that can't work. glib should detect them using compile time tests right in glibconfig.h. Bug 692601 has a patch that does this for endianness, but that's not sufficient; we also need to do it for word size. Here's homebrew's recipe: https://github.com/mxcl/homebrew/blob/master/Library/Formula/glib.rb and the patch it uses: https://trac.macports.org/export/95596/trunk/dports/devel/glib2/files/patch-configure.diff
That recipe also applies the following ed script (!) to config.h: https://trac.macports.org/export/95596/trunk/dports/devel/glib2/files/config.h.ed which changes the definitions of G_VA_COPY_AS_ARRAY, SIZEOF_LONG, SIZEOF_SIZE_T, and SIZEOF_VOID_P. Why it needs to do both, I dunno. Bit of a mess.
The problem with those patches is that they work for the specific case of Mac OS X, but not in general. There are some parts of glibconfig.h that could be generically figured out at compile-time (eg, what int types correspond to gint32 and gint64), but not all of it (eg, G_VA_COPY_AS_ARRAY). So, I don't think there's anything we can do here.
*** This bug has been marked as a duplicate of bug 692601 ***