rustc/cargo 是否有 -march=native 等价物? [英] Does rustc / cargo have a -march=native equivalent?

查看:76
本文介绍了rustc/cargo 是否有 -march=native 等价物?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我觉得二进制可移植性并不是真正的问题,所以像 -march=native 这样的东西可能总是默认行为.但我找不到任何说法.

I feel like binary portability isn't really a concern, and so something like -march=native may always be the default behavior. I can't find anything saying one way or the other though.

推荐答案

如评论中所述,将 -C target-cpu 选项传递给 rustc:

As mentioned in the comments, pass the -C target-cpu option to rustc:

rustc -C target-cpu=native

更多选择:

$ rustc -C help
    ...     
    -C        target-cpu=val -- select target processor (rustc --print target-cpus for details)
    ...

有关传递选项的更多方法,请参阅如何将 rustc 标志传递给货物?.

See How to pass rustc flags to cargo? for more methods of passing the option.

我觉得二进制可移植性不是真正的问题

I feel like binary portability isn't really a concern

我很确定依赖 Rust 的 Firefox 开发人员会不同意您以及其他许多人的意见.

I'm pretty sure that the Firefox developers that rely on Rust would disagree with you, as well as plenty of others.

这篇关于rustc/cargo 是否有 -march=native 等价物?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