diff options
| author | bors <bors@rust-lang.org> | 2023-07-11 17:19:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-07-11 17:19:10 +0000 |
| commit | e571544f4448d35af55e5ea3f35b92a2e784944a (patch) | |
| tree | 8038b9a61ea082e6bf70dd9d2b40b8aead0fcf96 /compiler/rustc_codegen_ssa/src | |
| parent | 0a2681cc493f929a0fe66eae1c2c5e862205072c (diff) | |
| parent | 4f5ef52c37d009a60b9995511112afde97a30063 (diff) | |
| download | rust-e571544f4448d35af55e5ea3f35b92a2e784944a.tar.gz rust-e571544f4448d35af55e5ea3f35b92a2e784944a.zip | |
Auto merge of #113577 - matthiaskrgr:rollup-vaa83ip, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #112717 (Implement a few more rvalue translation to smir) - #113310 (Don't suggest `impl Trait` in path position) - #113497 (Support explicit 32-bit MIPS ABI for the synthetic object) - #113560 (Lint against misplaced where-clauses on associated types in traits) 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 | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 00e6acb5c1a..a463dff852d 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -243,8 +243,16 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static s if s.contains("r6") => elf::EF_MIPS_ARCH_32R6, _ => elf::EF_MIPS_ARCH_32R2, }; - // The only ABI LLVM supports for 32-bit MIPS CPUs is o32. - let mut e_flags = elf::EF_MIPS_CPIC | elf::EF_MIPS_ABI_O32 | arch; + + let mut e_flags = elf::EF_MIPS_CPIC | arch; + + // If the ABI is explicitly given, use it or default to O32. + match sess.target.options.llvm_abiname.to_lowercase().as_str() { + "n32" => e_flags |= elf::EF_MIPS_ABI2, + "o32" => e_flags |= elf::EF_MIPS_ABI_O32, + _ => e_flags |= elf::EF_MIPS_ABI_O32, + }; + if sess.target.options.relocation_model != RelocModel::Static { e_flags |= elf::EF_MIPS_PIC; } |
