提问人:LeXav 提问时间:9/26/2023 最后编辑:LeXav 更新时间:9/27/2023 访问量:66
使用 g++ 12 或 13 的 BoringSSL:失败
BoringSSL with g++ 12 or 13: failure
问:
在 Debian 测试中使用高于 g++ 的 gcc 编译 BoringSSL 失败,并显示:
ninja: Entering directory `build/'
[459/751] Building C object crypto/CMakeFiles/crypto.dir/bytestring/cbb.c.o
FAILED: crypto/CMakeFiles/crypto.dir/bytestring/cbb.c.o
/usr/bin/cc -DBORINGSSL_IMPLEMENTATION -Ipath/to/lib/boringssl/include -Werror -Wformat=2 -Wsign-compare -Wwrite-strings -Wvla -Wshadow -Wtype-limits -ggdb -Wall -fvisibility=hidden -fno-common -Wno-free-nonheap-object -Wimplicit-fallthrough -Wformat-signedness -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes -D_XOPEN_SOURCE=700 -O3 -DNDEBUG -std=gnu11 -MD -MT crypto/CMakeFiles/crypto.dir/bytestring/cbb.c.o -MF crypto/CMakeFiles/crypto.dir/bytestring/cbb.c.o.d -o crypto/CMakeFiles/crypto.dir/bytestring/cbb.c.o -c path/to/lib/boringssl/crypto/bytestring/cbb.c
In function ‘cbb_add_child’,
inlined from ‘CBB_add_asn1’ at path/to/lib/boringssl/crypto/bytestring/cbb.c:361:10,
inlined from ‘CBB_add_asn1’ at path/to/lib/boringssl/crypto/bytestring/cbb.c:342:5,
inlined from ‘CBB_add_asn1_octet_string’ at path/to/lib/boringssl/crypto/bytestring/cbb.c:544:8:
path/to/lib/boringssl/crypto/bytestring/cbb.c:291:14: error: storing the address of local variable ‘child’ in ‘*cbb.child’ [-Werror=dangling-pointer=]
291 | cbb->child = out_child;
| ~~~~~~~~~~~^~~~~~~~~~~
path/to/lib/boringssl/crypto/bytestring/cbb.c: In function ‘CBB_add_asn1_octet_string’:
path/to/lib/boringssl/crypto/bytestring/cbb.c:543:7: note: ‘child’ declared here
543 | CBB child;
| ^~~~~
path/to/lib/boringssl/crypto/bytestring/cbb.c:542:36: note: ‘cbb’ declared here
542 | int CBB_add_asn1_octet_string(CBB *cbb, const uint8_t *data, size_t data_len) {
| ~~~~~^~~
In function ‘cbb_add_child’,
inlined from ‘CBB_add_asn1’ at path/to/lib/boringssl/crypto/bytestring/cbb.c:361:10,
inlined from ‘CBB_add_asn1’ at path/to/lib/boringssl/crypto/bytestring/cbb.c:342:5,
inlined from ‘CBB_add_asn1_bool’ at path/to/lib/boringssl/crypto/bytestring/cbb.c:555:8:
path/to/lib/boringssl/crypto/bytestring/cbb.c:291:14: error: storing the address of local variable ‘child’ in ‘*cbb.child’ [-Werror=dangling-pointer=]
291 | cbb->child = out_child;
| ~~~~~~~~~~~^~~~~~~~~~~
path/to/lib/boringssl/crypto/bytestring/cbb.c: In function ‘CBB_add_asn1_bool’:
path/to/lib/boringssl/crypto/bytestring/cbb.c:554:7: note: ‘child’ declared here
554 | CBB child;
| ^~~~~
path/to/lib/boringssl/crypto/bytestring/cbb.c:553:28: note: ‘cbb’ declared here
553 | int CBB_add_asn1_bool(CBB *cbb, int value) {
| ~~~~~^~~
cc1: all warnings being treated as errors
[472/751] Building CXX object CMakeFiles/ssl_test.dir/ssl/ssl_test.cc.o
ninja: build stopped: subcommand failed.
步骤:
git clone https://github.com/google/boringssl.git
cd boringssl
cmake -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_BUILD_TYPE=Release -B build -GNinja
ninja -C build
适用于 g++-11。没有尝试使用 gcc-10,因为我不在乎。
知道如何让它与 g++-12 或 13 一起使用吗?
谢谢
更新:
对于那些感兴趣的人,这是他们的错误跟踪器上的问题:
答: 暂无答案
上一个:设置了 N 位的跳转值?
评论
CBB_add_asn1
CBB_add_bytes
CBB_flush
-Wdangling-pointer