fausturs opened a new issue, #2850: URL: https://github.com/apache/brpc/issues/2850
注意到,目前使用的BUILD.bazel文件中有这样一条宏定义 https://github.com/apache/brpc/blob/master/BUILD.bazel#L25 ``` -D__const__=__unused__ ``` 相关背景可以在issue:https://github.com/apache/brpc/issues/1693 与文档:https://github.com/apache/brpc/blob/master/docs/cn/thread_local.md#gcc4%E4%B8%8B%E7%9A%84errno%E9%97%AE%E9%A2%98 中找到介绍。 总结来说就是 > 务必在直接或间接使用bthread的项目的gcc编译选项中添加-D__const__=__unused__,即把__const__定义为一个无副作用的属性,避免gcc4做相关优化。 对于cmake来说,这个可能不好由brpc仓库进行实现。但对bazel来说,我们有办法由brpc仓库进行这个操作。 具体来说,bazel的cc_library提供一个参数defines, 用于给依赖(或者间接依赖)该目标的目标,添加宏定义。具体的,官方文档为: https://bazel.build/reference/be/c-cpp#cc_library <img width="894" alt="image" src="https://github.com/user-attachments/assets/be1eceae-a4da-4313-8cc3-fec1dfe19b90" /> 因此,brpc这边是否考虑,给bthread这个cc_library,直接添加这个宏定义呢 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org