Boost C++ Libraries: Ticket #7141: smart_ptr sp_has_sync.hpp should use gcc builtin atomics when available on ARM https://svn.boost.org/trac10/ticket/7141 <p> I am the lucky owner of a Raspberry Pi, and I have been trying to compile some code that uses boost shared_ptr 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 spinlock_arm_gcc.hpp. </p> <p> I realized that this was fixed in 1.50, but 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 sp_has_sync.hpp should make smart_ptr use them instead of trying the assembler stuff in spinlock_arm_gcc.hpp. </p> <p> So I propose the following fix to sp_has_sync.hpp: </p> <pre class="wiki">#define BOOST_SP_HAS_SYNC + #if !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) + #if defined( __arm__ ) || defined( __armel__ ) #undef BOOST_SP_HAS_SYNC #endif + #endif // __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 + #if defined( __hppa ) || defined( __hppa__ ) #undef BOOST_SP_HAS_SYNC #endif </pre><p> I maybe more of the platforms can check for the builtins, but I leave that to those who know more about them... Also maybe the ..._SWAP_8 would have to be used for some of them 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 have written a similar ticket <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> for boost asio, which suffers a similar problem. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7141 Trac 1.4.3 lars@… Tue, 17 Jul 2012 11:29:12 GMT component changed; owner set https://svn.boost.org/trac10/ticket/7141#comment:1 https://svn.boost.org/trac10/ticket/7141#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">smart_ptr</span> </li> </ul> Ticket Peter Dimov Wed, 31 Oct 2012 20:37:23 GMT <link>https://svn.boost.org/trac10/ticket/7141#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7141#comment:2</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/81128" title="Define BOOST_SP_HAS_SYNC when __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is ...">[81128]</a>) Define BOOST_SP_HAS_SYNC when <span class="underline">GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is set. Refs <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>. </span></p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Wed, 14 Nov 2012 11:58:01 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7141#comment:3 https://svn.boost.org/trac10/ticket/7141#comment:3 <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/81334" title="Merged [81128] from trunk. Fixes #7141.">[81334]</a>) Merged <a class="changeset" href="https://svn.boost.org/trac10/changeset/81128" title="Define BOOST_SP_HAS_SYNC when __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is ...">[81128]</a> from trunk. Fixes <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>. </p> Ticket anonymous Sun, 17 May 2015 22:06:59 GMT <link>https://svn.boost.org/trac10/ticket/7141#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7141#comment:4</guid> <description> <p> erererer </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 23 Nov 2015 11:45:19 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7141#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7141#comment:5</guid> <description> <p> yes i do </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 27 Nov 2015 16:29:16 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7141#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7141#comment:6</guid> <description> <p> <a class="ext-link" href="http://www.w3c.br/pub/Main/TimonAnderson/1-cz10.html"><span class="icon">​</span>http://www.w3c.br/pub/Main/TimonAnderson/1-cz10.html</a> </p> </description> <category>Ticket</category> </item> </channel> </rss>