Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: <title>使用 Anolis OS 8.8 编译 obproxy。master分支,编译构建出现如下报错,请帮忙排查 #43

Open
angelra1994 opened this issue May 14, 2023 · 10 comments

Comments

@angelra1994
Copy link

If the question is concise and probably has a short answer, asking it in community Slack

Question

Environment

  • OS Version and CPU Arch(uname -a):

  • OB Version(LD_LIBRARY_PATH=../lib:$LD_LIBRARY_PATH ./observer -V):

image

image

[root@anolis-ob ~]# uname -a
Linux anolis-ob 5.10.134-13.an8.x86_64 oceanbase/oceanbase#1 SMP Mon Jan 9 10:39:46 CST 2023 x86_64 x86_64 x86_64 GNU/Linux

@angelra1994
Copy link
Author

CXXLD test_continuation
CXXLD test_protected_queue
CXXLD test_priority_event_queue
CXXLD test_io_buffer
CXXLD test_unix_net_processor
CXXLD test_unix_net
ld.lld: error: undefined symbol: testing::Message::GetString() const

referenced by gtest.h:323 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:323)
test_event_processor.o:(testing::AssertionResult::AppendMessage(testing::Message const&))

ld.lld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)

referenced by test_event_processor.cpp:147
test_event_processor.o:(oceanbase::obproxy::TestEventProcessor::check_start(oceanbase::obproxy::TestFuncParam*))
referenced by test_event_processor.cpp:152
test_event_processor.o:(oceanbase::obproxy::TestEventProcessor::check_start(oceanbase::obproxy::TestFuncParam*))
referenced by test_event_processor.cpp:156
test_event_processor.o:(oceanbase::obproxy::TestEventProcessor::check_start(oceanbase::obproxy::TestFuncParam*))
referenced 130 more times

ld.lld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)

referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_event_processor.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, long>(char const*, char const*, int const&, long const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_event_processor.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, long volatile>(char const*, char const*, int const&, long volatile const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_event_processor.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<unsigned int, unsigned int>(char const*, char const*, unsigned int const&, unsigned int const&))
referenced 2 more times
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1320:test_event_processor] 错误 1
make[3]: *** 正在等待未完成的任务....
ld.lld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_proxy_config.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, oceanbase::obproxy::obutils::ObProxyConfig::ObConfigTimeItem_proxy_info_check_interval>(char const*, char const*, int const&, oceanbase::obproxy::obutils::ObProxyConfig::ObConfigTimeItem_proxy_info_check_interval const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_proxy_config.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, oceanbase::obproxy::obutils::ObProxyConfig::ObConfigCapacityItem_proxy_mem_limited>(char const*, char const*, int const&, oceanbase::obproxy::obutils::ObProxyConfig::ObConfigCapacityItem_proxy_mem_limited const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_proxy_config.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, int>(char const*, char const*, int const&, int const&))
referenced 1 more times
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1376:test_proxy_config] 错误 1
ld.lld: error: undefined symbol: testing::Message::GetString() const
referenced by gtest.h:323 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:323)
test_event.o:(testing::AssertionResult::AppendMessage(testing::Message const&))

ld.lld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)

referenced by test_event.cpp:93
test_event.o:(oceanbase::obproxy::TestEvent::check_schedule_common(oceanbase::obproxy::TestFuncParam*, int))
referenced by test_event.cpp:94
test_event.o:(oceanbase::obproxy::TestEvent::check_schedule_common(oceanbase::obproxy::TestFuncParam*, int))
referenced by test_event.cpp:95
test_event.o:(oceanbase::obproxy::TestEvent::check_schedule_common(oceanbase::obproxy::TestFuncParam*, int))
referenced 50 more times

ld.lld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)

referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_event.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<long, long>(char const*, char const*, long const&, long const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_event.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, int>(char const*, char const*, int const&, int const&))
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1316:test_event] 错误 1
ld.lld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)
referenced by test_protected_queue.cpp:84
test_protected_queue.o:(oceanbase::obproxy::TestProtectedQueue::SetUp())
referenced by test_protected_queue.cpp:87
test_protected_queue.o:(oceanbase::obproxy::TestProtectedQueue::SetUp())
referenced by test_protected_queue.cpp:92
test_protected_queue.o:(oceanbase::obproxy::TestProtectedQueue::SetUp())
referenced 57 more times

ld.lld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)

referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_protected_queue.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, unsigned int>(char const*, char const*, int const&, unsigned int const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_protected_queue.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<long, long>(char const*, char const*, long const&, long const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_protected_queue.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, long>(char const*, char const*, int const&, long const&))
referenced 1 more times
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1368:test_protected_queue] 错误 1
ld.lld: error: undefined symbol: testing::Message::GetString() const
referenced by gtest.h:323 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:323)
test_ethread.o:(testing::AssertionResult::AppendMessage(testing::Message const&))

