GNOME Bugzilla – Bug 701897
glib 2.36.x won't build on Solaris and derivatives
Last modified: 2018-05-24 15:24:41 UTC
The fix for 682818 breaks compilation of GLib on Solaris and Illumos derivatives (such as OpenIndiana) that still have gcc3 as their compiler. Files fail to link with Undefined first referenced symbol in file __sync_synchronize ./.libs/libglib-2.0.so __sync_bool_compare_and_swap ./.libs/libglib-2.0.so __sync_fetch_and_or ./.libs/libglib-2.0.so __sync_fetch_and_add ./.libs/libglib-2.0.so __sync_fetch_and_and ./.libs/libglib-2.0.so __sync_fetch_and_sub ./.libs/libglib-2.0.so __sync_fetch_and_xor ./.libs/libglib-2.0.so The problem is that __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is now defined without any checking, and there are platforms for which it isn't actually true. (This also appears to break the test for G_ATOMIC_LOCK_FREE, which now passes when it shouldn't.)
OpenIndiana has gcc 4
This turns out to be a problem in configure.ac. The AC_TRY_COMPILE test for __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is reversed and is... 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])], [])
That is a misunderstanding - what this snipplet is supposed to do is define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 if it isn't already. There must be something going wrong with the atomics detection earlier.
*** Bug 697017 has been marked as a duplicate of this bug. ***
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/713.