在 OS X 平台,目标为 i686-unknown-linux-gnu 的 Rust 无法链接到核心库,遇到了一些问题:
MacBook:rustboot alex$ make
rustc -O --target i686-unknown-linux-gnu --crate-type lib -o main.o --emit obj main.rs
main.rs:5:1: 5:19 error: can't find crate for `core`
main.rs:5 extern crate core;
^~~~~~~~~~~~~~~~~~
error: aborting due to previous error
make: *** [main.o] Error 101
main.rs的代码如下:
#![no_std]
#![allow(ctypes)]
#![feature(lang_items)]
extern crate core;
use core::prelude::*;
#[no_mangle]
#[no_split_stack]
pub fn main() {
}
我猜是因为我正在尝试链接到 i686-unknown-linux-gnu,但是该平台上核心库不存在。您如何安装或构建该平台的库?