BE后端 C++编译问题,主要是GCC11在编译DORIS后端时会报各种问题
1 brpc编译问题
- 1 undefined reference to `COMP_CTX_new'
/usr/bin/ld: t1_enc.c:(.text+0x8a6): undefined reference to `COMP_CTX_new'
/usr/bin/ld: t1_enc.c:(.text+0x986): undefined reference to `COMP_CTX_free'
/usr/bin/ld: t1_enc.c:(.text+0x9a5): undefined reference to `COMP_CTX_new'
/usr/bin/ld: apache-doris-0.15.0/thirdparty/installed/lib/libssl.a(ssl_lib.o): in function `SSL_set_fd':
ssl_lib.c:(.text+0x730): undefined reference to `BIO_s_socket'
/usr/bin/ld: apache-doris-0.15.0/thirdparty/installed/lib/libssl.a(ssl_lib.o): in function `SSL_set_wfd':
ssl_lib.c:(.text+0x7c5): undefined reference to `BIO_s_socket'
/usr/bin/ld: apache-doris-0.15.0/thirdparty/installed/lib/libssl.a(ssl_lib.o): in function `SSL_set_rfd':
ssl_lib.c:(.text+0x895): undefined reference to `BIO_s_socket'
/usr/bin/ld: apache-doris-0.15.0/thirdparty/installed/lib/libssl.a(ssl_lib.o): in function `ssl_clear_cipher_ctx':
ssl_lib.c:(.text+0x34a5): undefined reference to `COMP_CTX_free'
/usr/bin/ld: ssl_lib.c:(.text+0x34c1): undefined reference to `COMP_CTX_free'
主要是 -lssl 库顺序在-lcrypto库后面(顺序反了),可以手动修改brpc目录下的CMakeList.txt,修改第
if(WITH_MESALINK)
list(APPEND DYNAMIC_LIB ${MESALINK_LIB})
else()
message("dont use mesalink '\n\n\n' OPENSSL_SSL_LIBRARY ${OPENSSL_SSL_LIBRARY} '\n\n\n' ")
# list(APPEND DYNAMIC_LIB ${OPENSSL_SSL_LIBRARY}) #将这一行注释掉
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(DYNAMIC_LIB ${OPENSSL_SSL_LIBRARY} ${DYNAMIC_LIB} rt)
set(BRPC_PRIVATE_LIBS "${BRPC_PRIVATE_LIBS} -lrt")
主要是把OPENSSL_SSL_LIBRARY放在?DYNAMIC_LIB的最前面,这样能保证ssl在crypto前面
|