【发布时间】:2017-03-18 09:08:28
【问题描述】:
我尝试将我的一个 Rust 项目编译到 x86_64-unknown-linux-gnu 目标:
$ cargo build --target=x86_64-unknown-linux-gnu
Compiling deployer v0.1.0 (file:///Users/raphael/web/deployer)
error: linking with `cc` failed: exit code: 1
|
= note: "cc"
= note: clang: warning: argument unused during compilation: '-pie'
ld: unknown option: --as-needed
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我不知道如何处理这样的消息。我应该怎么做才能让它发挥作用?
这是我的Cargo.toml 文件:
[package]
name = "deployer"
version = "0.1.0"
authors = ["..."]
[dependencies]
clap = "2.14.0"
time = "0.1.35"
slack-hook = "0.2"
货运版:
cargo 0.13.0-nightly (109cb7c 2016-08-19)
锈版本:
rustc 1.12.0 (3191fbae9 2016-09-23)
我尝试使用 rustup 更新所有内容,但仍然遇到同样的问题。
【问题讨论】:
-
FWIW,just build a native Linux version 通常更容易,避免交叉编译。
-
这就是我所做的。
标签: linux macos rust cross-compiling rust-cargo