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

cfi_label and cfi_startproc in start.S #1149

Closed
alexfanqi opened this issue Oct 29, 2022 · 9 comments
Closed

cfi_label and cfi_startproc in start.S #1149

alexfanqi opened this issue Oct 29, 2022 · 9 comments

Comments

@alexfanqi
Copy link

Hi,

Can I get some help to clarify the .cfi_label dummy directive here? In ziglang/zig#3340, zig vendors part of glibc header, and it fails to compile because llvm does not support .cfi_label.

The thing confuses me is the macro ENTRY already includes a cfi_startproc, which I thought should start the FDE and makes cfi_label redundant.

I have also read Bug 23125 that introduces this line. The original patch in first comment didn't include cfi_label.

Is it safe to simply remove cfi_label, or there are other workarounds?

@aswaterman
Copy link
Collaborator

I know this is not an answer to your question, but note that RISC-V is not alone in using the .cfi_label directive in this context; see https://github.com/bminor/glibc/search?q=cfi_label

As a matter of curiosity, I'd also like to understand why this directive is necessary.

@TommyMurphyTM1234
Copy link
Collaborator

TommyMurphyTM1234 commented Oct 29, 2022

Shouldn't this issue be logged against the upstream glibc and not here?

Anyway, doesn't this explain it?

bminor/glibc@2dd12ba

If not then presumably the author of that commit (@andreas-schwab) can explain further?

@alexfanqi
Copy link
Author

alexfanqi commented Oct 30, 2022

Anyway, doesn't this explain it?

bminor/glibc@2dd12ba

I read this commit message before. It explains the reason for undefining ra and replacing tail, but doesn't mention cfi_label. Only comment I can find is cfi_label forces start of fde, which seems already done by cfi_startproc.

RISC-V is not alone in using the .cfi_label directive in this context; see https://github.com/bminor/glibc/search?q=cfi_label

I noticed all arches using cfi_label come after riscv, so I tried to ask in riscv community first. I will lodge a bug to upstream while waiting for more help here.

@TommyMurphyTM1234
Copy link
Collaborator

I will lodge a bug to upstream while waiting for more help here.

Can you post a link here to the upstream bug please?

@alexfanqi
Copy link
Author

Sorry, upstream bug https://sourceware.org/bugzilla/show_bug.cgi?id=29749

@TommyMurphyTM1234
Copy link
Collaborator

Sorry, upstream bug https://sourceware.org/bugzilla/show_bug.cgi?id=29749

Thanks @alexfanqi

@TommyMurphyTM1234
Copy link
Collaborator

This post seems to address the original question:

https://sourceware.org/bugzilla/show_bug.cgi?id=29749#c2

As such, can this issue be closed?

@alexfanqi
Copy link
Author

still want to check some details of cfi_label, but since the discussion is in upstream bugzilla. I think this issue can be closed.

@TommyMurphyTM1234
Copy link
Collaborator

still want to check some details of cfi_label, but since the discussion is in upstream bugzilla. I think this issue can be closed.

Thanks @alexfanqi

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