Your message dated Tue, 04 Mar 2014 15:34:04 +0000
with message-id <e1wkrm4-0001ik...@franck.debian.org>
and subject line Bug#733456: fixed in contextfree 3.0.5+dfsg1-2.1
has caused the Debian Bug report #733456,
regarding contextfree: FTBFS on mips/mipsel/sparc and m68k/sh4: undefined 
reference to `__sync_bool_compare_and_swap_8'
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
733456: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733456
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: contextfree
Version: 3.0.5+dfsg1-2
Severity: serious
Tags: upstream patch
Justification: fails to build from source (but built successfully in the past)

contextfree fails to build on mips/mipsel/sparc and m68k/sh4 with the
following error message:

| cc -Wl,-z,relro  objs/cfdg.o objs/Rand64.o objs/makeCFfilename.o 
objs/cfdgimpl.o objs/renderimpl.o objs/builder.o objs/shape.o objs/variation.o 
objs/countable.o objs/tempfile.o objs/aggCanvas.o objs/HSBColor.o 
objs/SVGCanvas.o objs/primShape.o objs/bounds.o objs/shapeSTL.o 
objs/tiledCanvas.o objs/astexpression.o objs/astreplacement.o 
objs/pathIterator.o objs/stacktype.o objs/CmdInfo.o objs/abstractPngCanvas.o 
objs/ast.o objs/ffCanvasDummy.o objs/pngCanvas.o objs/posixSystem.o objs/main.o 
objs/posixTimer.o objs/posixVersion.o objs/lex.yy.o objs/cfdg.tab.o 
objs/agg_trans_affine.o objs/agg_curves.o objs/agg_vcgen_contour.o 
objs/agg_vcgen_stroke.o objs/agg_bezier_arc.o objs/agg_color_rgba.o 
-Lsrc-ffmpeg/lib -L/usr/local/lib -lstdc++ -lpng -lm -fexceptions -o cfdg
| objs/posixSystem.o: In function `PosixSystem::tempFileForWrite(std::string&)':
| /«BUILDDIR»/contextfree-3.0.5+dfsg1/src-unix/posixSystem.cpp:126: warning: 
the use of `mktemp' is dangerous, better use `mkstemp' or `mkdtemp'
| objs/astreplacement.o: In function `AST::ASTcompiledPath::NextPathUID()':
| /«BUILDDIR»/contextfree-3.0.5+dfsg1/src-common/astreplacement.cpp:952: 
undefined reference to `__sync_fetch_and_add_8'
| /«BUILDDIR»/contextfree-3.0.5+dfsg1/src-common/astreplacement.cpp:952: 
undefined reference to `__sync_fetch_and_add_8'
| /«BUILDDIR»/contextfree-3.0.5+dfsg1/src-common/astreplacement.cpp:952: 
undefined reference to `__sync_fetch_and_add_8'
| objs/CmdInfo.o: In function `AST::CommandInfo::tryInit(unsigned int, 
AST::ASTcompiledPath*, double, AST::ASTpathCommand const*)':
| /«BUILDDIR»/contextfree-3.0.5+dfsg1/src-common/CmdInfo.cpp:61: undefined 
reference to `__sync_bool_compare_and_swap_8'
| collect2: error: ld returned 1 exit status

The problem is that the new version of contextfree try to uses 64-bit GCC
legacy atomic builtins [1], which are not all available on all
architectures.

The solution to this problem is to use the new GCC atomics, similar
to the C11 ones [2]. For that you need GCC 4.8, which is unfortunately
not the default on all architectures, and to link with libatomic. The
later library provides a fallback implementation if a given atomic bultin
is not available natively, which is usually the case for 64-bit atomics
on 32-bit platforms.

The patch below implements that and should fix the problem, though I
have only tested it on mips so far.

