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

[Bug]: cmake指定Release编译报错 #276

Closed
dreamcmi opened this issue Jan 1, 2023 · 2 comments
Closed

[Bug]: cmake指定Release编译报错 #276

dreamcmi opened this issue Jan 1, 2023 · 2 comments

Comments

@dreamcmi
Copy link

dreamcmi commented Jan 1, 2023

What happened?

使用master分支编译xquic会出现错误
commit id 6348479fbd8611034dfd5e633b59ef31931da94b
系统Ubuntu 20.04 focal x86_64 Linux 5.15.0-56-generic
以下是编译命令

# 获取 XQUIC 源码
git clone https://github.com/alibaba/xquic.git
cd xquic

# 编译 BabaSSL
git clone -b 8.3-stable https://github.com/Tongsuo-Project/Tongsuo.git ./third_party/babassl
cd ./third_party/babassl/
./config --prefix=/usr/local/babassl
make -j
SSL_TYPE_STR="babassl"
SSL_PATH_STR="${PWD}"
SSL_INC_PATH_STR="${PWD}/include"
SSL_LIB_PATH_STR="${PWD}/libssl.a;${PWD}/libcrypto.a"
cd -

git submodule update --init --recursive
mkdir -p build; cd build
cmake -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
make

cmake日志输出如下

darren@darren-build-machine:~/xquic/xquic/build$ cmake -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
SSL_TYPE= babassl
SSL_PATH= /home/darren/xquic/xquic/third_party/babassl
SSL_LIB_PATH= /home/darren/xquic/xquic/third_party/babassl/libssl.a;/home/darren/xquic/xquic/third_party/babassl/libcrypto.a
SSL_INC_PATH= /home/darren/xquic/xquic/third_party/babassl/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/darren/xquic/xquic/build

Steps To Reproduce

cmake -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} ..
make

Relevant log output

darren@darren-build-machine:~/xquic/xquic/build$ make
Scanning dependencies of target xquic
[  0%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_conn.c.o
[  1%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_stream.c.o
[  2%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_request.c.o
[  3%] Building C object CMakeFiles/xquic.dir/src/http3/frame/xqc_h3_frame.c.o
[  4%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_header.c.o
[  4%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_ctx.c.o
[  5%] Building C object CMakeFiles/xquic.dir/src/http3/xqc_h3_defs.c.o
[  6%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_qpack.c.o
[  7%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_prefixed_int.c.o
[  8%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_prefixed_str.c.o
[  8%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_decoder.c.o
[  9%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_encoder.c.o
[ 10%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_rep.c.o
[ 11%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/xqc_ins.c.o
[ 12%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/stable/xqc_stable.c.o
[ 12%] Building C object CMakeFiles/xquic.dir/src/http3/qpack/dtable/xqc_dtable.c.o
[ 13%] Building C object CMakeFiles/xquic.dir/src/transport/xqc_engine.c.o
[ 14%] Building C object CMakeFiles/xquic.dir/src/transport/xqc_conn.c.o
[ 15%] Building C object CMakeFiles/xquic.dir/src/transport/xqc_client.c.o
In file included from /usr/include/string.h:495,
                 from /home/darren/xquic/xquic/src/common/xqc_str.h:8,
                 from /home/darren/xquic/xquic/src/common/xqc_common_inc.h:10,
                 from /home/darren/xquic/xquic/src/common/utils/var_buf/xqc_var_buf.h:8,
                 from /home/darren/xquic/xquic/src/http3/xqc_h3_stream.h:8,
                 from /home/darren/xquic/xquic/src/transport/xqc_client.c:6:
In function ‘strncpy’,
    inlined from ‘xqc_client_create_tls’ at /home/darren/xquic/xquic/src/transport/xqc_client.c:156:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/darren/xquic/xquic/src/transport/xqc_client.c: In function ‘xqc_client_create_tls’:
/home/darren/xquic/xquic/src/transport/xqc_client.c:149:16: note: length computed here
  149 |     alpn_cap = strlen(alpn) + 1;
      |                ^~~~~~~~~~~~
In file included from /usr/include/string.h:495,
                 from /home/darren/xquic/xquic/src/common/xqc_str.h:8,
                 from /home/darren/xquic/xquic/src/common/xqc_common_inc.h:10,
                 from /home/darren/xquic/xquic/src/common/utils/var_buf/xqc_var_buf.h:8,
                 from /home/darren/xquic/xquic/src/http3/xqc_h3_stream.h:8,
                 from /home/darren/xquic/xquic/src/transport/xqc_client.c:6:
In function ‘strncpy’,
    inlined from ‘xqc_client_create_tls’ at /home/darren/xquic/xquic/src/transport/xqc_client.c:166:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/darren/xquic/xquic/src/transport/xqc_client.c: In function ‘xqc_client_create_tls’:
/home/darren/xquic/xquic/src/transport/xqc_client.c:159:16: note: length computed here
  159 |     host_cap = strlen(hostname) + 1;
      |                ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [CMakeFiles/xquic.dir/build.make:297: CMakeFiles/xquic.dir/src/transport/xqc_client.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/xquic.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
darren@darren-build-machine:~/xquic/xquic/build$
@ruiqizhou
Copy link
Collaborator

#49

@dreamcmi
Copy link
Author

thanks

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

2 participants