macos (Apple M1 )编译过程报错
macos (Apple M1 )编译过程报错 incubator-brpc/src/butil/time.h:223:11: error: invalid output constraint '=a' in asm : "=a" (lo), "=d" (hi) 请大佬们修复一下
m1是arm架构的,姑且添加了相关的支持,麻烦测试一下其他部分还有没有问题 @roczpwu https://github.com/VZIKL/incubator-brpc/commit/110d67077929222c627ff95310ea9ec8d76e7a15
报错结果
Generating src/idl_options.pb.cc /opt/homebrew/bin/protoc --cpp_out=./src --proto_path=./src --proto_path=/opt/homebrew/include/ src/idl_options.proto Compiling src/mcpack2pb/generator.o clang++ -c -I./src -I/opt/homebrew/include/ -I/usr/local/opt/openssl/include -DBRPC_WITH_GLOG=0 -DGFLAGS_NS=google -g -Wno-deprecated-declarations -Wno-inconsistent-missing-override -DBTHREAD_USE_FAST_PTHREAD_MUTEX -D__const__= -D_GNU_SOURCE -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG -DBRPC_REVISION="0.9.7|master|110d6707|2021-04-22T00:01:09+08:00" -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer -std=c++0x -msse4 -msse4.2 src/mcpack2pb/generator.cpp -o src/mcpack2pb/generator.o clang: warning: argument unused during compilation: '-msse4' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-msse4.2' [-Wunused-command-line-argument] In file included from src/mcpack2pb/generator.cpp:28: In file included from ./src/butil/file_util.h:28: In file included from ./src/butil/files/file.h:21: In file included from ./src/butil/files/scoped_file.h:11: In file included from ./src/butil/logging.h:33: ./src/butil/time.h:228:5: error: unknown type name 'uint32' uint32 pmccntr; ^ ./src/butil/time.h:229:5: error: unknown type name 'uint32' uint32 pmuseren; ^ ./src/butil/time.h:230:5: error: unknown type name 'uint32' uint32 pmcntenset; ^ ./src/butil/time.h:238:28: error: unknown type name 'int64' return static_cast
(pmccntr) * 64; // Should optimize to << 6 ^ 4 errors generated. make: *** [src/mcpack2pb/generator.o] Error 1
没注意类型,我重新更新了一下代码 找了台arm机编译测试了一下,跑了个基本的echo example看起来挺正常的 麻烦验证一下
@likunyao https://github.com/VZIKL/incubator-brpc/commit/55a6d100a9aeaa8253d380afe218dab43ab85637
还是不行
In file included from src/bthread/context.cpp:16: ./src/bthread/context.h:77:41: error: expected ';' after top level declarator intptr_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ; ./src/bthread/context.h:80:20: error: redefinition of 'BTHREAD_CONTEXT_CALL_CONVENTION' with a different type: 'bthread_fcontext_t' (aka 'void ') vs 'intptr_t' (aka 'long') bthread_fcontext_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ./src/bthread/context.h:77:10: note: previous definition is here intptr_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ./src/bthread/context.h:80:51: error: expected ';' after top level declarator bthread_fcontext_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ; 3 errors generated. make: *** [src/bthread/context.o] Error 1 make: *** Waiting for unfinished jobs.... In file included from src/bthread/bthread.cpp:25: In file included from ./src/bthread/task_group.h:26: In file included from ./src/bthread/task_control.h:31: In file included from ./src/bthread/task_meta.h:29: In file included from ./src/bthread/stack.h:28: ./src/bthread/context.h:77:41: error: expected ';' after top level declarator intptr_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ; ./src/bthread/context.h:80:20: error: redefinition of 'BTHREAD_CONTEXT_CALL_CONVENTION' with a different type: 'bthread_fcontext_t' (aka 'void ') vs 'intptr_t' (aka 'long') bthread_fcontext_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ./src/bthread/context.h:77:10: note: previous definition is here intptr_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ./src/bthread/context.h:80:51: error: expected ';' after top level declarator bthread_fcontext_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ; In file included from src/bthread/bthread.cpp:25: In file included from ./src/bthread/task_group.h:26: In file included from ./src/bthread/task_control.h:31: In file included from ./src/bthread/task_meta.h:29: In file included from ./src/bthread/stack.h:81: ./src/bthread/stack_inl.h:132:5: error: use of undeclared identifier 'bthread_jump_fcontext' bthread_jump_fcontext(&from->context, to->context, 0/not skip remained/); ^ In file included from src/bthread/butex.cpp:34: In file included from ./src/bthread/task_control.h:31: In file included from ./src/bthread/task_meta.h:29: In file included from ./src/bthread/stack.h:28: ./src/bthread/context.h:77:41: error: expected ';' after top level declarator intptr_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ; ./src/bthread/context.h:80:20: error: redefinition of 'BTHREAD_CONTEXT_CALL_CONVENTION' with a different type: 'bthread_fcontext_t' (aka 'void ') vs 'intptr_t' (aka 'long') bthread_fcontext_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ./src/bthread/context.h:77:10: note: previous definition is here intptr_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ./src/bthread/context.h:80:51: error: expected ';' after top level declarator bthread_fcontext_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ; In file included from src/bthread/butex.cpp:34: In file included from ./src/bthread/task_control.h:31: In file included from ./src/bthread/task_meta.h:29: In file included from ./src/bthread/stack.h:81: ./src/bthread/stack_inl.h:132:5: error: use of undeclared identifier 'bthread_jump_fcontext' bthread_jump_fcontext(&from->context, to->context, 0/not skip remained/); ^ ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stac... ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::SmallStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' ...T obj = new ((T)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::SmallStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::SmallStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::SmallStackClass::Wrapper, void ( )(long)>' requested here return butil::get_object(entry); ^ ./src/bthread/stack_inl.h:101:47: note: in instantiation of member function 'bthread::StackFactorybthread::SmallStackClass::get_stack' requested here return StackFactory ::get_stack(entry); ^ ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stac... ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::NormalStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' ...T* obj = new ((T*)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::NormalStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::NormalStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::NormalStackClass::Wrapper, void ()(long)>' requested here return butil::get_object (entry); ^ ./src/bthread/stack_inl.h:103:48: note: in instantiation of member function 'bthread::StackFactorybthread::NormalStackClass::get_stack' requested here return StackFactory obj = new ((T*)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;::get_stack(entry); ^ ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stac... ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::SmallStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' ...T
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::SmallStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::SmallStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::SmallStackClass::Wrapper, void ()(long)>' requested here return butil::get_object (entry); ^ ./src/bthread/stack_inl.h:101:47: note: in instantiation of member function 'bthread::StackFactorybthread::SmallStackClass::get_stack' requested here return StackFactory obj = new ((T*)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;::get_stack(entry); ^ ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stac... ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::LargeStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' ...T
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::LargeStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::LargeStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::LargeStackClass::Wrapper, void ()(long)>' requested here return butil::get_object (entry); ^ ./src/bthread/stack_inl.h:105:47: note: in instantiation of member function 'bthread::StackFactorybthread::LargeStackClass::get_stack' requested here return StackFactory obj = new ((T*)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;::get_stack(entry); ^ ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stac... ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::NormalStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' ...T
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::NormalStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::NormalStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::NormalStackClass::Wrapper, void ()(long)>' requested here return butil::get_object (entry); ^ ./src/bthread/stack_inl.h:103:48: note: in instantiation of member function 'bthread::StackFactorybthread::NormalStackClass::get_stack' requested here return StackFactory obj = new ((T*)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;::get_stack(entry); ^ 7 errors generated. make: *** [src/bthread/bthread.o] Error 1 ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stac... ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::LargeStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' ...T
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::LargeStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::LargeStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::LargeStackClass::Wrapper, void (*)(long)>' requested here return butil::get_object (entry); ^ ./src/bthread/stack_inl.h:105:47: note: in instantiation of member function 'bthread::StackFactorybthread::LargeStackClass::get_stack' requested here return StackFactory ::get_stack(entry); ^ 7 errors generated. make: *** [src/bthread/butex.o] Error 1 1 warning generated. make: *** wait: No child processes. Stop.
@likunyao 麻烦提供一下构建参数以及相关命令 我这边arm机器上使用 sh config_brpc.sh --headers=/usr/include --libs=/usr/lib && make -j64 是正常可用的 (用gcc/g++编译)
sh config_brpc.sh --headers=/opt/homebrew/include --libs=/opt/homebrew/lib --cc=clang --cxx=clang++ && make Apple clang version 12.0.0 (clang-1200.0.32.29)
@likunyao 看了下目前context的实现应该是只针对mac x86有编写 我先直接用宏隔开这部分代码 麻烦测试一下 https://github.com/VZIKL/incubator-brpc/commit/3c350c5ed7c00e3ff9ca40af40edb9e9124100a7
跟上次报错结果一样。。。
还是应该实现一下arm mac context的部分 我晚点写一下 @likunyao
https://github.com/VZIKL/incubator-brpc/commit/49db58dac288a7b145438af21ad30a57d19b54be @likunyao 帮忙测试一下看看有没有啥问题 借鉴了boost的context部分 也没啥太大改动 (说不定直接copy上面arm64的也能用
😳😳😳
./src/bthread/context.h:81:41: error: expected ';' after top level declarator intptr_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ; ./src/bthread/context.h:84:20: error: redefinition of 'BTHREAD_CONTEXT_CALL_CONVENTION' with a different type: 'bthread_fcontext_t' (aka 'void ') vs 'intptr_t' (aka 'long') bthread_fcontext_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ./src/bthread/context.h:81:10: note: previous definition is here intptr_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ./src/bthread/context.h:84:51: error: expected ';' after top level declarator bthread_fcontext_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ; ./src/bthread/context.h:91:2: error: #endif without #if #endif // BTHREAD_CONTEXT_H ^ In file included from src/bthread/bthread.cpp:25: In file included from ./src/bthread/task_group.h:26: In file included from ./src/bthread/task_control.h:31: In file included from ./src/bthread/task_meta.h:29: In file included from ./src/bthread/stack.h:81: ./src/bthread/stack_inl.h:132:5: error: use of undeclared identifier 'bthread_jump_fcontext' bthread_jump_fcontext(&from->context, to->context, 0/not skip remained/); ^ In file included from src/bthread/butex.cpp:34: In file included from ./src/bthread/task_control.h:31: In file included from ./src/bthread/task_meta.h:29: In file included from ./src/bthread/stack.h:28: ./src/bthread/context.h:81:41: error: expected ';' after top level declarator intptr_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ; ./src/bthread/context.h:84:20: error: redefinition of 'BTHREAD_CONTEXT_CALL_CONVENTION' with a different type: 'bthread_fcontext_t' (aka 'void ') vs 'intptr_t' (aka 'long') bthread_fcontext_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ./src/bthread/context.h:81:10: note: previous definition is here intptr_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ./src/bthread/context.h:84:51: error: expected ';' after top level declarator bthread_fcontext_t BTHREAD_CONTEXT_CALL_CONVENTION ^ ; ./src/bthread/context.h:91:2: error: #endif without #if #endif // BTHREAD_CONTEXT_H ^ In file included from src/bthread/butex.cpp:34: In file included from ./src/bthread/task_control.h:31: In file included from ./src/bthread/task_meta.h:29: In file included from ./src/bthread/stack.h:81: ./src/bthread/stack_inl.h:132:5: error: use of undeclared identifier 'bthread_jump_fcontext' bthread_jump_fcontext(&from->context, to->context, 0/not skip remained/); ^ ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stacksize, entry); ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::SmallStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' T obj = new ((T)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::SmallStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::SmallStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::SmallStackClass::Wrapper, void ()(long)>' requested here return butil::get_object (entry); ^ ./src/bthread/stack_inl.h:101:47: note: in instantiation of member function 'bthread::StackFactorybthread::SmallStackClass::get_stack' requested here return StackFactory obj = new ((T*)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;::get_stack(entry); ^ ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stacksize, entry); ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::NormalStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' T
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::NormalStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::NormalStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::NormalStackClass::Wrapper, void ()(long)>' requested here return butil::get_object (entry); ^ ./src/bthread/stack_inl.h:103:48: note: in instantiation of member function 'bthread::StackFactorybthread::NormalStackClass::get_stack' requested here return StackFactory obj = new ((T*)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;::get_stack(entry); ^ ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stacksize, entry); ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::SmallStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' T
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::SmallStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::SmallStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::SmallStackClass::Wrapper, void ()(long)>' requested here return butil::get_object (entry); ^ ./src/bthread/stack_inl.h:101:47: note: in instantiation of member function 'bthread::StackFactorybthread::SmallStackClass::get_stack' requested here return StackFactory obj = new ((T*)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;::get_stack(entry); ^ ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stacksize, entry); ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::NormalStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' T
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::NormalStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::NormalStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::NormalStackClass::Wrapper, void ()(long)>' requested here return butil::get_object (entry); ^ ./src/bthread/stack_inl.h:103:48: note: in instantiation of member function 'bthread::StackFactorybthread::NormalStackClass::get_stack' requested here return StackFactory obj = new ((T*)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;::get_stack(entry); ^ ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stacksize, entry); ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::LargeStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' T
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::LargeStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::LargeStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::LargeStackClass::Wrapper, void ()(long)>' requested here return butil::get_object (entry); ^ ./src/bthread/stack_inl.h:105:47: note: in instantiation of member function 'bthread::StackFactorybthread::LargeStackClass::get_stack' requested here return StackFactory obj = new ((T*)_cur_block->items + _cur_block->nitem) T CTOR_ARGS;::get_stack(entry); ^ ./src/bthread/stack_inl.h:58:23: error: use of undeclared identifier 'bthread_make_fcontext' context = bthread_make_fcontext(storage.bottom, storage.stacksize, entry); ^ ./src/butil/object_pool_inl.h:191:13: note: in instantiation of member function 'bthread::StackFactorybthread::LargeStackClass::Wrapper::Wrapper' requested here BAIDU_OBJECT_POOL_GET((a1)); ^ ./src/butil/object_pool_inl.h:163:70: note: expanded from macro 'BAIDU_OBJECT_POOL_GET' T
^ ./src/butil/object_pool_inl.h:238:24: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::LargeStackClass::Wrapper>::LocalPool::get<void ()(long)>' requested here return lp->get(arg1); ^ ./src/butil/object_pool.h:81:40: note: in instantiation of function template specialization 'butil::ObjectPool<bthread::StackFactorybthread::LargeStackClass::Wrapper>::get_object<void ()(long)>' requested here return ObjectPool::singleton()->get_object(arg1); ^ ./src/bthread/stack_inl.h:71:23: note: in instantiation of function template specialization 'butil::get_object<bthread::StackFactorybthread::LargeStackClass::Wrapper, void (*)(long)>' requested here return butil::get_object (entry); ^ ./src/bthread/stack_inl.h:105:47: note: in instantiation of member function 'bthread::StackFactorybthread::LargeStackClass::get_stack' requested here return StackFactory ::get_stack(entry); ^ 8 errors generated. make: *** [src/bthread/bthread.o] Error 1 8 errors generated. make: *** [src/bthread/butex.o] Error 1 1 warning generated.
@likunyao 瞎了(少删了一行endif 看看呗应该可以了 主要是没机器测试 https://github.com/VZIKL/incubator-brpc/commit/46ab26de83b6ce6213488b657feb27ae759059d3
老哥,还得麻烦你😭
Compiling src/bthread/context.o clang++ -c -I./src -I/opt/homebrew/include/ -I/usr/local/opt/openssl/include -DBRPC_WITH_GLOG=0 -DGFLAGS_NS=google -g -Wno-deprecated-declarations -Wno-inconsistent-missing-override -DBTHREAD_USE_FAST_PTHREAD_MUTEX -D__const__= -D_GNU_SOURCE -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG -DBRPC_REVISION="0.9.7|master|46ab26de|2021-05-02T23:12:29+08:00" -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer -std=c++0x -msse4 -msse4.2 src/bthread/context.cpp -o src/bthread/context.o clang: warning: argument unused during compilation: '-msse4' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-msse4.2' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-msse4' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-msse4.2' [-Wunused-command-line-argument]
:5:1: error: unknown directive .type bthread_jump_fcontext, %function ^ :36:14: error: invalid operand for instruction str x4, x0 ^ :63:1: error: unknown directive .size bthread_jump_fcontext,.-bthread_jump_fcontext ^ :65:19: error: unexpected token in '.section' directive .section .note.GNU-stack,"",%progbits ^ :70:1: error: unknown directive .type bthread_make_fcontext, %function ^ :89:1: error: unknown directive .size bthread_make_fcontext,.-bthread_make_fcontext ^ :91:19: error: unexpected token in '.section' directive .section .note.GNU-stack,"",%progbits ^ :81:5: error: unknown AArch64 fixup kind! adr x1, finish ^ 8 errors generated. make: *** [src/bthread/context.o] Error 1 make: *** Waiting for unfinished jobs....
@likunyao @roczpwu
https://github.com/VZIKL/incubator-brpc/commit/6bafcca7e53460fcb9269c748a0b89f57a3b2e4c
这个版本在m1正常构建 (感谢 https://github.com/shiptux 提供的m1 mac air环境)
就是跑好像有点问题 进程popen打开就掉进了ferror
771 src/butil/popen.cpp:173] Encountered error while reading for the pipe
编译能过,echo跑不起来
@likunyao 是的 我看到了 这个问题得查一下 跟上面的context部分应该是没啥关系的
Is there any updates? @VZIKL
I meet the same problem.
一样的问题 请问有更新么
一样的问题,编译不过,太难用了