Skip to contentSkip to conversation

cairo: disable native atomic operations, conflicts with libatomics-ops

PATCH In review Denys Dmytriyenko 5 participants 12 messages Mar 17, 2011 – Mar 18, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cairo: disable native atomic operations, conflicts with libatomics-ops

From: Denys Dmytriyenko <[email protected]>

* Add --disable-atomic to configure, otherwise it finds previously staged libatomics-ops from pulseaudio, which doesn't have the necessary primitives:

| In file included from cairo-reference-count-private.h:40,
|                  from cairo-types-private.h:45,
|                  from cairoint.h:242,
|                  from cairo-analysis-surface.c:37:
| cairo-atomic-private.h: In function '_cairo_atomic_int_cmpxchg_return_old_fallback':
| cairo-atomic-private.h:218: error: implicit declaration of function 'AO_compare_and_swap_full'
| cairo-atomic-private.h:218: warning: nested extern declaration of 'AO_compare_and_swap_full'

* From my previous builds I see that cairo used to build before libatomics-ops was staged, avoiding this issue.
* Also, add INC_PR to cairo.inc and use it in recipes
* Start INC_PR from r4 to account for one of the older versions

---
 recipes/cairo/cairo-directfb_1.6.4.bb |    2 +-
 recipes/cairo/cairo.inc               |    5 +++++
 recipes/cairo/cairo_1.10.0.bb         |    3 +--
 recipes/cairo/cairo_1.4.10.bb         |    3 +--
 recipes/cairo/cairo_1.8.0.bb          |    2 +-
 recipes/cairo/cairo_1.8.10.bb         |    3 +--
 recipes/cairo/cairo_1.8.8.bb          |    4 +---
 recipes/cairo/cairomm_1.8.4.bb        |    3 ++-
 8 files changed, 13 insertions(+), 12 deletions(-)
recipes/cairo/cairo-directfb_1.6.4.bb +1 -1
index b4fea9a..3670eab 100644
@@ -12,7 +12,7 @@ EXTRA_OECONF += " --enable-directfb \
 LDFLAGS_append += " -ldirectfb"
 CFLAGS_append  += " -I${STAGING_INCDIR}/directfb"
 
-PR = "r1"
+PR = "${INC_PR}.1"
 
 S = "${WORKDIR}/cairo-${PV}"
 
recipes/cairo/cairo.inc +5 -0
index c60d7d9..3dcc14c 100644
@@ -4,10 +4,15 @@ DEPENDS = "virtual/libx11 pixman libsm libpng fontconfig libxrender glib-2.0"
 DESCRIPTION = "Cairo graphics library"
 LICENSE = "MPL LGPL"
 
+INC_PR = "r4"
+
 #check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points 
 require cairo-fpu.inc
 EXTRA_OECONF += "${@get_cairo_fpu_setting(bb, d)}"
 
+# Disable check for atomic functions, as it fails with libatomics-ops staged
+EXTRA_OECONF += " --disable-atomic"
+
 inherit autotools pkgconfig 
 
 PACKAGES =+ "cairo-trace cairo-trace-dev libcairo-script-interpreter libcairo-gobject"
recipes/cairo/cairo_1.10.0.bb +1 -2
index 58e2481..177c615 100644
@@ -1,10 +1,9 @@
 require cairo.inc
 
-PR = "r1"
+PR = "${INC_PR}.1"
 
 SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz;name=cairo \
 "
 
 SRC_URI[cairo.md5sum] = "70a2ece66cf473d976e2db0f75bf199e"
 SRC_URI[cairo.sha256sum] = "0f2ce4cc4615594088d74eb8b5360bad7c3cc3c3da9b61af9bfd979ed1ed94b2"
-
recipes/cairo/cairo_1.4.10.bb +1 -2
index 544479b..c334c34 100644
@@ -5,8 +5,7 @@ DEFAULT_PREFERENCE = "-1"
 SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz \
 file://stats.patch;p=1"
 
-PR = "r0"
-
+PR = "${INC_PR}.0"
 
 SRC_URI[md5sum] = "5598a5e500ad922e37b159dee72fc993"
 SRC_URI[sha256sum] = "594e78a66044898c321e378d47faf43b665b23ba638834d2787e344ba13e5132"
recipes/cairo/cairo_1.8.0.bb +1 -1
index a4225e8..e7cdeb7 100644
@@ -3,7 +3,7 @@ require cairo.inc
 SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz \
           "
 
-
+PR = "${INC_PR}.0"
 
 SRC_URI[md5sum] = "4ea70ea87b47e92d318d4e7f5b940f47"
 SRC_URI[sha256sum] = "827acee89ba3e8e762fbb23165cf8d455e7d95e1e50984e6882b2070a7f3abae"
recipes/cairo/cairo_1.8.10.bb +1 -2
index 884a6a7..8339b81 100644
@@ -1,6 +1,6 @@
 require cairo.inc
 
-PR = "r3"
+PR = "${INC_PR}.3"
 
 SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz;name=cairo \
            file://dolt-fix.patch \
@@ -9,4 +9,3 @@ SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz;name=cairo \
 
 SRC_URI[cairo.md5sum] = "b60a82f405f9400bbfdcf850b1728d25"
 SRC_URI[cairo.sha256sum] = "572bada15596ec8708392db1af8b93a1af75ca47690348154e2841f3a6f08439"
-
recipes/cairo/cairo_1.8.8.bb +1 -3
index de12f13..b0280a9 100644
@@ -1,4 +1,4 @@
-PR = "r1"
+PR = "${INC_PR}.1"
 
 require cairo.inc
 
@@ -6,7 +6,5 @@ SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz \
            file://dolt-fix.patch \
           "
 
-
-
 SRC_URI[md5sum] = "d3e1a1035ae563812d4dd44a74fb0dd0"
 SRC_URI[sha256sum] = "3c51d3de5dc4596e01a6675acd3c86c2c99c00f02e8fad5493758a29fe451c90"
recipes/cairo/cairomm_1.8.4.bb +2 -1
index 672dcb5..19b7618 100644
@@ -1,9 +1,10 @@
 require cairo.inc
 
+PR = "${INC_PR}.0"
+
 DEPENDS = "cairo libsigc++-2.0"
 DESCRIPTION = "C++ bindings for Cairo graphics library"
 
 SRC_URI = "http://cairographics.org/releases/cairomm-${PV}.tar.gz;name=archive"
 SRC_URI[archive.md5sum] = "559afbc47484ba3fad265e38a3dafe90"
 SRC_URI[archive.sha256sum] = "a28ec6d9af8f93d09076f32cd77de35f9d74a517def5dea12cb8cc2ce3a6c8f1"
-
Signature · 1 line
1.7.0.4
#1 lore raw

An alternative solution, is to build libatomics-ops with emulated CAS (Compare And Swap), as otherwise those non-emulated primitives are not available on armel and sparc, according to [1]

Let me know if fixing libatomics-ops is more preferable and I'll make a patch. But I figured that since cairo used to build w/o atomic ops anyway, it's safer to just forcefully disable the check for them.

[1] http://us.generation-nt.com/answer/bug-566850-ao-compare-swap-full-not-available-armel-sparc-help-169012241.html

BTW, the correct name is libatomic-ops and not libatomics-ops, like it's named in OE...

Signature · 1 line
Denys
Quoted 165 lines · Denys Dmytriyenko

From: Denys Dmytriyenko <[email protected]>

* Add --disable-atomic to configure, otherwise it finds previously staged libatomics-ops from pulseaudio, which doesn't have the necessary primitives:

| In file included from cairo-reference-count-private.h:40,
|                  from cairo-types-private.h:45,
|                  from cairoint.h:242,
|                  from cairo-analysis-surface.c:37:
| cairo-atomic-private.h: In function '_cairo_atomic_int_cmpxchg_return_old_fallback':
| cairo-atomic-private.h:218: error: implicit declaration of function 'AO_compare_and_swap_full'
| cairo-atomic-private.h:218: warning: nested extern declaration of 'AO_compare_and_swap_full'

* From my previous builds I see that cairo used to build before libatomics-ops was staged, avoiding this issue.
* Also, add INC_PR to cairo.inc and use it in recipes
* Start INC_PR from r4 to account for one of the older versions

---
 recipes/cairo/cairo-directfb_1.6.4.bb |    2 +-
 recipes/cairo/cairo.inc               |    5 +++++
 recipes/cairo/cairo_1.10.0.bb         |    3 +--
 recipes/cairo/cairo_1.4.10.bb         |    3 +--
 recipes/cairo/cairo_1.8.0.bb          |    2 +-
 recipes/cairo/cairo_1.8.10.bb         |    3 +--
 recipes/cairo/cairo_1.8.8.bb          |    4 +---
 recipes/cairo/cairomm_1.8.4.bb        |    3 ++-
 8 files changed, 13 insertions(+), 12 deletions(-)
recipes/cairo/cairo-directfb_1.6.4.bb +1 -1
index b4fea9a..3670eab 100644
@@ -12,7 +12,7 @@ EXTRA_OECONF += " --enable-directfb \
 LDFLAGS_append += " -ldirectfb"
 CFLAGS_append  += " -I${STAGING_INCDIR}/directfb"
 
-PR = "r1"
+PR = "${INC_PR}.1"
 
 S = "${WORKDIR}/cairo-${PV}"
 
recipes/cairo/cairo.inc +5 -0
index c60d7d9..3dcc14c 100644
@@ -4,10 +4,15 @@ DEPENDS = "virtual/libx11 pixman libsm libpng fontconfig libxrender glib-2.0"
 DESCRIPTION = "Cairo graphics library"
 LICENSE = "MPL LGPL"
 
+INC_PR = "r4"
+
 #check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points 
 require cairo-fpu.inc
 EXTRA_OECONF += "${@get_cairo_fpu_setting(bb, d)}"
 
+# Disable check for atomic functions, as it fails with libatomics-ops staged
+EXTRA_OECONF += " --disable-atomic"
+
 inherit autotools pkgconfig 
 
 PACKAGES =+ "cairo-trace cairo-trace-dev libcairo-script-interpreter libcairo-gobject"
recipes/cairo/cairo_1.10.0.bb +1 -2
index 58e2481..177c615 100644
@@ -1,10 +1,9 @@
 require cairo.inc
 
-PR = "r1"
+PR = "${INC_PR}.1"
 
 SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz;name=cairo \
 "
 
 SRC_URI[cairo.md5sum] = "70a2ece66cf473d976e2db0f75bf199e"
 SRC_URI[cairo.sha256sum] = "0f2ce4cc4615594088d74eb8b5360bad7c3cc3c3da9b61af9bfd979ed1ed94b2"
-
recipes/cairo/cairo_1.4.10.bb +1 -2
index 544479b..c334c34 100644
@@ -5,8 +5,7 @@ DEFAULT_PREFERENCE = "-1"
 SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz \
 file://stats.patch;p=1"
 
-PR = "r0"
-
+PR = "${INC_PR}.0"
 
 SRC_URI[md5sum] = "5598a5e500ad922e37b159dee72fc993"
 SRC_URI[sha256sum] = "594e78a66044898c321e378d47faf43b665b23ba638834d2787e344ba13e5132"
recipes/cairo/cairo_1.8.0.bb +1 -1
index a4225e8..e7cdeb7 100644
@@ -3,7 +3,7 @@ require cairo.inc
 SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz \
           "
 
-
+PR = "${INC_PR}.0"
 
 SRC_URI[md5sum] = "4ea70ea87b47e92d318d4e7f5b940f47"
 SRC_URI[sha256sum] = "827acee89ba3e8e762fbb23165cf8d455e7d95e1e50984e6882b2070a7f3abae"
recipes/cairo/cairo_1.8.10.bb +1 -2
index 884a6a7..8339b81 100644
@@ -1,6 +1,6 @@
 require cairo.inc
 
-PR = "r3"
+PR = "${INC_PR}.3"
 
 SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz;name=cairo \
            file://dolt-fix.patch \
@@ -9,4 +9,3 @@ SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz;name=cairo \
 
 SRC_URI[cairo.md5sum] = "b60a82f405f9400bbfdcf850b1728d25"
 SRC_URI[cairo.sha256sum] = "572bada15596ec8708392db1af8b93a1af75ca47690348154e2841f3a6f08439"
-
recipes/cairo/cairo_1.8.8.bb +1 -3
index de12f13..b0280a9 100644
@@ -1,4 +1,4 @@
-PR = "r1"
+PR = "${INC_PR}.1"
 
 require cairo.inc
 
@@ -6,7 +6,5 @@ SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz \
            file://dolt-fix.patch \
           "
 
-
-
 SRC_URI[md5sum] = "d3e1a1035ae563812d4dd44a74fb0dd0"
 SRC_URI[sha256sum] = "3c51d3de5dc4596e01a6675acd3c86c2c99c00f02e8fad5493758a29fe451c90"
recipes/cairo/cairomm_1.8.4.bb +2 -1
index 672dcb5..19b7618 100644
@@ -1,9 +1,10 @@
 require cairo.inc
 
