Bug #70751 MySQL cannot be built with libc++
Submitted: 28 Oct 2013 15:56 Modified: 28 Oct 2013 16:50
Reporter: Sergei Glushchenko (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.6.14 OS:Mac OS X (10.9)
Assigned to: CPU Architecture:Any

[28 Oct 2013 15:56] Sergei Glushchenko
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++
[28 Oct 2013 16:50] Miguel Solorzano
Thank you for the bug report. Duplicate of http://bugs.mysql.com/bug.php?id=70542 .