views:

28

answers:

1

Im trying to build GLib-2.4.0 using the makefile.

I get this error:

    gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -pthreads -g -O2 -Wall -MT gatomic.lo -MD -MP -MF .deps/gatomic.Tpo -c gatomic.c
-fno-common -DPIC -o .libs/gatomic.o
    /var/tmp//cctTsmw7.s:103:Incorrect register `%rdx' used with `l' suffix
    make[3]: *** [gatomic.lo] Error 1
    make[2]: *** [install-recursive] Error 1
    make[1]: *** [install-recursive] Error 1
    make: *** [install] Error 2

Any ideas?

A: 

It's likely that a newer version of glib will fix this problem.

However, if you're stuck with 2.4 for some reason, this was discussed in the gtk-devel-list at http://www.mail-archive.com/[email protected]/msg10924.html ... here is the workaround that was reported there.

Here is the workaround that was successful for two users in that thread:

Ah yes, I think I have stumbled on this as well. This is probably
caused because the default jhbuildrc for the Mac forces a build for
the 486:

When building on intel, force build to be 486, since glib won't enable asm atomic operations otherwise.

try: _f = os.popen("uname -p") if _f.read().startswith("i386"): append_autogenargs("glib", "--build=i486-apple-darwin")

I changed the last line to:

  append_autogenargs("glib", "--build=x86_64-apple-darwin")

And that fixed it for me. (If you have a Mac with a Core2 processor,
the user land will be in 64-bit in Snow Leopard).