Boost C++ Libraries: Ticket #7140: asio fenced_block should use gcc builtin atomics when available on ARM https://svn.boost.org/trac10/ticket/7140 <p> I am the lucky owner of a Raspberry Pi, and I have been trying to compile some code that uses boost asio on it (with the Raspbian armhf distro with boost 1.49 and gcc 4.6.3). </p> <p> I get a lot of "Warning: swp{b} use is deprecated for this architecture", some of which originate from gcc_arm_fenced_block.hpp. </p> <p> After a bit of looking around I realized that gcc 4.6.3 actually has support for the builtin atomics on this platform, so that gcc_sync_fenced_block.hpp could be used intead of trying to fix the assembler stuff in gcc_arm_fenced_block.hpp. </p> <p> So I propose the following fix to fenced_block.hpp: </p> <pre class="wiki">28c28 &lt; #elif defined(__GNUC__) &amp;&amp; defined(__arm__) --- &gt; #elif defined(__GNUC__) &amp;&amp; defined(__arm__) &amp;&amp; !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) 57c57 &lt; #elif defined(__GNUC__) &amp;&amp; defined(__arm__) --- &gt; #elif defined(__GNUC__) &amp;&amp; defined(__arm__) &amp;&amp; !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) </pre><p> Basically just skips using the gcc_arm_fenced_block if __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is defined, and lets the _sync_ one get used instead. </p> <p> Of course I know that the __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is actually not defined for all gcc versions where the builtins are available, but here we at least will use them when that symbol is defined, rather than not at all. </p> <p> I will write a similar ticket for boost smart_ptr, which suffers the same problem. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7140 Trac 1.4.3 lars@… Tue, 17 Jul 2012 11:28:28 GMT <link>https://svn.boost.org/trac10/ticket/7140#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7140#comment:1</guid> <description> <p> The smart_ptr ticket is <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7141" title="#7141: Bugs: smart_ptr sp_has_sync.hpp should use gcc builtin atomics when ... (closed: fixed)">#7141</a>, for reference. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Mon, 23 Jul 2012 11:03:34 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7140#comment:2 https://svn.boost.org/trac10/ticket/7140#comment:2 <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> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/79694" title="Merge from trunk: * Decorate GCC attribute names with underscores to ...">[79694]</a>) Merge from trunk: </p> <ul><li>Decorate GCC attribute names with underscores to prevent interaction with user-defined macros. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6415" title="#6415: Bugs: Use attribute names with underscores for GCC (closed: fixed)">#6415</a> </li></ul><ul><li>Add missing #include of &lt;cctype&gt;, needed for some versions of MinGW. </li></ul><ul><li>Use gcc's atomic builtins on arm, when available. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7140" title="#7140: Bugs: asio fenced_block should use gcc builtin atomics when available on ARM (closed: fixed)">#7140</a>. </li></ul> Ticket