glib 2.36.x won't build on Solaris and derivatives
Submitted by Peter Tribble
Link to original bug (#701897)
Description
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.)
Version: 2.36.x