- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用以下方法构建一个独立的基于 Rust 的二进制文件:
cargo --target=armv7-unknown-linux-gnueabihf --release
每当我为目标系统构建二进制文件并在目标系统上复制和执行该二进制文件时,它都会崩溃:
<binary>:error while loading shared libraries:
libstd-42431e74081a30a8.so:
cannot open shared object file: No such file or directory
这意味着它找不到动态库。
如果将动态库复制到外部 SSD 并且有指向它们的路径,则二进制文件在找到库时不会崩溃。
最初 .cargo/config 有
rustflags = ["-C","target-feature=prefer-dynamic]
我也试过
rustflags = ["-C", "target-feature=+crt-static"]
但是二进制文件仍然需要外部动态库
.cargo/config 文件内容为:
[target.armv7-unknown-linux-gnueabihf]
ar = "arm-dey-linux-gnueabi-gcc-ar"
linker = "gcc-sysroot"
[build]
rustflags = ["-C", "target-feature=+crt-static"]
我希望目标的二进制文件将在不依赖于动态 .so 或 .rlib 系统文件的情况下执行,因为我们有一个空间限制系统,其中可能没有 SSD。
最佳答案
为了后代(因为我在我的收藏中有这个供以后引用,即使我个人没有尝试过):
我相信现在使用 Rust 嵌入式团队的 Rust Cross ( https://github.com/rust-embedded/cross) 可以更轻松地实现这一点。
还有一个例子:https://gitlab.com/Spindel/rust-cross-example/基于文章:https://www.modio.se/cross-compiling-rust-binaries-to-armv7.html
关于rust - ARMv7 的独立可执行文件失败,因为它是 "cannot open shared object file"for libstd,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56265116/
我想在 libstd 中做一些更改,然后用玩具程序测试它们。看起来我可以通过转到 rust/src/libstd 并执行(每晚)cargo build 来构建 libstd.so。完成此操作后,我如何
我正在尝试使用共享库构建一个 Go 可执行文件。在使用 GNU libc 的 Ubuntu 中,它可以工作。但是,当我尝试在使用 MUSL libc 的 Alpine(Docker 镜像 golang
我有一个具有以下结构的项目: Cargo.toml my_script.py my_lib: - Cargo.toml - src my_bin: - Cargo.toml
我目前的工作流程要求我几乎每天都重建 Rust 编译器以获得像 libstd 这样的“标准 crate ”对于另一个目标平台 ( arm-unknown-linux-gnueabihf )。 这并不理
在 C 库 math.h 中,有一个非常高效的 sincos 函数,因为它计算正弦和余弦的时间接近一次调用sin() 或 cos() 比调用两者的总时间。 C++标准库中有这样的函数吗? 最佳答案 I
我在理解 Cargo 在构建动态库时如何链接二进制文件时遇到问题。为了更好地理解它,我使用了 coreutils project并尝试构建“ls”更改 Cargo.toml 和其他内容以使可执行文件尽
我正在使用 cmake 来管理我使用第三方库的项目。 此库可能已针对 libc++ 或 libstd++(取决于版本)进行编译/链接。 我知道如何告诉 cmake 将我的项目编译/链接到 libc++
我正在尝试使用以下方法构建一个独立的基于 Rust 的二进制文件: cargo --target=armv7-unknown-linux-gnueabihf --release 每当我为目标系统构建二
我有一个场景,我们有一个大约 15 年前用 C 编写的现有(旧)操作系统。现在,我们正在考虑扩展这个系统,能够用 Rust 编写用户空间程序。 自然地,因为这是最近才开始的,我们还没有费心将所有 li
我是一名优秀的程序员,十分优秀!