--- contextfree-3.0.5+dfsg1/debian/control
+++ contextfree-3.0.5+dfsg1/debian/control
@@ -3,7 +3,7 @@
 Priority: extra
 Maintainer: Bram Senders <b...@luon.net>
 Uploaders: Paul van Tilburg <pau...@debian.org>
-Build-Depends: debhelper (>= 9), flex, bison, libpng-dev
+Build-Depends: debhelper (>= 9), flex, bison, libpng-dev, g++-4.8
 Standards-Version: 3.9.5
 Homepage: http://contextfreeart.org/
 
--- contextfree-3.0.5+dfsg1/debian/patches/04-gcc-4.8-atomic.patch
+++ contextfree-3.0.5+dfsg1/debian/patches/04-gcc-4.8-atomic.patch
@@ -0,0 +1,36 @@
+--- a/Makefile
++++ b/Makefile
+@@ -45,7 +45,7 @@
+ AGG_SRCS = agg_trans_affine.cpp agg_curves.cpp agg_vcgen_contour.cpp \
+     agg_vcgen_stroke.cpp agg_bezier_arc.cpp agg_color_rgba.cpp
+ 
+-LIBS = stdc++ png m
++LIBS = stdc++ png m atomic
+ 
+ #
+ # FFmpeg support
+--- a/src-common/CmdInfo.cpp
++++ b/src-common/CmdInfo.cpp
+@@ -58,7 +58,10 @@
+                                           
(__int64)(std::numeric_limits<uint64_t>::max()), 
+                                           (__int64)0) == 
(__int64)(std::numeric_limits<uint64_t>::max()))
+ #else
+-        if (__sync_bool_compare_and_swap(&mPathUID, 
std::numeric_limits<UIDtype>::max(), (UIDtype)0))
++        const UIDtype expected = std::numeric_limits<UIDtype>::max();
++        const UIDtype desired = 0;
++        if (__atomic_compare_exchange(&mPathUID, &expected, &desired,
++                                      false, __ATOMIC_SEQ_CST, 
__ATOMIC_SEQ_CST))
+ #endif
+             init(i, path, w, c);
+     }
+--- a/src-common/astreplacement.cpp
++++ b/src-common/astreplacement.cpp
+@@ -949,7 +949,7 @@
+                 return (uint64_t)next;
+         } while (true);
+ #else
+-        return __sync_fetch_and_add(&GlobalPathUID, (CommandInfo::UIDtype)1);
++        return __atomic_fetch_add (&GlobalPathUID, (CommandInfo::UIDtype)1, 
__ATOMIC_SEQ_CST);
+ #endif
+     }
+     
--- contextfree-3.0.5+dfsg1/debian/patches/series
+++ contextfree-3.0.5+dfsg1/debian/patches/series
@@ -1,3 +1,4 @@
 01_disable_ffmpeg_support.patch
 02_do_not_link_against_libz.patch
 03_fix-arch-native.patch
+04-gcc-4.8-atomic.patch
--- contextfree-3.0.5+dfsg1/debian/rules
+++ contextfree-3.0.5+dfsg1/debian/rules
@@ -1,4 +1,8 @@
 #!/usr/bin/make -f
+
+export CC=gcc-4.8
+export CXX=g++-4.8
+
 %:
        dh $@
 

[1] http://gcc.gnu.org/onlinedocs/gcc/_005f_005fsync-Builtins.html
[2] http://gcc.gnu.org/onlinedocs/gcc/_005f_005fatomic-Builtins.html

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: mips (mips64)

Kernel: Linux 3.2.0-4-5kc-malta
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

--- End Message ---
--- Begin Message ---
Source: contextfree
Source-Version: 3.0.5+dfsg1-2.1

We believe that the bug you reported is fixed in the latest version of
contextfree, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 733...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Anibal Monsalve Salazar <ani...@debian.org> (supplier of updated contextfree 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 04 Mar 2014 13:34:23 +0000
Source: contextfree
Binary: contextfree
Architecture: source mipsel
Version: 3.0.5+dfsg1-2.1
Distribution: unstable
Urgency: medium
Maintainer: Bram Senders <b...@luon.net>
Changed-By: Anibal Monsalve Salazar <ani...@debian.org>
Description: 
 contextfree - image generator based on context-free grammars
Closes: 733456
Changes: 
 contextfree (3.0.5+dfsg1-2.1) unstable; urgency=medium
 .
   * Non-maintainer upload.
   * Fix "FTBFS: undefined reference to `__sync_bool_compare_and_swap_8'"
     Add 04-gcc-4.8-atomic.patch
     Patch by Aurelien Jarno
     Closes: #733456
Checksums-Sha1: 
 085f25e754ab9f698a9f40cd486ac54beb36d49e 1837 contextfree_3.0.5+dfsg1-2.1.dsc
 a90d1192b7defd094d78a3f0c26abcc949381ef6 7816 
contextfree_3.0.5+dfsg1-2.1.debian.tar.xz
 149406a218b973b030d6dd9169080288e4c47320 245634 
contextfree_3.0.5+dfsg1-2.1_mipsel.deb
Checksums-Sha256: 
 883171060bce831393bc036f5d48fa0578cb2a3e1c0f5666ef9e86bf6db003c0 1837 
contextfree_3.0.5+dfsg1-2.1.dsc
 51f255695a387e76338df83bed4bf107f39fa95006fd1652493e8132e05691bd 7816 
contextfree_3.0.5+dfsg1-2.1.debian.tar.xz
 fda135c8816e156904eae1f0af39a2a9d0c40bdb891a977b036a44d7fa1afc61 245634 
contextfree_3.0.5+dfsg1-2.1_mipsel.deb
Files: 
 019532b2b6183cd374a19537640e2431 1837 graphics extra 
contextfree_3.0.5+dfsg1-2.1.dsc
 8a611b882178b6e451fb337318b92461 7816 graphics extra 
contextfree_3.0.5+dfsg1-2.1.debian.tar.xz
 a8e8a6aaf202b18f6764a6f021efcb12 245634 graphics extra 
contextfree_3.0.5+dfsg1-2.1_mipsel.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJTFdrmAAoJEHxWrP6UeJfYL+MQAL3dQBXYZd+nYxefLyldZMAN
yEckInl0mSuPSHAw0uVjaJMvRDNiS4jb99Tch97Gxm/YBVffGyWYhSeHu8LUNvSX
wjwNhLiUOcaQekteBIzyq9ciNyy+zi6sz96HrcsirkanhVs2J/yS4EQOTHZ6AWUP
gsYhYDGep+J3T7lV4NGAZwqC18S67ug90YQXLZZcnpcSDD5iUewQEj0I40CFgl8S
eox9WnMG2PHqrVcrfmTD2Qr+NXkVF/tlmkVpVgQhTaz6mcz99gLDnwa0Nk/9KqCO
+OLHAGRRb2knpImfzPQyX/+WXZmiAwlhaJZZpriNicGLGTraYksjCFIMaT1Q8S07
UoDPkXhiKUmme2CEhH+BlkpUuVAvJ3thIL2h1E4eYkXpuCXLMMkyci+1pKggBg9T
+DmTAjK7TPvae21rs6UG+mgG4vgHOYgzGrvzHeFHsb7HmmbEnh4x8eDZkixFU24z
RevzonoZsa2Ekb35eGzM776SUw57Un9gTBA+ez3K/swgcASn6JEqIZogrMRvoC1i
UzY6IkrU+0kbRO5kxfqZvy/c89VhWKKh6RxLOt2OMg+yo5qSmK1NC82BBbhF/o2y
lcHOIq+9Uwt6ypSCWFdsDocK0traCu/y7dX+4hvBuMXIItkytyafhXaQUsnNKEYS
k8S6ZhWQwYbk6Ft4rD6P
=1P/q
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to