Boost C++ Libraries: Ticket #3678: Build failure on SPARC64 architecture https://svn.boost.org/trac10/ticket/3678 <p> Boost 1.40.0 fail to build on SPARC64 machines. </p> <p> The issue arises when code of smart_ptr is assembled. The "boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp" file contains SPARC-specific assembly for atomic compare-and-swap implementation and assembler rejects the code generated by the compiler out of that function. The generated code contains a "cas" instruction where first operand is a memory reference with complex addressing (register and offset). According to the SPARC v9 manual only register containing stored address may go there. </p> <p> The patch for the issue was created, but a single test in "libs/smart_ptr/test" fails. </p> <p> The patch is at <a class="ext-link" href="http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/patch-boost_smart_ptr_detail_sp_counted_base_gcc_sparc.hpp"><span class="icon">​</span>http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/patch-boost_smart_ptr_detail_sp_counted_base_gcc_sparc.hpp</a> <br /> The bjam test log is at <a class="ext-link" href="http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/bjam-smart-ptr-test.log"><span class="icon">​</span>http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/bjam-smart-ptr-test.log</a> </p> <p> Environment: </p> <p> Operating system - FreeBSD 8.0-BETA4 sparc64 <br /> Compiler - c++ (GCC) 4.2.1 20070719 [FreeBSD] <br /> Assembler - GNU assembler 2.15 [FreeBSD] 2004-05-23 <br /> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3678 Trac 1.4.3 Peter Dimov Thu, 26 Nov 2009 18:21:23 GMT <link>https://svn.boost.org/trac10/ticket/3678#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3678#comment:1</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/57949" title="Fix SPARC asm operand failure. Refs #3678. Refs #3341.">[57949]</a>) Fix SPARC asm operand failure. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3678" title="#3678: Bugs: Build failure on SPARC64 architecture (closed: fixed)">#3678</a>. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3341" title="#3341: Bugs: sp_counted_base_gcc_sparc.hpp compile failure on gcc.4.2.3 w/-O2 (closed: fixed)">#3341</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Thu, 26 Nov 2009 18:25:39 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/3678#comment:2 https://svn.boost.org/trac10/ticket/3678#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> It is normal for spinlock_try_test to fail in single-threaded mode. I've committed the patch to trunk. But there are two more tests whose results I'd like to see, shared_ptr_mt_test.cpp and weak_ptr_mt_test.cpp. They are not part of the Jamfile though, and need to be compiled and run manually. </p> Ticket churanov.port.maintainer@… Fri, 27 Nov 2009 14:00:18 GMT <link>https://svn.boost.org/trac10/ticket/3678#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3678#comment:3</guid> <description> <p> Peter, </p> <p> I've created a makefile to build and run the three tests with proper compiler settings. Could you examine the makefile and log and confirm that compiler flags are correct and tests are actually passing? </p> <p> The machine is a SMP sparc64 (4 x 300 MHz). </p> <p> External files: The patch - <a class="ext-link" href="http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/patch-boost_smart_ptr_detail_sp_counted_base_gcc_sparc.hpp"><span class="icon">​</span>http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/patch-boost_smart_ptr_detail_sp_counted_base_gcc_sparc.hpp</a> <br /> The makefile - <a class="ext-link" href="http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/Makefile"><span class="icon">​</span>http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/Makefile</a> <br /> The output of "make test" - <a class="ext-link" href="http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/bjam-1.41-make-test.log"><span class="icon">​</span>http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/bjam-1.41-make-test.log</a> <br /> </p> <p> Alexander Churanov </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Fri, 27 Nov 2009 14:49:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3678#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3678#comment:4</guid> <description> <p> Everything looks fine. Can you please try the same at -O2 or -O3, and without -fno-inline? </p> </description> <category>Ticket</category> </item> <item> <author>churanov.port.maintainer@…</author> <pubDate>Mon, 30 Nov 2009 17:25:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3678#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3678#comment:5</guid> <description> <p> Peter, </p> <p> I've modified the makefile to accept optimization options on invocation and run with OPTIMIZATION='-O2' and OPTIMIZATION='-O3'. The output is much like the previous one (with -O0). </p> <p> External files: <br /> <br /> Makefile - <a class="ext-link" href="http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/Makefile2"><span class="icon">​</span>http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/Makefile2</a> <br /> Log with -O2 - <a class="ext-link" href="http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/smart_ptr_O2_test.log"><span class="icon">​</span>http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/smart_ptr_O2_test.log</a> <br /> Log with -O3 - <a class="ext-link" href="http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/smart_ptr_O3_test.log"><span class="icon">​</span>http://alexanderchuranov.com/boost-port/boost-1.41-sparc64/smart_ptr_O3_test.log</a> <br /> </p> <p> Does this output mean that it is safe to check-in the patch? </p> <p> Alexander Churanov </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Mon, 30 Nov 2009 17:52:05 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3678#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3678#comment:6</guid> <description> <p> The patch is already checked into trunk. I will now merge it into the release branch; the tests look OK. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 30 Nov 2009 18:58:12 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3678#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3678#comment:7</guid> <description> <p> I was meaning checking into the FreeBSD ports repository. :-) I'm sure that the next release of Boost will contain the patch. And I'm going to provide patches for 1.39 and 1.41 on FreeBSD. <br /> </p> <p> Thank you for cooperation! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Peter Dimov</dc:creator> <pubDate>Mon, 30 Nov 2009 20:17:16 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3678#comment:8 https://svn.boost.org/trac10/ticket/3678#comment:8 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</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/58063" title="Merge [57949] to release. Fixes #3678. Fixes #3341.">[58063]</a>) Merge <a class="changeset" href="https://svn.boost.org/trac10/changeset/57949" title="Fix SPARC asm operand failure. Refs #3678. Refs #3341.">[57949]</a> to release. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3678" title="#3678: Bugs: Build failure on SPARC64 architecture (closed: fixed)">#3678</a>. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3341" title="#3341: Bugs: sp_counted_base_gcc_sparc.hpp compile failure on gcc.4.2.3 w/-O2 (closed: fixed)">#3341</a>. </p> Ticket