-
Notifications
You must be signed in to change notification settings - Fork 144
Build script executes illegal instructions when cross-compiling #353
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
Comments
Line 4 in 022f250
This I can reproduce the crash, and at least with my version, it's coming from a hash set used by
But even that is just a symptom. The problem is that Cargo is applying your "cross"
https://doc.rust-lang.org/cargo/reference/config.html#buildrustflags
|
possibly related: rust-lang/cargo#4423 |
The build script executes a
total_cmp
, which appears to compile with whatever target features are passed, rather than the host target, meaning that when cross-compiling anything that has num-traits as a dependency the build may fail due to encountering an illegal instruction.Steps to reproduce:
Compile targeting an instruction set that your CPU does not support.
E.g:
On an AMD Ryzen 5 5500U (x86-64-v3) CPU:
Compiles fine, as the CPU supports the necessary instructions.
Results in
Relevant godbolt for
total_cmp
(usage ofvpsraq
):The text was updated successfully, but these errors were encountered: