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

riscv: Make ELF flags RVE-aware #112567

Closed
wants to merge 1 commit into from
Closed

Conversation

Noxime
Copy link

@Noxime Noxime commented Jun 12, 2023

This fixes the ELF header flags when targetting embedded RISC-V (rv32e and rv64e).

I think this is the only fix required for when LLVM merges D70401 and RVE targets can be added.

@rustbot
Copy link
Collaborator

rustbot commented Jun 12, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jackh726 (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 12, 2023
@jackh726
Copy link
Member

Agh not my area of expertise at all

r? compiler

@rustbot rustbot assigned cjgillot and unassigned jackh726 Jun 20, 2023
@cjgillot
Copy link
Contributor

Not mine either.
r? @bjorn3 or @nikic can you help?

@rustbot rustbot assigned bjorn3 and unassigned cjgillot Jun 20, 2023
@@ -273,6 +273,11 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
e_flags |= elf::EF_RISCV_RVC;
}

// Check if embedded is enabled
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// Check if embedded is enabled
// Specify if the embedded abi is used

It seems that the embedded abi can be used even in programs that use the full RV32I instruction set1. This flag only determines if the embedded abi is used as I understand it2, not if the object file is limited to RV32E instructions.

Footnotes

  1. https://github.com/riscv-non-isa/riscv-eabi-spec/blob/master/EABI.adoc#1-goals

  2. https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-elf.adoc#file-header

@Dylan-DPC Dylan-DPC added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 16, 2023
@bors
Copy link
Contributor

bors commented Aug 20, 2023

☔ The latest upstream changes (presumably #114332) made this pull request unmergeable. Please resolve the merge conflicts.

@Noxime
Copy link
Author

Noxime commented Aug 21, 2023

Looks to be fixed in #114332

@Noxime Noxime closed this Aug 21, 2023
@apiraino apiraino removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants