Closed romberli closed 5 years ago
很抱歉没有在mac上面编译过,该分支已不在维护,推荐切换到goInception
发现在mac上可以用gcc-5来编译, 具体工具链配置如下: cmake: /usr/local/Cellar/cmake/3.12.0/bin/cmake make: /usr/bin/make c compiler: /usr/local/Cellar/gcc@5/5.5.0_3/bin/gcc-5 c++ complier: /usr/local/Cellar/gcc@5/5.5.0_3/bin/g++-5 debugger: Bundled LLDB v7.0.1
在CMakeLists.txt添加了如下内容: SET(CMAKE_MACOSX_RPATH 0)
然后编译的时候报如下错误: [ 89%] Building CXX object sql/CMakeFiles/sql.dir/sql_lex.cc.o 4 warnings generated. [ 90%] Building CXX object sql/CMakeFiles/sql.dir/sql_list.cc.o warningwarning: : unknown warning option '-Wno-dev' [-Wunknown-warning-option]unknown warning option '-Wno-dev' [-Wunknown-warning-option]
/Users/romber/work/source_code/inception/sql/sql_help.cc:661:7: warning: unused variable 'count_topics' [-Wunused-variable] int count_topics, count_categories, error; ^ /Users/romber/work/source_code/inception/sql/sql_help.cc:656:17: warning: unused variable 'used_fields' [-Wunused-variable] st_find_field used_fields[array_elements(init_used_fields)]; ^ /Users/romber/work/source_code/inception/sql/sql_help.cc:654:13: warning: unused variable 'protocol' [-Wunused-variable] Protocol protocol= thd->protocol; ^ /Users/romber/work/source_code/inception/sql/sql_help.cc:824:1: warning: unused label 'error2' [-Wunused-label] error2: ^
~~ /Users/romber/work/source_code/inception/sql/sql_help.cc:664:13: warning: unused variable 'mem_root' [-Wunused-variable] MEM_ROOT mem_root= thd->mem_root; ^ /Users/romber/work/source_code/inception/sql/sql_help.cc:662:8: warning: unused variable 'mlen' [-Wunused-variable] uint mlen= strlen(mask); ^ /Users/romber/work/source_code/inception/sql/sql_help.cc:657:15: warning: unused variable 'leaves' [-Wunused-variable] TABLE_LIST leaves= 0; ^ /Users/romber/work/source_code/inception/sql/sql_help.cc:663:10: warning: unused variable 'i' [-Wunused-variable] size_t i; ^ /Users/romber/work/source_code/inception/sql/sql_help.cc:661:39: warning: unused variable 'error' [-Wunused-variable] int count_topics, count_categories, error; ^ /Users/romber/work/source_code/inception/sql/sql_help.cc:661:21: warning: unused variable 'count_categories' [-Wunused-variable] int count_topics, count_categories, error; ^ /Users/romber/work/source_code/inception/sql/sql_help.cc:33:29: warning: variable 'init_used_fields' is not needed and will not be emitted [-Wunneeded-internal-declaration] static struct st_find_field init_used_fields[]= ^ /Users/romber/work/source_code/inception/sql/sql_help.cc:87:13: warning: unused function 'init_fields' [-Wunused-function] static bool init_fields(THD thd, TABLE_LIST tables, ^ In file included from /Users/romber/work/source_code/inception/sql/sql_help.cc:20: In file included from /Users/romber/work/source_code/inception/sql/sql_base.h:21: In file included from /Users/romber/work/source_code/inception/sql/sql_class.h:38: /Users/romber/work/source_code/inception/sql/rpl_gtid.h:430:30: warning: private field 'atomic_lock' is not used [-Wunused-private-field] mutable my_atomic_rwlock_t atomic_lock; ^ 16 warnings generated. [ 90%] Building CXX object sql/CMakeFiles/sql.dir/sql_locale.cc.o warning: unknown warning option '-Wno-dev' [-Wunknown-warning-option] In file included from /Users/romber/work/source_code/inception/sql/sql_lex.cc:21: In file included from /Users/romber/work/source_code/inception/sql/unireg.h:173: /Users/romber/work/source_code/inception/sql/field.h:2268:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ /Users/romber/work/source_code/inception/sql/field.h:2282:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ In file included from /Users/romber/work/source_code/inception/sql/sql_list.cc:17: In file included from /Users/romber/work/source_code/inception/sql/unireg.h:173: /Users/romber/work/source_code/inception/sql/field.h:2268:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ /Users/romber/work/source_code/inception/sql/field.h:2282:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ /Users/romber/work/source_code/inception/sql/sql_insert.cc:415:10: warning: unused variable 'log_on' [-Wunused-variable] bool log_on= (thd->variables.option_bits & OPTION_BIN_LOG); ^ 3 warnings generated. [ 90%] Building CXX object sql/CMakeFiles/sql.dir/sql_parse.cc.o warning: unknown warning option '-Wno-dev' [-Wunknown-warning-option] /Users/romber/work/source_code/inception/sql/sql_insert.cc:3652:21: warning: unused variable 'killed_status' [-Wunused-variable] THD::killed_state killed_status= thd->killed; ^ /Users/romber/work/source_code/inception/sql/sql_insert.cc:4054:12: warning: unused variable 'thd' [-Wunused-variable] THD thd= const_cast<THD>(ptr->get_thd()); ^ /Users/romber/work/source_code/inception/sql/sql_insert.cc:4066:26: warning: unused variable 'table' [-Wunused-variable] TABLE const const table = tables; ^ /Users/romber/work/source_code/inception/sql/sql_insert.cc:4063:11: warning: variable 'error' is uninitialized when used here [-Wuninitialized] if (error) ^~~~~ /Users/romber/work/source_code/inception/sql/sql_insert.cc:4053:16: note: initialize the variable 'error' to silence this warning int error; ^ = 0 /Users/romber/work/source_code/inception/sql/sql_insert.cc:581:1: warning: unused function 'create_insert_stmt_from_insert_delayed' [-Wunused-function] create_insert_stmt_from_insert_delayed(THD thd, String *buf) ^ In file included from /Users/romber/work/source_code/inception/sql/sql_insert.cc:61: In file included from /Users/romber/work/source_code/inception/sql/sql_insert.h:19: In file included from /Users/romber/work/source_code/inception/sql/sql_class.h:38: /Users/romber/work/source_code/inception/sql/rpl_gtid.h:430:30: warning: private field 'atomic_lock' is not used [-Wunused-private-field] mutable my_atomic_rwlock_t atomic_lock; ^ In file included from /Users/romber/work/source_code/inception/sql/sql_locale.cc:24: In file included from /Users/romber/work/source_code/inception/sql/unireg.h:173: /Users/romber/work/source_code/inception/sql/field.h:2268:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ /Users/romber/work/source_code/inception/sql/field.h:2282:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ 10 warnings generated. [ 90%] Building CXX object sql/CMakeFiles/sql.dir/sql_plugin.cc.o warning: unknown warning option '-Wno-dev' [-Wunknown-warning-option] In file included from /Users/romber/work/source_code/inception/sql/sql_parse.cc:19: In file included from /Users/romber/work/source_code/inception/sql/unireg.h:173: /Users/romber/work/source_code/inception/sql/field.h:2268:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ /Users/romber/work/source_code/inception/sql/field.h:2282:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ In file included from /Users/romber/work/source_code/inception/sql/sql_lex.cc:22: In file included from /Users/romber/work/source_code/inception/sql/sql_class.h:38: /Users/romber/work/source_code/inception/sql/rpl_gtid.h:430:30: warning: private field 'atomic_lock' is not used [-Wunused-private-field] mutable my_atomic_rwlock_t atomic_lock; ^ In file included from /Users/romber/work/source_code/inception/sql/sql_plugin.cc:18: In file included from /Users/romber/work/source_code/inception/sql/unireg.h:173: /Users/romber/work/source_code/inception/sql/field.h:2268:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ /Users/romber/work/source_code/inception/sql/field.h:2282:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ In file included from /Users/romber/work/source_code/inception/sql/sql_locale.cc:26: In file included from /Users/romber/work/source_code/inception/sql/sql_class.h:38: /Users/romber/work/source_code/inception/sql/rpl_gtid.h:430:30: warning: private field 'atomic_lock' is not used [-Wunused-private-field] mutable my_atomic_rwlock_t atomic_lock; ^ 4 warnings generated. 4 warnings generated. [ 91%] Building CXX object sql/CMakeFiles/sql.dir/sql_prepare.cc.o [ 91%] Building CXX object sql/CMakeFiles/sql.dir/sql_rename.cc.o warning: unknown warning option '-Wno-dev' [-Wunknown-warning-option] warning: unknown warning option '-Wno-dev' [-Wunknown-warning-option] In file included from /Users/romber/work/source_code/inception/sql/sql_parse.cc:56: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/sstream:174: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ostream:142: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:744:22: error: expected ')' bool test(size_t __pos) const; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:744:10: note: to match this '(' bool test(size_t __pos) const; ^ /Users/romber/work/source_code/inception/include/my_global.h:468:19: note: expanded from macro 'test'define test(a) ((a) ? 1 : 0)
In file included from /Users/romber/work/source_code/inception/sql/sql_parse.cc:56: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/sstream:174: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ostream:142: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:744:10: error: expected ')' bool test(size_t __pos) const; ^ /Users/romber/work/source_code/inception/include/my_global.h:468:23: note: expanded from macro 'test'
define test(a) ((a) ? 1 : 0)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:744:10: note: to match this '(' /Users/romber/work/source_code/inception/include/my_global.h:468:18: note: expanded from macro 'test'
define test(a) ((a) ? 1 : 0)
In file included from /Users/romber/work/source_code/inception/sql/sql_parse.cc:56: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/sstream:174: In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/ostream:142: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:744:28: error: expected ';' at end of declaration list bool test(size_t pos) const; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:751:23: error: unknown type name 'size_t' bitset operator<<(size_t pos) const _NOEXCEPT; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:753:23: error: unknown type name 'size_t' bitset operator>>(size_t pos) const _NOEXCEPT; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:758:5: error: unknown type name 'size_t' size_t hash_code() const _NOEXCEPT {return base::hash_code();} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:769:11: error: expected ';' after expression size_t __rlen = _VSTD::min(n, char_traits<_CharT>::length(str)); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:769:12: error: use of undeclared identifier 'rlen' size_t rlen = _VSTD::min(n, char_traits<_CharT>::length(str)); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:770:10: error: unknown type name 'size_t' for (size_t i = 0; i < rlen; ++i) ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:770:32: error: use of undeclared identifier '__rlen' for (size_t i = 0; i < rlen; ++i) ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:774:11: error: expected ';' after expression size_t _Mp = _VSTD::min(__rlen, _Size); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:774:12: error: use of undeclared identifier '_Mp' size_t _Mp = _VSTD::min(rlen, _Size); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:774:29: error: use of undeclared identifier 'rlen' size_t _Mp = _VSTD::min(rlen, _Size); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:775:11: error: expected ';' after expression size_t i = 0; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:775:12: error: use of undeclared identifier 'i'; did you mean 'n'? size_t i = 0; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:766:64: note: 'n' declared here typename basic_string<_CharT>::size_type n, ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:776:12: error: use of undeclared identifier 'i' for (; __i < _Mp; ++i) ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:776:18: error: use of undeclared identifier '_Mp' for (; i < _Mp; ++i) ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:776:25: error: use of undeclared identifier 'i'; did you mean 'n'? for (; i < _Mp; ++i) ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:766:64: note: 'n' declared here typename basic_string<_CharT>::size_type n, ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/bitset:778:28: error: use of undeclared identifier '_Mp' _CharT c = __str[_Mp - 1 - i]; ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] In file included from /Users/romber/work/source_code/inception/sql/sql_prepare.cc:88: In file included from /Users/romber/work/source_code/inception/sql/unireg.h:173: /Users/romber/work/source_code/inception/sql/field.h:2268:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ /Users/romber/work/source_code/inception/sql/field.h:2282:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ In file included from /Users/romber/work/source_code/inception/sql/sql_plugin.cc:20: In file included from /Users/romber/work/source_code/inception/sql/sql_class.h:38: /Users/romber/work/source_code/inception/sql/rpl_gtid.h:430:30: warning: private field 'atomic_lock' is not used [-Wunused-private-field] mutable my_atomic_rwlock_t atomic_lock; ^ In file included from /Users/romber/work/source_code/inception/sql/sql_rename.cc:21: In file included from /Users/romber/work/source_code/inception/sql/unireg.h:173: /Users/romber/work/source_code/inception/sql/field.h:2268:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ /Users/romber/work/source_code/inception/sql/field.h:2282:55: warning: field 'dec' is uninitialized when used here [-Wuninitialized] len_arg + ((dec= normalize_dec(dec_arg)) ? dec + 1 : 0), ^ 3 warnings and 20 errors generated. make[3]: [sql/CMakeFiles/sql.dir/sql_parse.cc.o] Error 1 make[3]: Waiting for unfinished jobs.... 4 warnings generated. /Users/romber/work/source_code/inception/sql/sql_rename.cc:48:9: warning: unused variable 'rename_log_table' [-Wunused-variable] char rename_log_table[2]= {NULL, NULL}; ^ /Users/romber/work/source_code/inception/sql/sql_rename.cc:47:7: warning: unused variable 'to_table' [-Wunused-variable] int to_table; ^ /Users/romber/work/source_code/inception/sql/sql_prepare.cc:1721:1: warning: unused label 'error' [-Wunused-label] error: ^
~In file included from /Users/romber/work/source_code/inception/sql/sql_rename.cc:25: In file included from /Users/romber/work/source_code/inception/sql/sql_view.h:20: In file included from /Users/romber/work/source_code/inception/sql/sql_class.h:38: /Users/romber/work/source_code/inception/sql/rpl_gtid.h:430:30: warning: private field 'atomic_lock' is not used [-Wunused-private-field] mutable my_atomic_rwlock_t atomic_lock; ^ 6 warnings generated. /Users/romber/work/source_code/inception/sql/sql_prepare.cc:3051:7: warning: unused variable 'reprepare_attempt' [-Wunused-variable] int reprepare_attempt= 0; ^ /Users/romber/work/source_code/inception/sql/sql_prepare.cc:3049:22: warning: unused variable 'reprepare_observer' [-Wunused-variable] Reprepare_observer reprepare_observer; ^ /Users/romber/work/source_code/inception/sql/sql_prepare.cc:3070:1: warning: unused label 'reexecute' [-Wunused-label] reexecute: ^~~~~~ /Users/romber/work/source_code/inception/sql/sql_prepare.cc:3048:13: warning: unused variable 'MAX_REPREPARE_ATTEMPTS' [-Wunused-variable] const int MAX_REPREPARE_ATTEMPTS= 3; ^ /Users/romber/work/source_code/inception/sql/sql_prepare.cc:854:13: warning: unused function 'insert_params_with_log' [-Wunused-function] static bool insert_params_with_log(Prepared_statement stmt, uchar null_array, ^ /Users/romber/work/source_code/inception/sql/sql_prepare.cc:1187:13: warning: unused function 'insert_params_from_vars_with_log' [-Wunused-function] static bool insert_params_from_vars_with_log(Prepared_statement stmt, ^ /Users/romber/work/source_code/inception/sql/sql_prepare.cc:1247:13: warning: unused function 'mysql_test_do_fields' [-Wunused-function] static bool mysql_test_do_fields(Prepared_statement stmt, ^ /Users/romber/work/source_code/inception/sql/sql_prepare.cc:1390:13: warning: unused function 'mysql_test_create_view' [-Wunused-function] static bool mysql_test_create_view(Prepared_statement stmt) ^ /Users/romber/work/source_code/inception/sql/sql_prepare.cc:1438:13: warning: unused function 'mysql_test_multiupdate' [-Wunused-function] static bool mysql_test_multiupdate(Prepared_statement stmt, ^ /Users/romber/work/source_code/inception/sql/sql_prepare.cc:1475:13: warning: unused function 'mysql_test_multidelete' [-Wunused-function] static bool mysql_test_multidelete(Prepared_statement stmt, ^ /Users/romber/work/source_code/inception/sql/sql_prepare.cc:1540:13: warning: unused function 'mysql_test_insert_select' [-Wunused-function] static bool mysql_test_insert_select(Prepared_statement *stmt, ^ In file included from /Users/romber/work/source_code/inception/sql/sql_prepare.cc:89: In file included from /Users/romber/work/source_code/inception/sql/sql_class.h:38: /Users/romber/work/source_code/inception/sql/rpl_gtid.h:430:30: warning: private field 'atomic_lock' is not used [-Wunused-private-field] mutable my_atomic_rwlock_t atomic_lock; ^ 16 warnings generated. make[2]: [sql/CMakeFiles/sql.dir/all] Error 2 make[1]: [sql/CMakeFiles/Inception.dir/rule] Error 2 make: *** [Inception] Error 2