Boost C++ Libraries: Ticket #11083: tools/build/src/tools/sun.jam needs additional -W0,-abiopt=mangle6 for C++ compilations https://svn.boost.org/trac10/ticket/11083 <ol><li>Description of the failure </li></ol><p> Several tests inside libs/icl/test directory fail with Oracle Studio 12.4 C++ compiler on Solaris producing error message similar to what one of those tests: libs/icl/test/fastest_interval_set_infix.cpp produces: </p> <blockquote> <p> "CC" -library=stlport4 -xO4 -mt -erroff=%none -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_TEST_NO_AUTO_LINK=1 -DDATE_TIME_INLINE -DNDEBUG -D<span class="underline">typeof</span>=<span class="underline">typeof</span> -I"../../.." -c -o "../../../bin.v2/libs/icl/test/fastest_interval_set_infix.test/sun/release/link-static/stdlib-sun-stlport/threading-multi/fastest_interval_set_infix_/fastest_interval_set_infix.o" "fastest_interval_set_infix_/fastest_interval_set_infix.cpp" </p> </blockquote> <p> "../../../boost/icl/concept/interval_set.hpp", line 187: Error: boost::icl::add_intersection&lt;boost::icl::interval_set&lt;boost::rational&lt;int&gt;, less, boost::icl::continuous_interval&lt;boost::rational&lt;int&gt;, less&gt;, allocator&gt;&gt;(boost::icl::interval_set&lt;boost::rational&lt;int&gt;, less, boost::icl::continuous_interval&lt;boost::rational&lt;int&gt;, less&gt;, allocator&gt;&amp;, const boost::icl::interval_set&lt;boost::rational&lt;int&gt;, less, boost::icl::continuous_interval&lt;boost::rational&lt;int&gt;, less&gt;, allocator&gt;&amp;, const boost::icl::continuous_interval&lt;boost::rational&lt;int&gt;, less&gt;&amp;) and boost::icl::add_intersection&lt;boost::icl::interval_set&lt;boost::rational&lt;int&gt;, less, boost::icl::continuous_interval&lt;boost::rational&lt;int&gt;, less&gt;, allocator&gt;&gt;(boost::icl::interval_set&lt;boost::rational&lt;int&gt;, less, boost::icl::continuous_interval&lt;boost::rational&lt;int&gt;, less&gt;, allocator&gt;&amp;, const boost::icl::interval_set&lt;boost::rational&lt;int&gt;, less, boost::icl::continuous_interval&lt;boost::rational&lt;int&gt;, less&gt;, allocator&gt;&amp;, const boost::rational&lt;int&gt;&amp;) have same extern name "<span class="underline">1cFboostDiclQadd_intersection4n0BMinterval_set4n0AIrational4Ci</span>nDstdEless3CTA<span class="underline">n0BTcontinuous_interval4n0C_n0E</span>_n0DJallocator3C3<span class="underline"></span>_6Fr3rk3r5_3_". </p> <ol start="2"><li>Cause of the failure. </li></ol><p> This is a name-mangling compiler bug that compiler developers can't fix without breaking compatibility. The bug exists on <a class="missing wiki">Solaris/Sparc</a>, and on Solaris x86 with -m32. The bug does not exist on Linux, or on Solaris x86 with -m64, because the bug was discovered before those platforms were supported. The workaround is to compile with -W0,-abiopt=mangle6, which is the default for the systems were the code works. When you use this option, you must recompile all C++ code and use the option everywhere. </p> <ol start="3"><li>Possible Solution. </li></ol><p> To replace one line inside tools/build/src/tools/sun.jam inside actions compile.c++ subroutine by adding -W0,-abiopt=mangle6 option into compilation instruction. Specifically, replace: </p> <blockquote> <p> "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(&lt;)" "$(&gt;)" </p> </blockquote> <p> with </p> <blockquote> <p> "$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -W0,-abiopt=mangle6 -c -o "$(&lt;)" "$(&gt;)" </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11083 Trac 1.4.3 Vladimir Prus Fri, 06 Mar 2015 20:17:08 GMT <link>https://svn.boost.org/trac10/ticket/11083#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11083#comment:1</guid> <description> <p> Hi, and thanks for the report. </p> <p> I would suggest that Boost's Jamroot might be a better place to add this option - if sun developers don't believe they can enable this by default, then I'm not sure Boost.Build should do so either. </p> <p> Could you send a pull request? </p> </description> <category>Ticket</category> </item> <item> <author>Sergey.Sprogis@…</author> <pubDate>Fri, 06 Mar 2015 22:05:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11083#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11083#comment:2</guid> <description> <blockquote class="citation"> <p> I would suggest that Boost's Jamroot might be a better place to add this option </p> </blockquote> <p> Your point against changing sun.jam is valid, and I would be happy to follow your suggestion. But I'm not familiar enough with Boost's Jamroot syntax/semantics . Could you be more specific, and provide me with some idea what should be changed inside boost/Jamroot so that adding -W0,-abiopt=mangle6 will work properly. It seems that current Jamroot content does not have similar code which I can use as an example. Thanks, </p> <p> Sergey </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Fri, 06 Mar 2015 22:16:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/11083#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11083#comment:3</guid> <description> <p> You'd want to add &lt;toolset&gt;sun:&lt;cxxflags&gt;-W0,-abiopt=mangle6 in the project requirements. Probably the usage-requirements as well. </p> </description> <category>Ticket</category> </item> </channel> </rss>