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 491990 - PATCH: glib2 build problem (bc out of range) on PowerPC Mac OS X 10.5 Leopard
PATCH: glib2 build problem (bc out of range) on PowerPC Mac OS X 10.5 Leopard
Status: RESOLVED DUPLICATE of bug 445362
Product: glib
Classification: Platform
Component: general
2.14.x
Other Mac OS
: Normal blocker
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2007-10-31 07:00 UTC by Ryan Schmidt
Modified: 2008-01-07 03:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
David DeHaven solution (718 bytes, patch)
2007-10-31 07:00 UTC, Ryan Schmidt
none Details | Review

Description Ryan Schmidt 2007-10-31 07:00:05 UTC
I am the maintainer of glib2 for the MacPorts package manager system. I have several reports that glib2 2.14.2 fails to build on PowerPC Macs with Mac OS X 10.5 Leopard, giving this error:


ld: bc out of range (572176 max is +/-64K) from _g_atomic_int_exchange_and_add in .libs/gatomic.o to _g_atomic_int_exchange_and_add$stub in .libs/libglib-2.0.0.1400.2.dylib in _g_atomic_int_exchange_and_add from .libs/gatomic.o
collect2: ld returned 1 exit status
make[4]: *** [libglib-2.0.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Error: Status 1 encountered during processing.


This is our bug on this issue:

http://trac.macports.org/projects/macports/ticket/13052


The solution is apparently a small change to gatomic.c. I'll attach a patch. The patch was created (I believe) by David DeHaven, here, where he describes why he made the changes:

http://lists.macosforge.org/pipermail/macports-users/2007-September/005663.html

Does this look correct to you? If so, I can apply this patch to glib2 in MacPorts until such a time as it is included in a glib release.
Comment 1 Ryan Schmidt 2007-10-31 07:00:56 UTC
Created attachment 98227 [details] [review]
David DeHaven solution
Comment 2 Daniel Macks 2007-10-31 18:45:49 UTC
See also Bug #445362, which appears to be the same symptom but an entirely different diagnosis and (proposed) solution.
Comment 3 Alexander Pierce 2007-10-31 20:55:58 UTC
When I implemented this fix, a make check took +6 hours on my 2GHz G5, and rendered the system unresponsive.  I am not 100% nop calls are the way to go.
Comment 4 Guy Harris 2007-11-08 18:40:28 UTC
I originally reported this as a problem against the Leopard linker, as per bug 445362; he indicated, as per that bug, that

      The use of .L prefix for labels is an ELF thing.  On Mac OS X you use just L prefix.  The cross platform way to do this is numbered labels and have the branches use the 'b' or 'f' suffix for back or forward.

and also that

  The code worked before by luck.

This should probably be closed as a duplicate of 445362; I'll be testing the fix on my PowerPC Leopard machine at work later today.
Comment 5 Matthias Clasen 2008-01-06 23:10:22 UTC
Guy, what was the outcome of your testing ?


Anyway, I'll go ahead and mark this as a dupe.

*** This bug has been marked as a duplicate of 445362 ***
Comment 6 Guy Harris 2008-01-07 03:41:17 UTC
The fix from 445362 worked fine; the code Just Works on Leopard with no changes now.