Opened 8 years ago

Last modified 8 years ago

#11083 new Bugs

tools/build/src/tools/sun.jam needs additional -W0,-abiopt=mangle6 for C++ compilations

Reported by: Sergey.Sprogis@… Owned by: Vladimir Prus
Milestone: To Be Determined Component: build
Version: Boost 1.57.0 Severity: Problem
Keywords: Cc: Aparna.Kumta@…

Description

  1. Description of the failure

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:

"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 -Dtypeof=typeof -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"

"../../../boost/icl/concept/interval_set.hpp", line 187: Error: boost::icl::add_intersection<boost::icl::interval_set<boost::rational<int>, less, boost::icl::continuous_interval<boost::rational<int>, less>, allocator>>(boost::icl::interval_set<boost::rational<int>, less, boost::icl::continuous_interval<boost::rational<int>, less>, allocator>&, const boost::icl::interval_set<boost::rational<int>, less, boost::icl::continuous_interval<boost::rational<int>, less>, allocator>&, const boost::icl::continuous_interval<boost::rational<int>, less>&) and boost::icl::add_intersection<boost::icl::interval_set<boost::rational<int>, less, boost::icl::continuous_interval<boost::rational<int>, less>, allocator>>(boost::icl::interval_set<boost::rational<int>, less, boost::icl::continuous_interval<boost::rational<int>, less>, allocator>&, const boost::icl::interval_set<boost::rational<int>, less, boost::icl::continuous_interval<boost::rational<int>, less>, allocator>&, const boost::rational<int>&) have same extern name "1cFboostDiclQadd_intersection4n0BMinterval_set4n0AIrational4CinDstdEless3CTAn0BTcontinuous_interval4n0C_n0E_n0DJallocator3C3_6Fr3rk3r5_3_".

  1. Cause of the failure.

This is a name-mangling compiler bug that compiler developers can't fix without breaking compatibility. The bug exists on Solaris/Sparc, 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.

  1. Possible Solution.

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:

"$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"

with

"$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -W0,-abiopt=mangle6 -c -o "$(<)" "$(>)"

Change History (3)

comment:1 by Vladimir Prus, 8 years ago

Hi, and thanks for the report.

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.

Could you send a pull request?

in reply to:  1 comment:2 by Sergey.Sprogis@…, 8 years ago

I would suggest that Boost's Jamroot might be a better place to add this option

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,

Sergey

comment:3 by Steven Watanabe, 8 years ago

You'd want to add <toolset>sun:<cxxflags>-W0,-abiopt=mangle6 in the project requirements. Probably the usage-requirements as well.

Note: See TracTickets for help on using tickets.