【问题标题】:Is it possible to see which bazel target propagates the -lpthread flag?是否可以查看哪个 bazel 目标传播 -lpthread 标志?
【发布时间】:2020-09-01 19:41:36
【问题描述】:

在使用 Bazel 使用自定义工具链(android arm64-v8a 目标)构建 TensorFlow 时,最终共享库依赖于 libpthread.so,即使 Android 构建不需要它。该库使用具有相同名称的虚拟库可以正常工作。

我想有一些外部依赖项会传播链接标志,因为我已经删除了 TensorFlow 存储库中所有出现的 lpthread/pthread

是否有可能以某种方式跟踪哪个目标使用 Bazel 添加了特定的链接标志?不幸的是,-s 标志只显示了最终的链接命令。

【问题讨论】:

  • aquery 可以提供帮助。您的目标及其依赖项 (bazel aquery 'deps(tgt)') 可以让您深入了解添加特定选项的过程。

标签: android tensorflow pthreads bazel


【解决方案1】:

bazel query 就是这个工具。此命令将在其链接选项中为您提供所有带有 -lpthread(或替代拼写如 -pthread-Wl,-lpthread)的传递依赖项:

bazel query 'attr(linkopts, "pthread", deps(//my:target))'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-03-30
    • 1970-01-01
    • 1970-01-01
    • 2015-03-01
    • 1970-01-01
    • 2015-05-08
    • 2017-12-05
    • 1970-01-01
    相关资源
    最近更新 更多