ld.lld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)

referenced by test_ethread.cpp:126
test_ethread.o:(oceanbase::obproxy::TestEThread::check_thread_spawn_thread_internal(oceanbase::obproxy::TestFuncParam*))
referenced by test_ethread.cpp:127
test_ethread.o:(oceanbase::obproxy::TestEThread::check_thread_spawn_thread_internal(oceanbase::obproxy::TestFuncParam*))
referenced by test_ethread.cpp:128
test_ethread.o:(oceanbase::obproxy::TestEThread::check_thread_spawn_thread_internal(oceanbase::obproxy::TestFuncParam*))
referenced 92 more times

ld.lld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)

referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_ethread.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, int>(char const*, char const*, int const&, int const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_ethread.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, long>(char const*, char const*, int const&, long const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_ethread.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<long, long>(char const*, char const*, long const&, long const&))
referenced 1 more times
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1312:test_ethread] 错误 1
ld.lld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)
referenced by test_continuation.cpp:104
test_continuation.o:(oceanbase::obproxy::TestContinuation_ObContinuation_all_Test::TestBody())
referenced by test_continuation.cpp:105
test_continuation.o:(oceanbase::obproxy::TestContinuation_ObContinuation_all_Test::TestBody())
referenced by test_continuation.cpp:114
test_continuation.o:(oceanbase::obproxy::TestContinuation_ObContinuation_all_Test::TestBody())
referenced 3 more times
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1304:test_continuation] 错误 1
ld.lld: error: undefined symbol: testing::Message::GetString() const
referenced by gtest.h:323 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:323)
test_priority_event_queue.o:(testing::AssertionResult::AppendMessage(testing::Message const&))

ld.lld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)

referenced by test_priority_event_queue.cpp:87
test_priority_event_queue.o:(oceanbase::obproxy::TestPriorityEventQueue::clear_priority_event_queue(oceanbase::obproxy::event::ObPriorityEventQueue*))
referenced by test_priority_event_queue.cpp:102
test_priority_event_queue.o:(oceanbase::obproxy::TestPriorityEventQueue::clear_event_arrays(oceanbase::obproxy::event::ObEvent**))
referenced by test_priority_event_queue.cpp:193
test_priority_event_queue.o:(oceanbase::obproxy::TestPriorityEventQueue::check_enqueue_result(long, oceanbase::obproxy::event::ObEvent*))
referenced 18 more times

ld.lld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)

referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_priority_event_queue.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, unsigned int>(char const*, char const*, int const&, unsigned int const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_priority_event_queue.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<long, unsigned int>(char const*, char const*, long const&, unsigned int const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_priority_event_queue.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<long, long long>(char const*, char const*, long const&, long long const&))
referenced 3 more times
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1364:test_priority_event_queue] 错误 1
ld.lld: error: undefined symbol: testing::Message::GetString() const
referenced by gtest.h:323 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:323)
test_unix_net_processor.o:(testing::AssertionResult::AppendMessage(testing::Message const&))

ld.lld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)

referenced by test_unix_net_processor.cpp:628
test_unix_net_processor.o:(oceanbase::obproxy::TestUnixNetProcessor::check_accept(oceanbase::obproxy::net::ObNetProcessor::ObAcceptOptions&, long))
referenced by test_unix_net_processor.cpp:756
test_unix_net_processor.o:(oceanbase::obproxy::TestUnixNetProcessor::common_hot_upgrade(char const*, int, long))
referenced by test_unix_net_processor.cpp:774
test_unix_net_processor.o:(oceanbase::obproxy::TestUnixNetProcessor::common_hot_upgrade(char const*, int, long))
referenced 13 more times

ld.lld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)

referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_unix_net_processor.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<long, long>(char const*, char const*, long const&, long const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_unix_net_processor.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, int>(char const*, char const*, int const&, int const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_unix_net_processor.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<oceanbase::obproxy::._333, int volatile>(char const*, char const*, oceanbase::obproxy::._333 const&, int volatile const&))
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1408:test_unix_net_processor] 错误 1
ld.lld: error: undefined symbol: testing::Message::GetString() const
referenced by gtest.h:323 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:323)
test_io_buffer.o:(testing::AssertionResult::AppendMessage(testing::Message const&))

ld.lld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)

