【发布时间】:2014-11-29 21:38:47
【问题描述】:
我在使用 rust 构建可移植可执行文件时遇到问题。
在 Ubuntu 上运行使用 cargo build 简单构建的可执行文件失败
./test: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./test)
使用rustc ... -C link-args=-static 构建无法正确链接(ld ./test 的输出):
ld: error in ./test(.eh_frame); no .eh_frame_hdr table will be created.
除了在具有旧 glibc 版本的旧系统上构建之外,还有其他方法吗?
【问题讨论】:
-
您询问的是“便携式”二进制文件,但您只列出了一个系统 (Ubuntu),没有任何版本信息。是否涉及多个系统?如果有,它们的发行版及其版本是什么?
标签: ld static-linking rust rust-cargo