Skip to content

Hardcoded path name for asm.S #419

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

Closed
noppej opened this issue Feb 1, 2022 · 6 comments
Closed

Hardcoded path name for asm.S #419

noppej opened this issue Feb 1, 2022 · 6 comments

Comments

@noppej
Copy link

noppej commented Feb 1, 2022

Binary files using this crate ends up with a hardcoded path for asmS file, as per the following dwarfdump output ...

0x00001f41: DW_TAG_compile_unit
              DW_AT_stmt_list   (0x00000a88)
              DW_AT_ranges      (0x0000000c
                 [0x00003648, 0x0000365c)
                 [0x00000400, 0x00000460))
              DW_AT_name        ("asm.S")
              DW_AT_comp_dir    ("/home/jonas/dev/cortex-m-rt")
              DW_AT_producer    ("GNU AS 2.37")
              DW_AT_language    (DW_LANG_Mips_Assembler)

The impact of this is that debuggers that step through the code will fail to find the source code for the particular file. I don't know how this can be fixed, but it would be great if somehow we can encode the DW_AT_comp_dir value so that debuggers can discover this file from the .cargo/registry/src location.

@noppej noppej changed the title Hardcoded path name for Hardcoded path name for asm.S Feb 1, 2022
@TDHolmes
Copy link
Contributor

TDHolmes commented Feb 1, 2022

This will soon be irrelevant as I believe this path for making assembly will be eliminated

@noppej
Copy link
Author

noppej commented Feb 1, 2022

Excellent. Do you have a reference to a discussion that I can follow for this please?

@TDHolmes
Copy link
Contributor

TDHolmes commented Feb 1, 2022

I'm not aware of one yet. Once 1.59 releases with stable support for global asm the feature inline-asm will be made the default / only option. You could switch to using that feature in the meantime

@adamgreig
Copy link
Member

At the moment the inline-asm feature doesn't change how the cortex-m-rt asm is generated, but the plan is indeed to move it to use global_asm!() for Rust 1.59, at which point asm.S can be deleted entirely.

If there was some easy fix we could apply now, I'd be happy to merge it, but I don't want to spend too long investigating when we plan to change the approach entirely once the next Rust release is out.

@noppej
Copy link
Author

noppej commented Feb 1, 2022

Totally understand, and I can easily wait for Rust 1.59. Thanks for the info.

@adamgreig
Copy link
Member

See #420 for progress.

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

No branches or pull requests

3 participants