[cairo-commit] configure.in

Chris Wilson ickle at kemper.freedesktop.org
Tue Sep 25 14:21:08 PDT 2007


 configure.in |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
diff-tree f1d84271d363cc80cdef92ec9cac2cf29783bfe0 (from 03be41151d06d48d55bc1e172535829ec45a10cf)
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Tue Sep 25 21:58:24 2007 +0100

    [cairo-atomic]  Do not use Intel atomic primitives on i386.
    
    When limiting the target instruction set for compatibility with older
    processors, e.g. -march=i386, the Intel atomic primitives generate a
    call to a non-existent function, __sync_fetch_and_add_4(). To detect
    this scenario change the configure test from AC_TRY_COMPILE to
    AC_TRY_LINK which will then cause Cairo to fall back to using mutexes
    for its atomic operations.

diff --git a/configure.in b/configure.in
index 5f7f613..004d921 100644
--- a/configure.in
+++ b/configure.in
@@ -96,7 +96,7 @@ dnl
 AC_MSG_CHECKING([for native atomic primitives])
 cairo_atomic_primitives="none"
 
-AC_TRY_COMPILE([int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); }], [],
+AC_TRY_LINK([int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); }], [],
   AC_DEFINE(CAIRO_HAS_INTEL_ATOMIC_PRIMITIVES, 1, [Enable if your compiler supports the Intel __sync_* atomic primitives])
   cairo_atomic_primitives="Intel"
   )


More information about the cairo-commit mailing list