Bug 18140 - additional atomic support check in configure for sh (Super-H) arch
Summary: additional atomic support check in configure for sh (Super-H) arch
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 1.8.0
Hardware: Other Linux (All)
: low normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-20 19:19 UTC by CHIKAMA Masaki
Modified: 2008-10-21 01:24 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description CHIKAMA Masaki 2008-10-20 19:19:16 UTC
The cairo uses native atomic operation (__sync_fetch_and_add and _sync_val_compare_and_swap) defined in cairo-atomic-private.h,
and checks whether a system has them in configure script.
But in fact, configure script checks only __sync_fetch_and_add
and this causes undefined symbol on sh architecture like below.

/usr/lib/gcc/sh4-redhat-linux/4.3.0/../../../libcairo.so: undefined reference
to
 `__sync_val_compare_and_swap_4'
collect2: ld returned 1 exit status

This is a proposed patch for configure script to check both function.

--- cairo-1.8.0/configure.org   2008-10-19 19:27:20.000000000 +0900
+++ cairo-1.8.0/configure       2008-10-19 20:29:50.000000000 +0900
@@ -22857,6 +22857,7 @@
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 int atomic_add(int i) { return __sync_fetch_and_add (&i, 1); }
+int atomic_int_cmpxchg(int i, int j, int k) { return __sync_val_compare_and_swap(&i, j, k); }
 int
 main ()
 {

see also https://bugzilla.redhat.com/show_bug.cgi?id=467658
Comment 1 Chris Wilson 2008-10-21 01:24:46 UTC
Thanks for the report - pushed fd1f3c2, will be included with 1.8.2


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.