gpt4 book ai didi

linker - 如何将共享库与 --as-needed 与 automake 链接?

转载 作者:行者123 更新时间:2023-12-05 00:03:34 26 4
gpt4 key购买 nike

如何将共享库与 --as-needed 链接使用 Automake?当我尝试将标志添加到 LDFLAGS 时,我看到了libtool如此称呼:

/bin/bash ../../libtool --mode=link ... -Wl,--as-needed ... dependencies

这会导致像这样调用 GCC:
gcc -shared ... dependencies ... -Wl,--as-needed ...

但这是错误的顺序。
  • 有没有办法用 Libtool 做到这一点?
  • 或者有没有一种使用 Automake 但没有 Libtool 来构建共​​享库的好方法? (过去我因为各种其他原因对 Libtool 感到沮丧......)

  • Debian 人员似乎也遇到了这个问题( bug report ),但我希望能够为我的项目修复这个问题,而不是弄乱我的系统(除非我误解了修复)。

    最佳答案

    您可以通过修改项目源中的 ltmain.sh 脚本来为您的项目修复该问题。您甚至可以将其添加为 autotools 引导的一部分,如下所示:
    https://meego.gitorious.org/tracker/tracker/commit/cf2ca3414aeba146dceacc5ecd84765f4c08a06f

    关于linker - 如何将共享库与 --as-needed 与 automake 链接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6852414/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com