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 708703 - Support universal 32/64 bit builds on MacOSX
Support universal 32/64 bit builds on MacOSX
Status: RESOLVED DUPLICATE of bug 692601
Product: glib
Classification: Platform
Component: build
2.38.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-09-24 22:25 UTC by Dan Kegel
Modified: 2013-11-23 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Dan Kegel 2013-09-24 22:25:00 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
Comment 1 Dan Kegel 2013-09-26 04:52:51 UTC
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.
Comment 2 Dan Winship 2013-09-29 17:03:42 UTC
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.
Comment 3 Matthias Clasen 2013-11-23 16:10:16 UTC

*** This bug has been marked as a duplicate of bug 692601 ***