libp2p / libp2p/cpp-libp2p

Configuration fails while compiling BoringSSL

未关闭
#347 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C++
星标
492
派生
130
PR 合并指标
30 天内没有已合并 PR

描述

Summary

Cmake fails to configure the build (GCC 15.2) due to a compilation error during BoringSSL:

make[3]: warning: -j8 forced in submake: resetting jobserver mode.
In file included from /xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/bcm.c:31:
/xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/../internal.h: In function ‘OPENSSL_memchr’:
/xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/../internal.h:1027:10: error: return discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
 1027 |   return memchr(s, c, n);
      |          ^~~~~~
cc1: all warnings being treated as errors
make[5]: *** [CMakeFiles/fipsmodule.dir/build.make:79: CMakeFiles/fipsmodule.dir/crypto/fipsmodule/bcm.c.o] Error 1

This is GCC 15.2.1, which defaults to gnu23, which imposes memchr() and others should return const pointers when passed arguments are const -- then compilation fails due to -Werror.

Expected behavior

The project would configure without problems.

Actual behavior

The project doesn't configure properly.

Relevant log output
make[3]: warning: -j8 forced in submake: resetting jobserver mode.
In file included from /xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/bcm.c:31:
/xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/../internal.h: In function ‘OPENSSL_memchr’:
/xxx/.hunter/_Base/15ca502/2341084/9613f97/Build/BoringSSL/Source/crypto/fipsmodule/../internal.h:1027:10: error: return discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
 1027 |   return memchr(s, c, n);
      |          ^~~~~~
cc1: all warnings being treated as errors
make[5]: *** [CMakeFiles/fipsmodule.dir/build.make:79: CMakeFiles/fipsmodule.dir/crypto/fipsmodule/bcm.c.o] Error 1
Possible Solution

The proper solution is BoringSSL upstream fixing their codebase to C23; or upstream properly setting -std=c17 or whatever they're using; or simply removing -Werror=discarded-qualifiers.

A workaround is to set -Wno-error=discarded-qualifiers during the build of this particular dependency, but I'm not sure how to do it with this Hunter thing. Any help is appreciated.

Version

v0.1.37

Would you like to work on fixing this bug ?

Maybe

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 GCC 15.2.1 复现 CMake 配置,并检查 Hunter 如何构建 BoringSSL 依赖项,尤其是报告的 internal.h 失败和警告标志。项目能够成功配置且不出现 discarded-qualifiers 错误,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
cmake, cpp
领域
build-system
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。