Boost C++ Libraries: Ticket #10446: boost 1.56 compile fail with atomics failure https://svn.boost.org/trac10/ticket/10446 <p> using gcc 4.9.1 with poky, cross compile boost 1.56 for s3c6410. -march=armv6 </p> <p> error info: libs/atomic/src/lockpool.cpp:127:5: error: 'thread_fence' is not a member of 'boost::atomics::detail' libs/atomic/src/lockpool.cpp:138:5: error: 'signal_fence' is not a member of 'boost::atomics::detail' </p> <p> after dig into it, I found that: the marco 'BOOST_ATOMIC_FLAG_LOCK_FREE' is 0, so it don't include 'operations_lockfree.hpp' which has 'thread_fence' and 'signal_fence', but pthread.h at line 21. </p> <p> in file 'caps_gcc_atomic.hpp', 'BOOST_ATOMIC_FLAG_LOCK_FREE' is set to '0', but at the end of 'caps_gcc_atomic.hpp', it defined 'BOOST_ATOMIC_THREAD_FENCE' as 2. </p> <p> so the conflict is: BOOST_ATOMIC_THREAD_FENCE and BOOST_ATOMIC_FLAG_LOCK_FREE </p> <p> I think 'BOOST_ATOMIC_THREAD_FENCE' should depend on 'BOOST_ATOMIC_FLAG_LOCK_FREE', do you think so? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10446 Trac 1.4.3 anonymous Fri, 19 Sep 2014 10:59:06 GMT <link>https://svn.boost.org/trac10/ticket/10446#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10446#comment:1</guid> <description> <p> I have the same problem building for raspberry pi target. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>mrwombat</dc:creator> <pubDate>Mon, 22 Sep 2014 09:41:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10446#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10446#comment:2</guid> <description> <p> Same problem here with raspberry pi, compiling with g++-4.8 (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2, more info: </p> <ul><li>32-bit : yes </li><li>arm : yes </li><li>lockfree boost::atomic_flag : no </li><li>has_icu builds : no </li></ul><p> warning: Graph library does not contain MPI-based parallel components. note: to enable them, add "using mpi ;" to your user-config.jam </p> <ul><li>zlib : yes </li><li>iconv (libc) : yes </li><li>icu : no </li><li>icu (lib64) : no </li><li>x86 : no </li><li>gcc visibility : yes </li><li>long double support : yes </li></ul><p> Error: gcc.compile.c++ /tmp/build-boost/boost/bin.v2/libs/atomic/build/gcc-4.8/release/threading-multi/lockpool.o libs/atomic/src/lockpool.cpp: In static member function ‘static void boost::atomics::detail::lockpool::thread_fence()’: libs/atomic/src/lockpool.cpp:127:5: error: ‘thread_fence’ is not a member of ‘boost::atomics::detail’ </p> <blockquote> <p> atomics::detail::thread_fence(memory_order_seq_cst); <sup> </sup></p> </blockquote> <p> libs/atomic/src/lockpool.cpp: In static member function ‘static void boost::atomics::detail::lockpool::signal_fence()’: libs/atomic/src/lockpool.cpp:138:5: error: ‘signal_fence’ is not a member of ‘boost::atomics::detail’ </p> <blockquote> <p> atomics::detail::signal_fence(memory_order_seq_cst); <sup> </sup></p> </blockquote> <blockquote> <p> "g++-4.8" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -std=c++11 -DBOOST_ALL_NO_LIB=1 -DBOOST_ATOMIC_DYN_LINK=1 -DBOOST_ATOMIC_SOURCE -DNDEBUG -I"." -c -o "/tmp/build-boost/boost/bin.v2/libs/atomic/build/gcc-4.8/release/threading-multi/lockpool.o" "libs/atomic/src/lockpool.cpp" </p> </blockquote> <p> ...failed gcc.compile.c++ /tmp/build-boost/boost/bin.v2/libs/atomic/build/gcc-4.8/release/threading-multi/lockpool.o... ...skipped &lt;p/tmp/build-boost/boost/bin.v2/libs/atomic/build/gcc-4.8/release/threading-multi&gt;libboost_atomic.so.1.56.0 for lack of &lt;p/tmp/build-boost/boost/bin.v2/libs/atomic/build/gcc-4.8/release/threading-multi&gt;lockpool.o... ...skipped &lt;pstage/lib&gt;libboost_atomic.so.1.56.0 for lack of &lt;p/tmp/build-boost/boost/bin.v2/libs/atomic/build/gcc-4.8/release/threading-multi&gt;libboost_atomic.so.1.56.0... ...skipped &lt;pstage/lib&gt;libboost_atomic.so for lack of &lt;pstage/lib&gt;libboost_atomic.so.1.56.0... </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Tue, 23 Sep 2014 06:47:30 GMT</pubDate> <title>cc changed https://svn.boost.org/trac10/ticket/10446#comment:3 https://svn.boost.org/trac10/ticket/10446#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">Andrey.Semashev@…</span> added </li> </ul> <p> @niqingliang2003: </p> <p> I suspect that for some reason the compiler doesn't support atomic bools, but does support some other size atomics. Could you attach the output of the following command: </p> <pre class="wiki">gcc -march=armv6 -dM -E - &lt; /dev/null </pre><p> Note the -march=armv6 argument - please specify it exactly as you do when compiling Boost (or don't specify it if you don't when building Boost). </p> <blockquote class="citation"> <p> I think 'BOOST_ATOMIC_THREAD_FENCE' should depend on 'BOOST_ATOMIC_FLAG_LOCK_FREE', do you think so? </p> </blockquote> <p> No, it shouldn't. These macros are responsible for different features that are strictly speaking unrelated. More practically, I guess, every platform that supports atomic instructions can implement fences. </p> <p> @mrwombat: You might need to explicitly add an -march=... argument. I'm not sure what target architecture is used by default. </p> Ticket niqingliang2003@… Thu, 25 Sep 2014 09:25:24 GMT attachment set https://svn.boost.org/trac10/ticket/10446 https://svn.boost.org/trac10/ticket/10446 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">s3c6410_atomic.txt</span> </li> </ul> <p> result of $CXX -march=armv6 -dM -E - &lt; /dev/null </p> Ticket niqingliang2003@… Thu, 25 Sep 2014 09:28:43 GMT <link>https://svn.boost.org/trac10/ticket/10446#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10446#comment:4</guid> <description> <p> I have uploaded the result of '$CXX -march=armv6 -dM -E - &lt; /dev/null'. Please see the attachment. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Sat, 27 Sep 2014 16:47:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10446#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10446#comment:5</guid> <description> <p> I've changed how the atomic backend treats cases when lesser-sized atomic ops are not supported while larger ones are. </p> <p> <a class="ext-link" href="https://github.com/boostorg/atomic/commit/415db7054723291042e4ff1ffa8fdd5bc8b07163"><span class="icon">​</span>https://github.com/boostorg/atomic/commit/415db7054723291042e4ff1ffa8fdd5bc8b07163</a> </p> <p> Please, see if it helps in your case. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrey Semashev</dc:creator> <pubDate>Wed, 01 Oct 2014 08:57:53 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/10446#comment:6 https://svn.boost.org/trac10/ticket/10446#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket