-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Unhelpful error message on risc-v using the asm! macro with register extractions #54315
Comments
I think this is b/c there is no type checking on the asm! macro's outputs |
This code also works when using the x(n) versions of registers instead of t0, a0 and other stuff like that |
@liamnaddell hi, could you please upload the relevant source code to https://play.rust-lang.org/ ? I don't really trust random archives on the internet :) |
I really can't I'm sorry. It uses separate asm files, and a build.sh and build.rs script for building. It also ships with multiple linker scripts |
It's a bare-metal risc-v elf binary, not an app u run on your system, you need qemu |
It failed to build for the
But I reproduced your issue with the
Seems fixed. :-) |
Using a reduced version of the same issue, here, the issue with the inline assembly has not gone away, but the error messages are much better. Sadly, you can't provide --target to play.rust-lang.org, even if you do only want to generate llvm IR, so it's hard to show. For reference, the way to fix the inline assembly is to write the input constraint with braces (and, at the moment, due to a bug, using the architectural register name x12) |
Thanks for your response :) |
This issue does not apply to the new The legacy |
(this is my first issue, sorry)
This is sort of a bug and sort of a feature request/cry for help. All of the following stuff is new to me, so this is probably user error.
The code I tried is attached below
diosix.tar.gz
If you take the src/kernel/main.rs function, and replace the a2 with r, the rust compiler no longer segfaults!
I expected some kind of helpful error about how you can't use the a2 register, but got the following beauty:
when the --verbose flag is added, you get
It is totally unclear to me what registers are allowed to be used where(this is because I have no idea what I am doing).
btw im on nightly:
rustc 1.30.0-nightly (2ab3eba30 2018-09-14)
btw here is the code this is all based off of: "https://github.com/diodesign/diosix"
I really love rust-lang and I would love to hear back :)
The text was updated successfully, but these errors were encountered: