Bug #82347 Client libraries not buildable on Solaris 11 with Sun Studio using libCstd
Submitted: 26 Jul 2016 13:50 Modified: 4 Aug 2016 16:39
Reporter: Mauritz Sundell Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.7.5 OS:Any
Assigned to: CPU Architecture:Any

[26 Jul 2016 13:50] Mauritz Sundell
Description:
Although we do not support building MySQL using Sun Studio since 5.7, the client libraries for MySQL should still be buildable using Sun Studio both using stlport4 and libCstd.

cmake flags to use: cmake -DWITHOUT_SERVER=ON -DSUNPRO_CXX_LIBRARY=Cstd (or -DSUNPRO_CXX_LIBRARY=stlport4).

But since MySQL 5.7.5 building client libraries on Solaris 11 using Sun Studio fails.

For 5.7.5 it fails with (:
".../client/check/mysqlcheck.cc", line 523: Error: Could not find a match for std::vector<std::string>::vector(char**, char**) needed in main(int, char**).

For 5.7.6 it fails with:
".../libbinlogevents/src/control_events.cpp", line 345: Error: Could not find a match for std::vector<unsigned char>::insert(unsigned char*, const char*, const char*) needed in binary_log::Format_description_event::Format_description_event(const char*, unsigned, const binary_log::Format_description_event*).

".../client/check/mysqlcheck.cc", line 540: Error: Could not find a match for std::vector<std::string>::vector(char**, char**) needed in main(int, char**).

How to repeat:
Try build client libraries on Solaris 11 using Sun Studio version 12u2 or newer using libCstd.
Make sure Sun Studio programs cc and CC are found before GNU programs using PATH (or set environment CC/CXX to full path of cc resp. CC).
Build parameters needed for cmake:
$ cmake -DWITHOUT_SERVER=ON -DSUNPRO_CXX_LIBRARY=Cstd ...

Run make. And observe errors mentioned in Description above.

Suggested fix:
1. Make sure client libraries using Cstd and stlport4 is build regulary to detect breakage early.

2. Use methods of vector that are available both in stlport4 and Cstd, and comment why in source code so that no one changes it back later.
[26 Jul 2016 14:43] Mauritz Sundell
Posted by developer:
 
Other suggestions for client build (WITHOUT_SERVER=ON)
1) exclude build of mysqlcheck
2) exclude build of libbinlogevents

Note, the above suggestion comes solely from a technical point of view.
If actually considered, one also need to consider if they go along with the intention of WITHOUT_SERVER
[26 Jul 2016 15:46] Mauritz Sundell
Posted by developer:
 
Another suggestion is to add a new cmake parameter that only builds (and package) client libraries with needed include files.
Excluding both server and general client tools.
[2 Aug 2016 10:46] Tor Didriksen
Posted by developer:
 
Please note that 5.7 and trunk have both been ported to
SOLARIS STUDIO 12.5 AKA 5.14
(the entire server code, not just client libraries)

5.7 can be built with -DCMAKE_CXX_FLAGS=-std=c++03

trunk automatically picks -std=c++11
[4 Aug 2016 16:39] Paul Dubois
Posted by developer:
 
Noted in 5.7.15, 5.7.13-ndb-7.5.4 changelogs.

The client library failed to build on Solaris using the Cstd library.