Iperf: 如何静态编译iperf3?

创建于 2017-04-04  ·  5评论  ·  资料来源: esnet/iperf

亲爱的iperf3开发人员,

我想在具有Linux内核的最小文件系统中使用iperf3。 我必须静态地编译要在文件系统内使用的程序。 可以静态编译iperf3吗?
我做了
$ ./configure --build = arm-none-linux-gnueabi --host = arm-none-linux-gnueabi CFLAGS = -static CXXFLAGS = -static
$使

但是我明白了
/ src $文件iperf3
iperf3:ELF 64位LSB可执行文件,x86-64,版本1(SYSV),动态链接,解释器/lib64/ld-linux-x86-64.so.2,适用于GNU / Linux 2.6.32,BuildID [sha1] = 33df741e068aaf7a9ae8a24a6243de87c35c6ca5,未剥离

最好的祝福,
家欢

question

最有用的评论

这对我有用:

./configure "LDFLAGS=--static" --disable-shared --without-sctp
make
make install
$ ldd iperf3 
    not a dynamic executable

它也在文档中: https :

所有5条评论

./configure --enable-static --disable-shared; 使; 进行安装

我已经很长时间没有尝试过了,但这看起来是正确的答案,谢谢@TheRealDJ!

这似乎不再起作用。 它构建静态库,但不构建可执行文件。

你好
我可以确认这一点。 我尝试将iperf3构建为静态可执行文件,但仍链接到一些库:

❯ ldd ./iperf3
    linux-vdso.so.1 (0x00006284def24000)
    libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x00006284debef000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00006284dea29000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00006284dea24000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00006284dea02000)
    /lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00006284def26000)

建立方式: ./configure --enable-static --disable-shared

这对我有用:

./configure "LDFLAGS=--static" --disable-shared --without-sctp
make
make install
$ ldd iperf3 
    not a dynamic executable

它也在文档中: https :

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

fefone picture fefone  ·  5评论

KevinJosephMorin picture KevinJosephMorin  ·  5评论

pecigonzalo picture pecigonzalo  ·  4评论

arainero picture arainero  ·  3评论

ili101 picture ili101  ·  4评论