referenced by test_io_buffer.cpp:96
test_io_buffer.o:(oceanbase::obproxy::TestIOBuffer::check_data_alloc(oceanbase::obproxy::event::ObIOBufferData*, long))
referenced by test_io_buffer.cpp:99
test_io_buffer.o:(oceanbase::obproxy::TestIOBuffer::check_data_alloc(oceanbase::obproxy::event::ObIOBufferData*, long))
referenced by test_io_buffer.cpp:104
test_io_buffer.o:(oceanbase::obproxy::TestIOBuffer::check_block_clear(oceanbase::obproxy::event::ObIOBufferBlock*))
referenced 78 more times

ld.lld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)

referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_io_buffer.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<long, long>(char const*, char const*, long const&, long const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_io_buffer.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<oceanbase::obproxy::event::ObAllocType, oceanbase::obproxy::event::ObAllocType>(char const*, char const*, oceanbase::obproxy::event::ObAllocType const&, oceanbase::obproxy::event::ObAllocType const&))
referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_io_buffer.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, long>(char const*, char const*, int const&, long const&))
referenced 1 more times
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1332:test_io_buffer] 错误 1
ld.lld: error: undefined symbol: testing::Message::GetString() const
referenced by gtest.h:323 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:323)
test_unix_net.o:(testing::AssertionResult::AppendMessage(testing::Message const&))

ld.lld: error: undefined symbol: testing::internal::GetBoolAssertionFailureMessage(testing::AssertionResult const&, char const*, char const*, char const*)

referenced by test_unix_net.cpp:710
test_unix_net.o:(oceanbase::obproxy::TestUnixNet::check_read_result(int))
referenced by test_unix_net.cpp:714
test_unix_net.o:(oceanbase::obproxy::TestUnixNet::check_read_result(int))
referenced by test_unix_net.cpp:718
test_unix_net.o:(oceanbase::obproxy::TestUnixNet::check_read_result(int))
referenced 16 more times

ld.lld: error: undefined symbol: testing::internal::EqFailure(char const*, char const*, std::string const&, std::string const&, bool)

referenced by gtest.h:1382 (/code/obproxy/deps/3rd/usr/local/oceanbase/deps/devel/include/gtest/gtest.h:1382)
test_unix_net.o:(testing::AssertionResult testing::internal::CmpHelperEQFailure<int, int>(char const*, char const*, int const&, int const&))
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1404:test_unix_net] 错误 1
make[3]: 离开目录“/code/obproxy/unittest/obproxy”
make[2]: *** [Makefile:359:all-recursive] 错误 1
make[2]: 离开目录“/code/obproxy/unittest”
make[1]: *** [Makefile:459:all-recursive] 错误 1
make[1]: 离开目录“/code/obproxy”
make: *** [Makefile:370:all] 错误 2

@angelra1994
Copy link
Author

obproxy的 build.sh 做了如下修改

image

@caifeizhi caifeizhi transferred this issue from oceanbase/oceanbase May 15, 2023
@longdafeng
Copy link
Member

@angelra1994 It seems you have fixed this issue. Could you please propose one pull request

@angelra1994
Copy link
Author

@angelra1994 It seems you have fixed this issue. Could you please propose one pull request

抱歉,目前暂未找到修复办法,但是有复现方法。

  1. 将 obproxy的 build.sh 做了如截图中的修改
  2. 执行 sh build.sh debug

@donghy-coredumped
Copy link

donghy-coredumped commented May 16, 2023

91b2414 这样试一试呢

@angelra1994
Copy link
Author

91b2414 这样试一试呢

@donghy-coredumped 好像还是报类似的错误

@angelra1994
Copy link
Author

目前看应该是 只有构建 foo_server 失败了
image
在 unittest/obproxy 目录中只有139个文件
image

@angelra1994
Copy link
Author

但是将 configure.ac 中 60行61行
AM_CXXFLAGS="${AM_CXXFLAGS} -fuse-ld=lld -ffunction-sections -Wl,--no-warn-symbol-ordering,--symbol-ordering-file,${ac_abs_confdir}/hotfuncs.txt"
AM_CFLAGS="${AM_CFLAGS} -fuse-ld=lld -ffunction-sections -Wl,--no-warn-symbol-ordering,--symbol-ordering-file,${ac_abs_confdir}/hotfuncs.txt"
如注释掉,则可以成功编译,如
image

在 unittest/obproxy 目录中是140个文件
image

我之前没有接触过c++,不了解其中机制。希望大佬们解惑

@donghy-coredumped
Copy link

donghy-coredumped commented May 17, 2023

91b2414 这样试一试呢

@donghy-coredumped 好像还是报类似的错误

./build.sh clean 之后再重新编译也还是报错吗?

@angelra1994
Copy link
Author

91b2414 这样试一试呢

@donghy-coredumped 好像还是报类似的错误

./build.sh clean 之后再重新编译也还是报错吗?
是的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants