-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Rust "forgets" intel attribute on assembly code sometimes #70337
Comments
ValueMapper used during ThinLTO import does not preserve assembly dialect when remapping types (the last argument of Using |
Interesting. This should probably be more prominently documented. I can't find a single reference to this issue online. No resource about inline assembly told me I had to turn off lto to get it to work. |
This is a bug in LLVM. Inline assembly should just work with LTO. |
Is this a known issue in LLVM? I can't find any mention of this anywhere else |
https://bugs.llvm.org/buglist.cgi?quicksearch=lto%20inline%20assembly There are several bugs for inline assembly and LTO interaction, but this one doesn't seem to be reported yet. Somebody with an account for the LLVM bug tracker will have to do this. |
This seems to have been lying in bugzilla for a while so I submitted the patch to LLVM's code review: https://reviews.llvm.org/D80066 |
This was fixed by rust-lang/llvm-project#59, and the submodule update got pulled in by #69171. |
I tried this code:
I expected to see this happen:
The inline assembly should be compiled in intel syntax
Instead, this happened:
Under some circumstances, Rust seems to forget about the intel attribute and tries to compile it as AT&T assembly.
I have not found a consistent reason for this, if the code compiles or not changes seemingly at random with different compile options or code reordering.
Removing call_closure_with_stack also made resulted in no error, but I am not sure if it is the cause or just massages the code in such a way that the issue goes silent.
full cargo error message with --verbose
Meta
rustc --version --verbose
:Windows:
Linux:
The text was updated successfully, but these errors were encountered: