diff options
| author | bors <bors@rust-lang.org> | 2022-01-14 03:17:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-14 03:17:11 +0000 |
| commit | f312a5e610d47601e9a3da828002f5e1ffeb272a (patch) | |
| tree | e0b0afdadcfa568cb67cdc17d31014c75b83971b /compiler/rustc_codegen_ssa/src | |
| parent | 22e491ac7ed454d34669151a8b6464cb643c9b41 (diff) | |
| parent | 1a95aa9a8bb00fb22f15f2392f8d8e4bf9226d0f (diff) | |
| download | rust-f312a5e610d47601e9a3da828002f5e1ffeb272a.tar.gz rust-f312a5e610d47601e9a3da828002f5e1ffeb272a.zip | |
Auto merge of #92844 - matthiaskrgr:rollup-z5wb6yi, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #90001 (Make rlib metadata strip works with MIPSr6 architecture) - #91687 (rustdoc: do not emit tuple variant fields if none are documented) - #91938 (Add `std::error::Report` type) - #92006 (Welcome opaque types into the fold) - #92142 ([code coverage] Fix missing dead code in modules that are never called) - #92277 (rustc_metadata: Stop passing `CrateMetadataRef` by reference (step 1)) - #92334 (rustdoc: Preserve rendering of macro_rules matchers when possible) - #92807 (Update cargo) - #92832 (Update RELEASES for 1.58.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/metadata.rs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 79c24f0f172..6849533abc0 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -95,7 +95,7 @@ fn search_for_metadata<'a>( .map_err(|e| format!("failed to read {} section in '{}': {}", section, path.display(), e)) } -fn create_object_file(sess: &Session) -> Option<write::Object> { +fn create_object_file(sess: &Session) -> Option<write::Object<'static>> { let endianness = match sess.target.options.endian { Endian::Little => Endianness::Little, Endian::Big => Endianness::Big, @@ -135,12 +135,24 @@ fn create_object_file(sess: &Session) -> Option<write::Object> { Architecture::Mips => { // copied from `mipsel-linux-gnu-gcc foo.c -c` and // inspecting the resulting `e_flags` field. - let e_flags = elf::EF_MIPS_ARCH_32R2 | elf::EF_MIPS_CPIC | elf::EF_MIPS_PIC; + let e_flags = elf::EF_MIPS_CPIC + | elf::EF_MIPS_PIC + | if sess.target.options.cpu.contains("r6") { + elf::EF_MIPS_ARCH_32R6 | elf::EF_MIPS_NAN2008 + } else { + elf::EF_MIPS_ARCH_32R2 + }; file.flags = FileFlags::Elf { e_flags }; } Architecture::Mips64 => { // copied from `mips64el-linux-gnuabi64-gcc foo.c -c` - let e_flags = elf::EF_MIPS_ARCH_64R2 | elf::EF_MIPS_CPIC | elf::EF_MIPS_PIC; + let e_flags = elf::EF_MIPS_CPIC + | elf::EF_MIPS_PIC + | if sess.target.options.cpu.contains("r6") { + elf::EF_MIPS_ARCH_64R6 | elf::EF_MIPS_NAN2008 + } else { + elf::EF_MIPS_ARCH_64R2 + }; file.flags = FileFlags::Elf { e_flags }; } Architecture::Riscv64 if sess.target.options.features.contains("+d") => { |
