Rust编译选项介绍
为了让Rust编译器根据不同的平台使用特定的指令集,可通过环境变量RustFLAGS来让编译器生成相应平台的相应指令集代码。通过Rustc -C help查看所有的RustFLAGS,此处只列出与鲲鹏迁移相关的两条编译选项。
编译选项 |
介绍 |
---|---|
relocation-model=val |
控制PIC的生成,可以使用`Rustc --print relocation-models`命令查看详细信息 |
target-cpu=val |
选择CPU类型,可以使用`Rustc --print target-cpus`命令查看当前所支持的CPU |
父主题: Rust语言迁移