-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Make rlib metadata strip works with MIPSr6 architecture #90001
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cjgillot (or someone else) soon. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Thanks for the PR @Fearyncess. |
It looks like the only addition here is |
|
Er yes the other flags are needed as well, but it looks like these targets also need the |
I've checked that MIPSr5 (which has MSA enforced) and Loongson 4000 series is used NaN2008 encoding by default, but does it will be a ABI break problem? https://web.archive.org/web/20180830093617/https://dmz-portal.mips.com/wiki/MIPS_ABI_-_NaN_Interlinking |
Sorry I don't actually know much about mips to the point that I can comment on the technical bits of this patch, I'm just commenting on the code structure itself and how it can be refactored to have a little less duplication than it currently has. Otherwise I would trust you that the flags are working as intended and are necessary for the target that you're working with. |
9859b81 is the initial support for version 6 of MIPS. @wzssyqa Could you help review this pull request?
@alexcrichton I would love to help factor out the duplication. Should I make let e_flags = elf::EF_MIPS_CPIC
| elf::EF_MIPS_PIC
| if sess.target.options.cpu.contains("r6") {
// copied from the `e_flags` field of the object
// generated by `mipsisa64r6el-linux-gnuabi64-gcc foo.c -c`
elf::EF_MIPS_ARCH_64R6 | elf::EF_MIPS_NAN2008
} else {
elf::EF_MIPS_ARCH_64R2
}; Also, regarding having NaN2008 on MIPSr5, I think this should be out of the scope of this pull request. This pull request is meant to only deal with mipsisa{32,64}r6el-related targets. What we need to make sure here is that this pull request won't change anything for those Tier-2 MIPS targets, targeting chips from MIPSr2 to MIPSr5. |
@alexcrichton Sorry for suddenly jumping into the conversation. I'm a colleague of the author of this pull request, so I asked the questions on behalf of our team. We are at CIP United and we will continue to improve Rust's support for the MIPSr6 family, and hopefully make it tier-2 in the future (which also means making real MIPSr6 hardware, and we look forward to it).😊 |
My review of this PR is basically purely stylistic, not really technical. The MIPS flags are all duplicated where the presence of the |
☔ The latest upstream changes (presumably #91604) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #89819) made this pull request unmergeable. Please resolve the merge conflicts. |
Because MIPSr6 has many differences with previous MIPSr2 arch, the previous rlib metadata stripping code in `rustc_codegen_ssa` is only for MIPSr2/r3/r5 (which share the same elf e_flags). This commit fixed this problem. It makes `rustc_codegen_ssa` happy when compiling rustc for MIPSr6 target or hosts.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
i have make the code more simpilified and update the dep of |
@bors: r+ |
📌 Commit cf36c21 has been approved by |
Make rlib metadata strip works with MIPSr6 architecture Because MIPSr6 has many differences with previous MIPSr2 arch, the previous rlib metadata stripping code in `rustc_codegen_ssa` is only for MIPSr2/r3/r5 (which share the same elf e_flags). This commit fixed this problem. It makes `rustc_codegen_ssa` happy when compiling rustc for MIPSr6 target or hosts. e_flags REF: https://github.com/llvm/llvm-project/blob/e356027016c6365b3d8924f54c33e2c63d931492/llvm/include/llvm/BinaryFormat/ELF.h#L562
Make rlib metadata strip works with MIPSr6 architecture Because MIPSr6 has many differences with previous MIPSr2 arch, the previous rlib metadata stripping code in `rustc_codegen_ssa` is only for MIPSr2/r3/r5 (which share the same elf e_flags). This commit fixed this problem. It makes `rustc_codegen_ssa` happy when compiling rustc for MIPSr6 target or hosts. e_flags REF: https://github.com/llvm/llvm-project/blob/e356027016c6365b3d8924f54c33e2c63d931492/llvm/include/llvm/BinaryFormat/ELF.h#L562
…askrgr Rollup of 9 pull requests Successful merges: - rust-lang#90001 (Make rlib metadata strip works with MIPSr6 architecture) - rust-lang#91687 (rustdoc: do not emit tuple variant fields if none are documented) - rust-lang#91938 (Add `std::error::Report` type) - rust-lang#92006 (Welcome opaque types into the fold) - rust-lang#92142 ([code coverage] Fix missing dead code in modules that are never called) - rust-lang#92277 (rustc_metadata: Stop passing `CrateMetadataRef` by reference (step 1)) - rust-lang#92334 (rustdoc: Preserve rendering of macro_rules matchers when possible) - rust-lang#92807 (Update cargo) - rust-lang#92832 (Update RELEASES for 1.58.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Because MIPSr6 has many differences with previous MIPSr2 arch, the previous rlib metadata stripping code in
rustc_codegen_ssa
is only for MIPSr2/r3/r5 (which share the same elf e_flags).This commit fixed this problem. It makes
rustc_codegen_ssa
happy when compiling rustc for MIPSr6 target or hosts.e_flags REF: https://github.com/llvm/llvm-project/blob/e356027016c6365b3d8924f54c33e2c63d931492/llvm/include/llvm/BinaryFormat/ELF.h#L562