-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass target-cpu to C compilers #268
Comments
I've cross-referenced https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html and Most of them match exactly. Below is the list of odd ones. The extra options on GCC side can be ignored (they're mostly exotic/outdated and not fully supported anyway). The extra options on LLVM side may need to be mapped to a closest equivalent.
|
related: conan-io/conan#847 |
I would suggest (since these have to be mapped and handled separately per ToolFamily), that you start with a minimal list and expand support as they are requested by other projects. GCC 4.8 requires corei7-avx (rather than sandybridge) and core-avx2 (rather than haswell). I don't see gcc version detection, and I think those values are forward compatible. Maybe we should start with a mapping table and add columns for MSVC, CLANG, and GCC. I would imagine that we'd have to target baseline versions and only enable advanced mappings if we know the compiler version. |
For this crate, what are the minimum supported versions of clang, gcc, and msvc? |
The same applies to target-features. |
I need this for WASM ( |
It's possible to set target compilation architecture via
RUSTFLAGS="-C target-cpu=<arch>"
.As far as I can tell, the C compiler is not made aware of this, so it won't be producing matching binaries. It affects performance and I suspect it may also affect correctness when it affects C calling convention (newer SSE registers are used).
So I think it'd be best if the
cc
crate detected Rust's compilation target and automatically configured the C compiler to match (abstracting away compiler-specific flags and possibly cpu arch naming mismatches, so that build scripts don't have to reinvent this).The text was updated successfully, but these errors were encountered: