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 631353 - glib broken on 5 OpenBSD platforms (gatomic.c related?) since 2.26
glib broken on 5 OpenBSD platforms (gatomic.c related?) since 2.26
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.29.x
Other All
: Normal critical
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2010-10-04 20:55 UTC by Jasper Lievisse Adriaanse
Modified: 2011-05-18 16:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add missing header which caused gatomic.c compile errors. (201 bytes, patch)
2010-10-11 21:30 UTC, Jasper Lievisse Adriaanse
none Details | Review

Description Jasper Lievisse Adriaanse 2010-10-04 20:55:53 UTC
The platforms below built and ran correctly with glib up to 2.24.2, but fail with 2.26.0.

The platforms are:
- sh4
- mips64 (big/little endian)
- vax
- hp pa-risc

They fail as such:
cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../glib -I../glib -I.. -I/usr/local/include -DG_LOG_DOMAIN="GLib"                                           -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -DPCRE_STATIC -I/usr/local/include                                           -D_POSIX_MONOTONIC_CLOCK=200112L -DG_DISABLE_SINGLE_INCLUDES -pthread -O2 -pipe -Wall -MT gatomic.lo                                           -MD -MP -MF .deps/gatomic.Tpo -c gatomic.c -fPIC -DPIC -o .libs/gatomic.o
gatomic.c:885: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
gatomic.c: In function 'g_atomic_int_exchange_and_add':
gatomic.c:906: warning: implicit declaration of function 'g_mutex_lock'
gatomic.c:906: error: 'g_atomic_mutex' undeclared (first use in this function)
gatomic.c:906: error: (Each undeclared identifier is reported only once
gatomic.c:906: error: for each function it appears in.)
gatomic.c:909: warning: implicit declaration of function 'g_mutex_unlock'
gatomic.c: In function 'g_atomic_int_add':
gatomic.c:928: error: 'g_atomic_mutex' undeclared (first use in this function)
gatomic.c: In function 'g_atomic_int_compare_and_exchange':
gatomic.c:954: error: 'g_atomic_mutex' undeclared (first use in this function)
gatomic.c: In function 'g_atomic_pointer_compare_and_exchange':
gatomic.c:988: error: 'g_atomic_mutex' undeclared (first use in this function)
gatomic.c: In function 'g_atomic_int_get':
gatomic.c:1019: error: 'g_atomic_mutex' undeclared (first use in this function)
gatomic.c: In function 'g_atomic_int_set':
gatomic.c:1040: error: 'g_atomic_mutex' undeclared (first use in this function)
gatomic.c: In function 'g_atomic_pointer_get':
gatomic.c:1061: error: 'g_atomic_mutex' undeclared (first use in this function)
gatomic.c: In function 'g_atomic_pointer_set':
gatomic.c:1082: error: 'g_atomic_mutex' undeclared (first use in this function)
gatomic.c: In function '_g_atomic_thread_init':
gatomic.c:1155: error: 'g_atomic_mutex' undeclared (first use in this function)
gatomic.c:1155: warning: implicit declaration of function 'g_mutex_new'
Error while executing cc -DHAVE_CONFIG_H -I. -I.. -I.. -I../glib -I../glib -I.. -I/usr/local/include                                           -DG_LOG_DOMAIN="GLib" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -DPCRE_STATIC                                           -I/usr/local/include -D_POSIX_MONOTONIC_CLOCK=200112L -DG_DISABLE_SINGLE_INCLUDES -pthread -O2 -pipe                                           -Wall -MT gatomic.lo -MD -MP -MF .deps/gatomic.Tpo -c gatomic.c -fPIC -DPIC -o .libs/gatomic.o
gmake[4]: *** [gatomic.lo] Error 1

Any idea what's causing this?
A real solution would probably to write the asm for these, right?
  ATOMIC_INT_CMP_XCHG,
  g_atomic_int_exchange_and_add,
  g_atomic_int_add,
  g_atomic_int_compare_and_exchange,
  g_atomic_pointer_compare_and_exchange,
  G_ATOMIC_MEMORY_BARRIER.
Comment 1 Jasper Lievisse Adriaanse 2010-10-11 21:30:38 UTC
Created attachment 172137 [details] [review]
Add missing header which caused gatomic.c compile errors.
Comment 2 Jonathan Blanchard 2010-11-01 15:00:59 UTC
Also affects Solaris 10 when using gcc and building for a target without builtin atomic operations (i.e. -march=i386)

The provided patch fix the issue.
Comment 3 Lionel Landwerlin 2010-11-06 16:45:40 UTC
I can confirm you patch fix the problem on Linux too when using things like -march=i386.
Comment 4 Matthias Drochner 2010-11-10 20:06:07 UTC
NetBSD's pkgsrc has a similar patch to fix the build on NetBSD/i386<=5.x
(where the compiler defaults to -march=i386)
Comment 5 Lionel Landwerlin 2010-11-10 23:36:11 UTC
If someone could change the bug status to NEW, that would be great.
Comment 6 Jasper Lievisse Adriaanse 2010-11-17 10:36:50 UTC
Does any GLIB developer care about *BSD/Solaris?
Comment 7 Pacho Ramos 2011-01-22 15:52:22 UTC
(In reply to comment #6)
> Does any GLIB developer care about *BSD/Solaris?

There are also some people affected in Gentoo ;-)
http://bugs.gentoo.org/show_bug.cgi?id=351387

Thanks for applying it upstream if possible :-D
Comment 8 Jasper Lievisse Adriaanse 2011-05-18 15:46:46 UTC
Anyone?? Why is this still "unconfirmed" when Gentoo ran into it, and confirmed this patch fixes it?

Seems nobody cares for non-standard architectures...
Comment 9 Colin Walters 2011-05-18 16:08:46 UTC
commit 3f3b2bd82b9674d22cd64d76af68ddbc9cf80115
Author: Jasper Lievisse Adriaanse <jasper@humppa.nl>
Date:   Wed May 18 12:01:44 2011 -0400

    gatomic: #include gthread.h to fix compilation on nonoptimized architectures
    
    The fallback case of implementing atomic integers with mutexes needs
    gthread.h.
    
    Commit message written by Colin Walters <walters@verbum.org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=631153
Comment 10 Colin Walters 2011-05-18 16:09:12 UTC
In the future please see:
https://live.gnome.org/GnomeLove/SubmittingPatches

This tells you how to submit "git format-patch" style patches.
Comment 11 Jasper Lievisse Adriaanse 2011-05-18 16:20:25 UTC
Thanks for committing.
Though the mentioned bug should be #631353 not #631153 ;-)
Comment 12 Colin Walters 2011-05-18 16:27:11 UTC
(In reply to comment #11)
> Thanks for committing.
> Though the mentioned bug should be #631353 not #631153 ;-)

Argh.  Oh well.