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.
Cargo is Rust's build system and package manager. With this tool, you'll get a repeatable build because it allows Rust packages to declare their dependencies in the manifest, Cargo. toml . When you install Rust through rustup , Cargo is also installed.
Output Options Defaults to target in the root of the workspace. Copy final artifacts to this directory. This option is unstable and available only on the nightly channel and requires the -Z unstable-options flag to enable.
The Rust Programming Language Cargo has two main profiles: the dev profile Cargo uses when you run cargo build and the release profile Cargo uses when you run cargo build --release . The dev profile is defined with good defaults for development, and the release profile has good defaults for release builds.
Cargo is Rust's build system and package manager. Most Rustaceans use this tool to manage their Rust projects because Cargo handles a lot of tasks for you, such as building your code, downloading the libraries your code depends on, and building those libraries. (We call the libraries that your code needs dependencies.)
As mentioned in the comments, pass the -C target-cpu
option to rustc:
rustc -C target-cpu=native
For more options:
$ rustc -C help
...
-C target-cpu=val -- select target processor (rustc --print target-cpus for details)
...
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
I'm pretty sure that the Firefox developers that rely on Rust would disagree with you, as well as plenty of others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With