【问题标题】:How to statically compile gerbv for Heroku如何为 Heroku 静态编译 gerbv
【发布时间】:2012-04-10 02:53:58
【问题描述】:

我正在尝试编译gerbv 2.6,以便将其包含在我的 Heroku bin 目录中,但我似乎无法弄清楚。我尝试了各种组合:

CFLAGS='-static  -static-libgcc  -static-libstdc++' ./configure
./configure --enable-static
./configure --enable-static=yes --enable-shared=no

但是在运行make 之后我总是得到:

src/gerbv: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x401fe83e54660a42e80e4c529fde85799728cdcb, not stripped

我的想法已经不多了。有人有吗?

【问题讨论】:

    标签: gcc static linker libtool


    【解决方案1】:

    这很可能是因为系统库或 gcc 运行时是链接共享的。 使用“ldd”实用程序查看动态链接的内容。

    ldd src/gerbv

    共享运行时可能是您想要的,但如果您希望运行时是静态的,那么如果您安装了静态运行时,可能会有一个选项。

    【讨论】:

    • 你是对的,最后我只是使用 ldd 来识别我需要的共享库,然后通过 exec /lib/ld.config.so 运行它们,这样我就可以覆盖库路径.
    猜你喜欢
    • 1970-01-01
    • 2011-05-06
    • 2011-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-01
    相关资源
    最近更新 更多