-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
AVR: Cannot compile compiler_builtins in either release or debug mode with nightly 2021-08-21 #88252
Comments
Just to double check, this is a regression in nightly 2021-08-21 and worked fine with the previous nightly? In that case it's almost certainly an LLVM 13 regression. |
I haven't tried Rust on AVR since 2017 so can't tell how recent this
regression is.
…On Mon, Aug 23, 2021, 17:45 Nikita Popov ***@***.***> wrote:
Just to double check, this is a regression in nightly 2021-08-21 and
worked fine with the previous nightly? In that case it's almost certainly
an LLVM 13 regression.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#88252 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA4KKMRZHCSMU3YKAPZPO3T6IKC5ANCNFSM5CUBJHYQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
OK so I just tried with some previous nightlies. On 2021-08-16 I am not getting a segfault; instead, it fails with:
I get the same error on 2021-05-21. On 2021-02-22, I get:
|
Okay, that seems to be a long-standing issue then: rust-lang/compiler-builtins#400 |
I had to go back all the way to rustc 1.47.0-nightly (2d8a3b9 2020-08-26) to get this to work, at least up to compilation (I haven't done linking yet). |
I believe that there are two different issues at work here. I have a similar setup with a custom AVR target definition (for atmega32u4) that shows the |
So is there a particular nightly that is known to work with AVR? I can compile my program with 2d8a3b9 2020-08-26 but the resulting program is juuuust a bit wrong when executing it. I hope I won't have to re-do all the LLVM AVR backend debugging from back in 2017... |
I was experimenting with a later version from January 2021, and it also seemed to generate wrong code. Compilation succeeded, but the resulting program didn't seem to do what it should. I'm not 100% sure about this, because I didn't have a debugging setup, but I couldn't get even the simplest logic to execute correctly. |
Confirming that this nightly works for me. For reference, I'm following the steps in part 6 of https://book.avr-rust.com/ (after installing all the third-party tools linked in part 2 of the same link). |
For what is worth |
I am hitting this crash with the latest nightly and https://reviews.llvm.org/D114611 applied (as well as the CONFIG-0000 and LLVM-0001 patches from https://gitlab.com/snowgoonspub/rust-avr-nightly-builder/-/tree/main/patches applied). I was able to compile rustc with debug info and get the following stack trace: Command Line:
Stack Trace:
|
Confirming that I get this error on nightly-2022-01-11 (the most recent that I can use, since llvm_asm got removed and asm doesn't yet support AVR assembly), compiling for atmega32u2. As a workaround, setting |
It seems this has improved in the meantime. As of Rust |
In light of the "it works in sim" report, I am potentially-overeagerly closing this. If this issue does return, please feel free to reopen this or open a new issue. |
Note: This working, per @gergoerdi's report, likely depends on the [profile.release]
lto = true in chirp8-avr's Cargo.toml As it is likely some of these AVR issues are related, probably we should coalesce some of them into a single issue and close the duplicates. However, my reasons for closing this one were incorrect, as such configuration should not be required just to build a minimal program. So, I have reopened this issue, until someone does the work to figure out which are actually duplicates (or just solve them all, that works too). |
Probably same as #102278 - seems not to be crashing nowadays. |
Oh good. |
Compiling a pretty much empty project for AVR brings in
compiler_builtins
as a dependency, but then building that fails with a segfault (with--release
) or a aran out of registers during register allocation
error message.To reproduce, make the following files:
Cargo.toml
.cargo/config
src/main.rs
Build logs:
The text was updated successfully, but these errors were encountered: