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

fix: no_std fix use without unwind #9977

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JonasKruckenberg
Copy link
Contributor

As part of no_std support in cranelift this PR fixes uses of the isa/unwind module through cranelift so that cranelift can be compiled with the unwind feature (which depends on stdlib through gimli) disabled.

@JonasKruckenberg JonasKruckenberg requested a review from a team as a code owner January 10, 2025 12:46
@JonasKruckenberg JonasKruckenberg requested review from abrown and removed request for a team January 10, 2025 12:46
@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift:area:x64 Issues related to x64 codegen labels Jan 10, 2025
let caller_sp_to_cfa_offset =
crate::isa::unwind::systemv::caller_sp_to_cfa_offset();
#[cfg(not(feature = "unwind"))]
let caller_sp_to_cfa_offset = 0; // TODO is this right?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe compute_value_labels_ranges should be made to return ValueLabelsRanges::default(); when the unwind feature is disabled? Except for values which just so happen to be in registers, I don't think it is possible to generate valid debuginfo for locals when the unwind table is not also emitted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguably, the register values are just as 'meaningless' in the no-unwind case as you need the unwind info to recover them (unless you are willing to disassemble code to guide your unwinder). Ultimately, the debug info production 'feature' is tightly coupled to the unwinding feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift:area:x64 Issues related to x64 codegen cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants