Description:
libc++ is default C++ standard library on OS X Mavericks. Building MySQL fails as following:
Scanning dependencies of target archive
[ 22%] Building C object storage/archive/CMakeFiles/archive.dir/azio.c.o
[ 22%] Building CXX object storage/archive/CMakeFiles/archive.dir/ha_archive.cc.o
In file included from /Users/sergei/percona/repo/mysql56/storage/archive/ha_archive.cc:21:
In file included from /Users/sergei/percona/repo/mysql56/sql/sql_class.h:27:
In file included from /Users/sergei/percona/repo/mysql56/sql/log.h:19:
In file included from /Users/sergei/percona/repo/mysql56/sql/unireg.h:170:
In file included from /Users/sergei/percona/repo/mysql56/sql/structs.h:23:
In file included from /Users/sergei/percona/repo/mysql56/sql/sql_plugin.h:20:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:261:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__bit_reference:15:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/algorithm:594:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/memory:963:39: error:
expected unqualified-id
template <class _Up> static __two test(...);
^
/Users/sergei/percona/repo/mysql56/include/my_global.h:464:21: note: expanded from macro 'test'
#define test(a) ((a) ? 1 : 0)
^
...
How to repeat:
Biuld MySQL on OS X 10.9 with clang compiler using commands:
cmake .
make
workaround is to build with libstdc++:
cmake -DCMAKE_CXX_FLAGS="-stdlib=libstdc++" .
Suggested fix:
Make MySQL compatible with libc++