-
Notifications
You must be signed in to change notification settings - Fork 13.3k
illegal instruction on armv7 (udiv) #50732
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
@dnr well that helps narrows it down! Would it be possible to use https://github.com/rust-lang-nursery/cargo-bisect-rustc to try and figure out which the nightly release in which this broke? That would be excellent. Alternatively, do you have any idea of the source? Most likely, this is some kind of LLVM bug, so cc #50422 |
Marking as P-high so that we stay on top of this, but not assigning anyone as I don't have any immediate ideas for next steps. =) |
The target definition for the armv7-unknown-linux-gnueabi (which is what you probably used) specifies the +thumb2, which is what allows compiler to generate the Alas, your core is a Cortex-A9 which does not support hardware divide in either Thumb or ARM mode (nor does it support the |
Just to make myself clear, this is not a bug in the compiler, but rather an issue with how many different variants of ARM cores exist. This particular i.MX6 just happens to not fall within what we consider to be |
Since they will want to cross-bootstrap their own compiler, adding a new in-tree target definition would probably be the easiest way (just copying the file I linked above and changing the list of features should suffice). A PR with such target would likely be accepted but we most likely wouldn’t distribute prebuilt compilers using that target. |
I see. It's not something you can do without doing a local build? |
Well if running rustc itself on i.MX6 is not the goal, then cross-compiling your programs with something like xargo and custom target jsons (documented in the readme of xargo) would be an easier solution. |
This isn't quite right, Thumb 2 is mandatory in Armv7-A, but hardware divide isn't mandatory in Thumb 2. The Cortex-A9 is still quite a common core and should definitely be supported by that target. Is the udiv definitely in rust code not C/C++ (and could just be bad C compiler flags)? I searched for cashew but couldn't find it. |
Ah, my bad. I wasn’t wrong about ARM being hard to grok, though. The instruction indeed appears in the C++ code ( That’s mostly a T-infra problem in that case. |
To clarify, I didn't build rustc myself, I used prebuilt packages from the archlinuxarm project (archived at http://tardis.tiny-vps.com/aarm/ because the official repos only keep the latest version). I didn't mention this at first, but I also tried the package built for armv6h and it failed in the same way. I don't have a core/disassembly from this right now but I can grab one tonight. Of course that would make sense if the problem is including C++ code from a mismatched target. (I'm not actively developing this software on arm or otherwise, but if I do I'll definitely look into cross compilation.) |
First:
I used rustup on my laptop to download nightly for
Disassembling the Does this mean archlinuxarm is building their binaries with wrong flags or other settings, or that it's been fixed in recent versions? |
Reading the log, this does seem to be a problem with Arch Linux ARM, not Rust. Closing. |
I'm trying to use rust to build something on an ARM board (cubox-i2):
I installed rust 1.25.0 (from the archlinuxarm repo) and get this:
More detail with gdb:
Raw instruction:
I tried downgrading version by version to see if I could find one that works, and it turns out 1.22.1 works (and was able to build what I wanted to build) but 1.23.0 does not.
The text was updated successfully, but these errors were encountered: