Description:
It seems MySQL 5.6 does not provide any easy way to link against libCstd even for mysql client. This is what I see in cmake/build_configurations/compiler_options.cmake:
# Solaris flags
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
IF(CMAKE_SYSTEM_VERSION VERSION_GREATER "5.9")
# Link mysqld with mtmalloc on Solaris 10 and later
SET(WITH_MYSQLD_LDFLAGS "-lmtmalloc" CACHE STRING "")
ENDIF()
IF(CMAKE_C_COMPILER_ID MATCHES "SunPro")
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
SET(COMMON_C_FLAGS "-g -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic")
SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic -library=stlport4")
# We have to specify "-xO1" for DEBUG flags here,
# see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6879978
SET(CMAKE_C_FLAGS_DEBUG "-xO1 ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "-xO1 ${COMMON_CXX_FLAGS}")
IF(32BIT)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO2 ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO2 ${COMMON_CXX_FLAGS}")
ELSEIF(64BIT)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_CXX_FLAGS}")
ENDIF()
ELSE()
# Assume !x86 is SPARC
SET(COMMON_C_FLAGS "-g -Xa -xstrconst -mt")
SET(COMMON_CXX_FLAGS "-g0 -mt -library=stlport4")
IF(32BIT)
SET(COMMON_C_FLAGS "${COMMON_C_FLAGS} -xarch=sparc")
SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} -xarch=sparc")
ENDIF()
SET(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "${COMMON_CXX_FLAGS}")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xO3 ${COMMON_CXX_FLAGS}")
ENDIF()
ENDIF()
ENDIF()
stlport4 seems to be "hardcoded" in some other places in the source code as well:
openxs@ao756:~/bzr/mysql-5.6$ grep -rn stlport4 *
cmake/readline.cmake:103: # /opt/studio12u2/lib/stlport4/v9/libstlport.so.1
cmake/build_configurations/compiler_options.cmake:98: SET(COMMON_CXX_FLAGS "-g0 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic -library=stlport4")
cmake/build_configurations/compiler_options.cmake:113: SET(COMMON_CXX_FLAGS "-g0 -mt -library=stlport4")
configure.cmake:85: "${CMAKE_CXX_FLAGS} -library=stlport4")
configure.cmake:95: SET(STLPORT_SUFFIX "lib/stlport4")
configure.cmake:97: SET(STLPORT_SUFFIX "lib/stlport4/v9")
configure.cmake:100: SET(STLPORT_SUFFIX "lib/stlport4/amd64")
mysql-test/lib/My/SafeProcess/CMakeLists.txt:29: STRING(REPLACE " -library=stlport4" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
mysql-test/lib/My/SafeProcess/CMakeLists.txt:30: STRING(REPLACE " -library=stlport4" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
mysql-test/lib/My/SafeProcess/CMakeLists.txt:31: STRING(REPLACE " -library=stlport4" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
openxs@ao756:~/bzr/mysql-5.6$
Users may have some reasons to want to link at least mysql client with libCstd. I do not see stlport4 hardcoded in MySQL 5.5, for example.
Please, provide some easy way to configure cmake to do this kind of a build.
How to repeat:
Try to build only mysql client from MySQL 5.6.x linked with libCstd instead of stlport4 on Solaris.
Suggested fix:
Either provide a way to select libCstd via cmake settings/options or document in the manual (http://dev.mysql.com/doc/refman/5.6/en/source-configuration-options.html maybe) why all/some binaries from MySQL 5.6 can not be built with libCstd on Solaris and how to built this way those binaries that can work with this library.