// main.rs
fn main() {
println!("Hello, world!");
}
# .cargo/config.toml
[build]
target = "x86_64-unknown-linux-gnu"
rustflags = [
"-L",
"/usr/lib/x86_64-linux-gnu",
"-L",
"/usr/lib/gcc/x86_64-linux-gnu/10/",
"-L",
"/lib/x86_64-linux-gnu/",
]
[target.x86_64-unknown-linux-gnu]
linker = "rust-lld"
使用 cargo run
运行后会出现 Segmentation fault,但使用默认的 cc
进行链接则可以正常运行,这是为什么呢?
1
共 3 条评论, 1 页
评论区
写评论能展开说说到底为啥会 Segement Fault么? 既然可能导致这个故障,有什么方法规避么?
目前有什么方法能在 Linux 中使用 rust-lld 么,,
找到原因了Support feeding rust-lld into gcc (and clang)