File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
compiler/rustc_codegen_ssa/src/back Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -243,8 +243,16 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
243
243
s if s. contains ( "r6" ) => elf:: EF_MIPS_ARCH_32R6 ,
244
244
_ => elf:: EF_MIPS_ARCH_32R2 ,
245
245
} ;
246
- // The only ABI LLVM supports for 32-bit MIPS CPUs is o32.
247
- let mut e_flags = elf:: EF_MIPS_CPIC | elf:: EF_MIPS_ABI_O32 | arch;
246
+
247
+ let mut e_flags = elf:: EF_MIPS_CPIC | arch;
248
+
249
+ // If the ABI is explicitly given, use it or default to O32.
250
+ match sess. target . options . llvm_abiname . to_lowercase ( ) . as_str ( ) {
251
+ "n32" => e_flags |= elf:: EF_MIPS_ABI2 ,
252
+ "o32" => e_flags |= elf:: EF_MIPS_ABI_O32 ,
253
+ _ => e_flags |= elf:: EF_MIPS_ABI_O32 ,
254
+ } ;
255
+
248
256
if sess. target . options . relocation_model != RelocModel :: Static {
249
257
e_flags |= elf:: EF_MIPS_PIC ;
250
258
}
You can’t perform that action at this time.
0 commit comments