+PR = "${INC_PR}.0"
+
 DEPENDS = "cairo libsigc++-2.0"
 DESCRIPTION = "C++ bindings for Cairo graphics library"
 
 SRC_URI = "http://cairographics.org/releases/cairomm-${PV}.tar.gz;name=archive"
 SRC_URI[archive.md5sum] = "559afbc47484ba3fad265e38a3dafe90"
 SRC_URI[archive.sha256sum] = "a28ec6d9af8f93d09076f32cd77de35f9d74a517def5dea12cb8cc2ce3a6c8f1"
-
Signature · 7 lines
1.7.0.4


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
#2 lore raw
Quoted 7 lines · Denys Dmytriyenko

An alternative solution, is to build libatomics-ops with emulated CAS (Compare And Swap), as otherwise those non-emulated primitives are not available on armel and sparc, according to [1]

Let me know if fixing libatomics-ops is more preferable and I'll make a patch. But I figured that since cairo used to build w/o atomic ops anyway, it's safer to just forcefully disable the check for them.

I am inclined to get the libatomic-ops if possible.

Quoted 6 lines

[1] http://us.generation-nt.com/answer/bug-566850-ao-compare-swap-full-not-available-armel-sparc-help-169012241.html

BTW, the correct name is libatomic-ops and not libatomics-ops, like it's named in OE...

#3 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 7 lines · Khem Raj
Quoted 6 lines · Denys Dmytriyenko

An alternative solution, is to build libatomics-ops with emulated CAS (Compare
And Swap), as otherwise those non-emulated primitives are not available on
armel and sparc, according to [1]

Quoted 7 lines
Quoted 5 lines

Let me know if fixing libatomics-ops is more preferable and I'll make a patch.
But I figured that since cairo used to build w/o atomic ops anyway, it's safer
to just forcefully disable the check for them.

I am inclined to get the libatomic-ops if possible.

Yes, me too

Quoted 10 lines
Quoted 10 lines

[1]
http://us.generation-nt.com/answer/bug-566850-ao-compare-swap-full-not-available-armel-sparc-help-169012241.html

BTW, the correct name is libatomic-ops and not libatomics-ops, like it's named
in OE...

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFNgbojMkyGM64RGpERAjL9AJ9VS80ebM6fnzCAusGTYRXp4p6E9wCfchxY QgG4eqdx70cqeSWwD0CP7o8=
=+AU8
-----END PGP SIGNATURE-----

#4 lore raw

Hi,

I am courious while cairo is using here libatomic-ops at all and not the kernel-handler or the gcc stuff for linux. Besides libatomic-ops is no pulseaudio project. Pulse only need it for mips and some other archs, for arm the kernel-handler is used.

So my sugestion is to find out which arch is needing and which not and adjust the build process accrodingly.

Bye Henning

#5 lore raw
In reply to Denys Dmytriyenko

Hi,

I looked deeper into the problem.
Cairo looks first for:

return __sync_fetch_and_add
__sync_val_compare_and_swap

and defines it as cairo_cv_atomic_primitives="Intel".

According to http://gcc.gnu.org/wiki/Atomic
arm and sh3/4 should work too.

If the configure compile fails
cairo is looking for libatomic-ops
support.

The libatomic-ops in oe is very old and misses diffrent bug fixes and is only needed for ppc and mips.

I will try to clean the stuff up this evening, which proably applies to pulse-audio too.

Bye Henning

#6 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 13 lines · Henning Heinold

Hi,

I looked deeper into the problem.
Cairo looks first for:

return __sync_fetch_and_add
__sync_val_compare_and_swap

and defines it as cairo_cv_atomic_primitives="Intel".

According to http://gcc.gnu.org/wiki/Atomic
arm and sh3/4 should work too.

Quoted 6 lines

If the configure compile fails
cairo is looking for libatomic-ops
support.

The libatomic-ops in oe is very old and misses diffrent bug fixes and is only needed for ppc and mips.

Is there a new version released yet or do you mean debian/fedora/suse bugfixes?

regards,

Koen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFNgh8KMkyGM64RGpERAlJzAJ0b6sByXKXffddvKChK+FpL7Hu4ngCfcQwQ ek1CXJV0RPVg0BNVudsCnl0=
=q81c
-----END PGP SIGNATURE-----

#7 lore raw
Quoted 6 lines

Is there a new version released yet or do you mean debian/fedora/suse bugfixes?

regards,

Koen

Hi,

I doubt there will be ever a new version again. But the cvs/svn was a bit newer and yes the patches from debian/fedora/suse or maybee cacao.

Bye Henning

#8 lore raw
In reply to Henning Heinold
Quoted 8 lines · Henning Heinold

Hi,

I looked deeper into the problem.
Cairo looks first for:

return __sync_fetch_and_add
__sync_val_compare_and_swap

Quoted 8 lines

and defines it as cairo_cv_atomic_primitives="Intel".

According to http://gcc.gnu.org/wiki/Atomic
arm and sh3/4 should work too.

If the configure compile fails
cairo is looking for libatomic-ops
support.

Similar to what I observed (if not reversed):

* If libatomic-ops is not available (no atomic_ops.h), it chooses/falls back to "Intel" provider (i.e. kernel/gcc), which also works on ARM. It's similar to --disable-atomic

* If it finds atomic_ops.h previously staged, it chooses that as a provider, but since libatomic-ops was not built with emulated CAS for ARM, it later fails with the build error.

Quoted 5 lines

The libatomic-ops in oe is very old and misses diffrent bug fixes and is only needed for ppc and mips.

I will try to clean the stuff up this evening, which proably applies to pulse-audio too.

If you are going to update libatomic-ops anyway, I won't bother adding AO_REQUIRE_CAS define myself. Thanks for looking into it.

Signature · 1 line
Denys
#9 lore raw
Quoted 18 lines · Denys Dmytriyenko
Quoted 8 lines · Henning Heinold

Hi,

I looked deeper into the problem.
Cairo looks first for:

return __sync_fetch_and_add
__sync_val_compare_and_swap

Quoted 8 lines

and defines it as cairo_cv_atomic_primitives="Intel".

According to http://gcc.gnu.org/wiki/Atomic
arm and sh3/4 should work too.

If the configure compile fails
cairo is looking for libatomic-ops
support.

Quoted 5 lines

Similar to what I observed (if not reversed):

* If libatomic-ops is not available (no atomic_ops.h), it chooses/falls back to "Intel" provider (i.e. kernel/gcc), which also works on ARM. It's similar to --disable-atomic

are you sure that --disable-atomic will still prod for atomics in gcc/kernel my guess is it
will disable atomics for good.

Quoted 22 lines

* If it finds atomic_ops.h previously staged, it chooses that as a provider, but since libatomic-ops was not built with emulated CAS for ARM, it later fails with the build error.

Quoted 5 lines

The libatomic-ops in oe is very old and misses diffrent bug fixes and is only needed for ppc and mips.

I will try to clean the stuff up this evening, which proably applies to pulse-audio too.

If you are going to update libatomic-ops anyway, I won't bother adding AO_REQUIRE_CAS define myself. Thanks for looking into it.

--
Denys

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#10 lore raw
Quoted 21 lines · Khem Raj
Quoted 20 lines · Denys Dmytriyenko
Quoted 8 lines · Henning Heinold

Hi,

I looked deeper into the problem.
Cairo looks first for:

return __sync_fetch_and_add
__sync_val_compare_and_swap

Quoted 8 lines

and defines it as cairo_cv_atomic_primitives="Intel".

According to http://gcc.gnu.org/wiki/Atomic
arm and sh3/4 should work too.

If the configure compile fails
cairo is looking for libatomic-ops
support.

Similar to what I observed (if not reversed):

Quoted 7 lines
Quoted 3 lines

* If libatomic-ops is not available (no atomic_ops.h), it chooses/falls back to "Intel" provider (i.e. kernel/gcc), which also works on ARM. It's similar to --disable-atomic

are you sure that --disable-atomic will still prod for atomics in gcc/kernel my guess is it
will disable atomics for good.

Ah, looking deeper into configure script and resulting config.h from both cases reveals the actual differences, so you are correct. Unfortunately, there is no way to specify --atomic=intel (or any other one) and it does the automatic guesswork selecting one or another. And if libatomic-ops is installed, there is no way to override it... So, looks like fixing libatomic-ops is the right way. I'll wait for Henning to update the recipe for libatomics-ops, otherwise I can submit a patch to define AO_REQUIRE_CAS emulation for the temporary solution.

Signature · 1 line
Denys
#11 lore raw
In reply to Denys Dmytriyenko
Quoted 5 lines · Denys Dmytriyenko

* Add --disable-atomic to configure, otherwise it finds previously staged libatomics-ops from pulseaudio, which doesn't have the necessary primitives: ....
* From my previous builds I see that cairo used to build before libatomics-ops was staged, avoiding this issue.

The observant reader would note that this is another example where per-recipe staging/sysroot would properly solve the problem.

/Esben