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 697017 - Undefined symbols: ___sync_fetch_and_or ___sync_fetch_and_add ___sync_fetch_and_and ___sync_synchronize
Undefined symbols: ___sync_fetch_and_or ___sync_fetch_and_add ___sync_fetch_a...
Status: RESOLVED DUPLICATE of bug 701897
Product: glib
Classification: Platform
Component: build
2.36.x
Other Mac OS
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-04-01 06:05 UTC by Ryan Schmidt
Modified: 2013-11-23 16:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ryan Schmidt 2013-04-01 06:05:34 UTC
I'm the maintainer of glib in MacPorts, and I just discovered that after updating our glib2 port to 2.36.0, it now fails to build on OS X 10.5 Leopard.


:info:build In file included from 1bit-mutex.c:54:
:info:build ../../glib/gbitlock.c: In function ‘g_futex_wait’:
:info:build ../../glib/gbitlock.c:129: warning: implicit declaration of function ‘__sync_synchronize’
:info:build ../../glib/gbitlock.c: In function ‘_emufutex_g_bit_lock’:
:info:build ../../glib/gbitlock.c:240: warning: implicit declaration of function ‘__sync_fetch_and_or’
:info:build ../../glib/gbitlock.c:246: warning: implicit declaration of function ‘__sync_fetch_and_add’
:info:build ../../glib/gbitlock.c: In function ‘_emufutex_g_bit_unlock’:
:info:build ../../glib/gbitlock.c:329: warning: implicit declaration of function ‘__sync_fetch_and_and’


:info:build Undefined symbols:
:info:build   "___sync_fetch_and_or", referenced from:
:info:build       __emufutex_g_bit_lock in 1bit_emufutex-1bit-mutex.o
:info:build       __emufutex_g_bit_trylock in 1bit_emufutex-1bit-mutex.o
:info:build       __emufutex_g_pointer_bit_lock in 1bit_emufutex-1bit-mutex.o
:info:build       __emufutex_g_pointer_bit_trylock in 1bit_emufutex-1bit-mutex.o
:info:build   "___sync_fetch_and_add", referenced from:
:info:build       __emufutex_g_bit_lock in 1bit_emufutex-1bit-mutex.o
:info:build       __emufutex_g_bit_lock in 1bit_emufutex-1bit-mutex.o
:info:build       __emufutex_g_pointer_bit_lock in 1bit_emufutex-1bit-mutex.o
:info:build       __emufutex_g_pointer_bit_lock in 1bit_emufutex-1bit-mutex.o
:info:build   "___sync_fetch_and_and", referenced from:
:info:build       __emufutex_g_bit_unlock in 1bit_emufutex-1bit-mutex.o
:info:build       __emufutex_g_pointer_bit_unlock in 1bit_emufutex-1bit-mutex.o
:info:build   "___sync_synchronize", referenced from:
:info:build       _g_futex_wait in 1bit_emufutex-1bit-mutex.o
:info:build       __emufutex_g_bit_unlock in 1bit_emufutex-1bit-mutex.o
:info:build       __emufutex_g_pointer_bit_unlock in 1bit_emufutex-1bit-mutex.o
:info:build ld: symbol(s) not found
Comment 1 Allison Karlitskaya (desrt) 2013-04-01 18:17:29 UTC
Probably caused by bug 682818.
Comment 2 Ryan Schmidt 2013-04-02 13:01:24 UTC
In MacPorts we are working around this problem by using gcc-4.2 instead of gcc-4.0 on Leopard. 
That's not so easy on Tiger though since its Xcode does not include anything newer than gcc-4.0.
Comment 3 Alan Hourihane 2013-11-10 17:09:31 UTC
The test in configure.ac for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is reversed.

It's currently this...

      AC_TRY_COMPILE([],
                     [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],
                     [],
                     [AC_DEFINE(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4, 1, [
compiler supports atomic operations])])

where it should be....

      AC_TRY_COMPILE([],
                     [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],
                     [AC_DEFINE(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4, 1, [
compiler supports atomic operations])],
                     [])

which causes many of the reported problems to do with undefined symbols for __sync_fetch_and_add_4 etc.
Comment 4 Matthias Clasen 2013-11-23 16:08:38 UTC

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