From 8b4481dc3fa06e5e4626792190d08c941c7384a1 Mon Sep 17 00:00:00 2001 From: Axel Navarro Date: Thu, 10 Sep 2020 21:31:08 -0300 Subject: [PATCH] rustc: add target, target-cpu and print examples (#4320) --- pages/common/rustc.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pages/common/rustc.md b/pages/common/rustc.md index 83b9c86b9f..c4a9106681 100644 --- a/pages/common/rustc.md +++ b/pages/common/rustc.md @@ -15,3 +15,19 @@ - Compile with debugging information: `rustc -g {{file.rs}}` + +- Compile with architecture-specific optimizations for the current CPU: + +`rustc -C target-cpu=native {{path/to/file.rs}}` + +- Display architecture-specific optimizations for the current CPU: + +`rustc -C target-cpu=native --print cfg` + +- Display target list: + +`rustc --print target-list` + +- Compile for a specific target: + +`rustc --target {{target_triple}} {{path/to/file.rs}}`