Skip to content
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

LLVM ERROR: Error while trying to spill A4 from class AR: Cannot scavenge register without an emergency spill slot! #197

Closed
dimpolo opened this issue Sep 25, 2023 · 4 comments

Comments

@dimpolo
Copy link

dimpolo commented Sep 25, 2023

Compiling a closed source project for the ESP32-S3 with --release leads to:

LLVM ERROR: Error while trying to spill A4 from class AR: Cannot scavenge register without an emergency spill slot!

Is there anything I could do to help diagnose this?

Meta

rustc --version --verbose:

rustc 1.72.1-nightly (edc37d22d 2023-09-15) (1.72.1.0)
binary: rustc
commit-hash: edc37d22db1cc1b112b91addeb1f79951c58e661
commit-date: 2023-09-15
host: x86_64-pc-windows-msvc
release: 1.72.1-nightly
LLVM version: 16.0.4

Cargo.toml

[profile.release]
codegen-units = 1
debug = true

.cargo/config.toml:

[build]
rustflags = [
    "-C", "link-arg=-nostartfiles",
    "-C", "link-arg=-Wl,-Tlinkall.x",
    "-C", "force-frame-pointers",
]
target = "xtensa-esp32s3-none-elf"

[unstable]
build-std = ["core"]
@MabezDev
Copy link
Member

"-C", "force-frame-pointers",

This flag serves no purpose with Xtensa, there is an ISA-defined frame pointer. That said, it shouldn't error with it enabled. I think there was a bug in the template generator that included this. Does it still error without this flag?

Would you be able to try and produce a small test case where the error is produced?

@dimpolo
Copy link
Author

dimpolo commented Sep 25, 2023

"-C", "force-frame-pointers",

Removing this flag solved the error! Thanks for the quick response :)

@dimpolo dimpolo closed this as completed Sep 25, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in esp-rs Sep 25, 2023
@dimpolo
Copy link
Author

dimpolo commented Sep 25, 2023

@MabezDev
Btw this is where I got the flag idea from. Should the text be updated?
https://github.com/esp-rs/esp-backtrace#esp-backtrace---backtrace-for-esp32-bare-metal

@MabezDev
Copy link
Member

Ooh, yeah that should say only for the RISCV targets. Would you mind filing an issue/PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants