sun toolset buggy and outdated?

I'm trying to test the new Oracle-solaris compiler but I'm running into Boost.Build issues. First off what looks like a bug, if I build with with b2 stdlib=native Then I *still* get stlport You can easily reproduce this on another platform with: cd libs/config/test ../../../b2 config_info toolset=sun stdlib=native -n -d2 which yields: sun.compile.c++ ..\..\..\bin.v2\libs\config\test\config_info.test\sun\debug\stdlib-sun-stlport\config_info.obj "CC" +d -library=stlport4 -g -erroff=%none -KPIC -DBOOST_ALL_NO_LIB=1 -I"..\..\.." -c -o "..\..\..\bin.v2\libs\config\test\config_info.test\sun\debug\stdlib-sun-stlport\config_info.obj" "config_info.cpp" Now for the outdated part: the oracle compiler (12.4) now supports three std lib options: 1) The default - I can't make this work in C++03 mode, but it's the only option that does work in C++11 mode (where it appears to be a recent GNU libstdc++ version). 2) STLPort - only works in C++03 mode. 3) Apache - only works in C++03 mode. So ideally we would probably have: stdlib=stlport, sets -library=stlport4 for both compile and link. stdlib=apache, sets -library=stdcxx4 for both compile and link stdlib=native, sets -std=c++11 for both compile and link. And yes I realise we're mixing up two different features here, but as they can't be mixed and matched anyway it at least gets things working. I guess the toolset should be renamed either "oracle" or "solaris" as well? If anyone has any ideas how to patch the toolset, I have a working virtual machine to test on (or you can do as I did and download a pre-build VirtualBox machine). Thanks in advance, John.

John Maddock wrote:
Now for the outdated part: the oracle compiler (12.4) now supports three std lib options:
1) The default - I can't make this work in C++03 mode, but it's the only option that does work in C++11 mode (where it appears to be a recent GNU libstdc++ version). 2) STLPort - only works in C++03 mode. 3) Apache - only works in C++03 mode.
For a fact-check, including what the default is, you might find this interesting: http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c69ec6f SolarisStudio: Use alternative standard library to build CMake. Thanks, Steve.

On 28/02/2015 12:39, Stephen Kelly wrote:
John Maddock wrote:
Now for the outdated part: the oracle compiler (12.4) now supports three std lib options:
1) The default - I can't make this work in C++03 mode, but it's the only option that does work in C++11 mode (where it appears to be a recent GNU libstdc++ version). 2) STLPort - only works in C++03 mode. 3) Apache - only works in C++03 mode.
For a fact-check, including what the default is, you might find this interesting:
http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c69ec6f SolarisStudio: Use alternative standard library to build CMake. Thanks, I think I'm on top of this now, and have submitted some PR's to fix the main issues.
For the record, as of Solaris Studio 12.4 there are 4 options: * C++03 mode, default std lib - a broken Rogue Wave version, this is the default. * C++03 mode, STLport. Requires -library=stlport4 * C++03 mode, Apache std lib. Requires -library=stdcxx4 * C++11 mode, GNU libstdc++, used when -std=c++11 is passed to the compiler. John.

John Maddock wrote:
For the record, as of Solaris Studio 12.4 there are 4 options:
* C++03 mode, default std lib - a broken Rogue Wave version, this is the default. * C++03 mode, STLport. Requires -library=stlport4 * C++03 mode, Apache std lib. Requires -library=stdcxx4 * C++11 mode, GNU libstdc++, used when -std=c++11 is passed to the compiler.
According to the documentation to which Stephen linked, there should also be 5. C++03 mode, GNU libstdc++, used when -std=c++03 is passed to the compiler.

On 28/02/2015 13:04, Peter Dimov wrote:
John Maddock wrote:
For the record, as of Solaris Studio 12.4 there are 4 options:
* C++03 mode, default std lib - a broken Rogue Wave version, this is the default. * C++03 mode, STLport. Requires -library=stlport4 * C++03 mode, Apache std lib. Requires -library=stdcxx4 * C++11 mode, GNU libstdc++, used when -std=c++11 is passed to the compiler.
According to the documentation to which Stephen linked, there should also be
5. C++03 mode, GNU libstdc++, used when -std=c++03 is passed to the compiler.
Ah, I missed that one. And I see the -library, -std and -compat command line options are all mutually incompatible and do slightly different things... just to keep us on our toes I guess! I'll update the PR for the toolset accordingly. Thanks, John.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

John Maddock wrote:
On 28/02/2015 13:04, Peter Dimov wrote:
John Maddock wrote:
For the record, as of Solaris Studio 12.4 there are 4 options:
* C++03 mode, default std lib - a broken Rogue Wave version, this is the default. * C++03 mode, STLport. Requires -library=stlport4 * C++03 mode, Apache std lib. Requires -library=stdcxx4 * C++11 mode, GNU libstdc++, used when -std=c++11 is passed to the compiler.
According to the documentation to which Stephen linked, there should also be
5. C++03 mode, GNU libstdc++, used when -std=c++03 is passed to the compiler.
Ah, I missed that one.
IOW, you didn't read what I linked you to :). I can't help feeling a little insulted, not that that's uncommon here ;p. Thanks, Steve.

On 2/28/2015 12:34 PM, John Maddock wrote:
On 28/02/2015 13:04, Peter Dimov wrote:
John Maddock wrote:
For the record, as of Solaris Studio 12.4 there are 4 options:
* C++03 mode, default std lib - a broken Rogue Wave version, this is the default. * C++03 mode, STLport. Requires -library=stlport4 * C++03 mode, Apache std lib. Requires -library=stdcxx4 * C++11 mode, GNU libstdc++, used when -std=c++11 is passed to the compiler.
According to the documentation to which Stephen linked, there should also be
5. C++03 mode, GNU libstdc++, used when -std=c++03 is passed to the compiler.
Ah, I missed that one. And I see the -library, -std and -compat command line options are all mutually incompatible and do slightly different things... just to keep us on our toes I guess!
I'll update the PR for the toolset accordingly.
I have tried to get Solaris Studio 12.4 to compile/link in -std=c++11 mode but have never succeeded. There was a change to the top-level Boost Jamroot which had to be made, and which Steve Watanabe made in the 'develop' super-project, which was removing the lines there which hard-coded the stdlib for sun: # The standard library Sun compilers use by default has no chance # of working with Boost. Override it. <toolset>sun:<stdlib>sun-stlport Even after removing this if I compiled using -std=c++11 the compile went OK but as soon as it tried to link it was obviously not finding the standard library, even though I had libstdc++ installed under Linux. I still received linking errors of:
sun.link ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o: In function `__SLIP.INIT_A()': (.text+0x1b5): undefined reference to `std::ios_base::Init::Init()' ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o: In function `__SLIP.FINAL__A': test_after_array_elem.cpp:(.text+0x28f): undefined reference to `std::ios_base::Init::~Init()' ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o: In function `boost::report_errors()': /home/fceldiener/vcs/modular-boost/libs/vmd/test//../../../boost/detail/lightweight_test.hpp:173: undefined reference to `std::cerr' /home/fceldiener/vcs/modular-boost/libs/vmd/test//../../../boost/detail/lightweight_test.hpp:179: undefined reference to `std::cerr' /home/fceldiener/vcs/modular-boost/libs/vmd/test//../../../boost/detail/lightweight_test.hpp:179: undefined reference to `std::ostream::operator<<(int)' ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o: In function `boost::detail::error_impl(char const*, char const*, int, char const*)': /home/fceldiener/vcs/modular-boost/libs/vmd/test//../../../boost/detail/lightweight_test.hpp:117: undefined reference to `std::cerr' /home/fceldiener/vcs/modular-boost/libs/vmd/test//../../../boost/detail/lightweight_test.hpp:117: undefined reference to `std::ostream::operator<<(int)' ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o: In function `std::ostream & std::endl<char, std::char_traits<char> >(std::ostream &)': test_after_array_elem.cpp:(.text.std::ostream & std::endl<char, std::char_traits<char> >(std::ostream &)[std::ostream & std::endl<char, std::char_traits<char> >(std::ostream &)]+0x75): undefined reference to `std::ostream::put(char)' ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o: In function `std::ostream & std::operator<<<std::char_traits<char> >(std::ostream &, char const*)': /opt/oracle/solarisstudio12.4/lib/compilers/CC-gcc/include/c++/4.8.2/ostream:536: undefined reference to `std::ostream & std::__ostream_insert<char, std::char_traits<char> >(std::ostream &, char const*, long)' ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o: In function `std::ios::setstate(std::_Ios_Iostate)': test_after_array_elem.cpp:(.text.std::ios::setstate(std::_Ios_Iostate)[std::ios::setstate(std::_Ios_Iostate)]+0x7d): undefined reference to `std::ios::clear(std::_Ios_Iostate)' ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o: In function `std::ostream & std::flush<char, std::char_traits<char> >(std::ostream &)': test_after_array_elem.cpp:(.text.std::ostream & std::flush<char, std::char_traits<char> >(std::ostream &)[std::ostream & std::flush<char, std::char_traits<char> >(std::ostream &)]+0x37): undefined reference to `std::ostream::flush()' ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o: In function `std::ctype<char> const& std::__check_facet<std::ctype<char> >(std::ctype<char> const*)': /opt/oracle/solarisstudio12.4/lib/compilers/CC-gcc/include/c++/4.8.2/bits/basic_ios.h:49: undefined reference to `std::__throw_bad_cast()' ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o: In function `std::ctype<char>::widen(char) const': /opt/oracle/solarisstudio12.4/lib/compilers/CC-gcc/include/c++/4.8.2/bits/locale_facets.h:869: undefined reference to `std::ctype<char>::_M_widen_init() const'
"/opt/oracle/solarisstudio12.4/bin/CC" -g -m64 -KPIC -o "../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem" "../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o" -Bdynamic -lrt -Bstatic -Bdynamic
...failed sun.link ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem...
showing it could not find the standard library shared library as far as I can make out. Has anyone got this working with Sun ( now Oracle ) C++ on Linux ? Does this need anything else from Boost in order to tell the compiler which library to link with ? I have asked on the appropriate Oracle forum but I thought I would mention it here in case anyone has got this working.

AMDG On 03/26/2015 10:28 PM, Edward Diener wrote:
<snip> but as soon as it tried to link it was obviously not finding the standard library, even though I had libstdc++ installed under Linux.
I still received linking errors of:
sun.link ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem
../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o: In function `__SLIP.INIT_A()': (.text+0x1b5): undefined reference to `std::ios_base::Init::Init()' <snip>
"/opt/oracle/solarisstudio12.4/bin/CC" -g -m64 -KPIC -o "../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem" "../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o" -Bdynamic -lrt -Bstatic -Bdynamic
...failed sun.link ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem...
showing it could not find the standard library shared library as far as I can make out.
Did you set <linkflags> in addition to <cxxflags>? In Christ, Steven Watanabe

On 3/27/2015 1:44 AM, Steven Watanabe wrote:
AMDG
On 03/26/2015 10:28 PM, Edward Diener wrote:
<snip> but as soon as it tried to link it was obviously not finding the standard library, even though I had libstdc++ installed under Linux.
I still received linking errors of:
sun.link ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem
../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o:
In function `__SLIP.INIT_A()': (.text+0x1b5): undefined reference to `std::ios_base::Init::Init()' <snip>
"/opt/oracle/solarisstudio12.4/bin/CC" -g -m64 -KPIC -o "../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem"
"../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem.o"
-Bdynamic -lrt -Bstatic -Bdynamic
...failed sun.link ../../../bin.v2/libs/vmd/test/test_after_array_elem.test/sun-cxx11-12.4/debug/address-model-64/test_after_array_elem...
showing it could not find the standard library shared library as far as I can make out.
Did you set <linkflags> in addition to <cxxflags>?
No. Do you mean <linkflags>-std=c++11 ? Or something else to tell it what library to use ?

No.
Do you mean <linkflags>-std=c++11 ? Or something else to tell it what library to use ?
Steven is correct - you need to pass -std=c++11 (or whatever) to the linker as well as the compiler. Note that this is much improved in Git develop where the sun toolset now has inbuilt features for the various std lib's see https://github.com/boostorg/build/commit/259f7f7a96eed7ffb9f8a10f555b7aaa6f7.... Unfortunately for C++ 11 mode you still need to add an explicit -std=c++11 via cxxflags :( HTH, John.

On 3/27/2015 6:39 AM, John Maddock wrote:
No.
Do you mean <linkflags>-std=c++11 ? Or something else to tell it what library to use ?
Steven is correct - you need to pass -std=c++11 (or whatever) to the linker as well as the compiler.
Thanks, I discovered that was the situation.
Note that this is much improved in Git develop where the sun toolset now has inbuilt features for the various std lib's see https://github.com/boostorg/build/commit/259f7f7a96eed7ffb9f8a10f555b7aaa6f7.... Unfortunately for C++ 11 mode you still need to add an explicit -std=c++11 via cxxflags :(
Are the inbuilt features in sun.jam for the various std lib's meant to be used by the end-user in any way ?

John Maddock wrote:
For the record, as of Solaris Studio 12.4 there are 4 options:
* C++03 mode, default std lib - a broken Rogue Wave version, this is the default. * C++03 mode, STLport. Requires -library=stlport4 * C++03 mode, Apache std lib. Requires -library=stdcxx4 * C++11 mode, GNU libstdc++, used when -std=c++11 is passed to the compiler.
That's not what my CMake commit message says :). Thanks, Steve.
participants (5)
-
Edward Diener
-
John Maddock
-
Peter Dimov
-
Stephen Kelly
-
Steven Watanabe