File tree 1 file changed +13
-2
lines changed
compiler/rustc_codegen_ssa/src/back
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -284,8 +284,19 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
284
284
e_flags
285
285
}
286
286
Architecture :: LoongArch64 => {
287
- // Source: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html#_e_flags_identifies_abi_type_and_version
288
- elf:: EF_LARCH_OBJABI_V1 | elf:: EF_LARCH_ABI_DOUBLE_FLOAT
287
+ // Source: https://github.com/loongson/la-abi-specs/blob/release/laelf.adoc#e_flags-identifies-abi-type-and-version
288
+ let mut e_flags: u32 = elf:: EF_LARCH_OBJABI_V1 ;
289
+ let features = & sess. target . options . features ;
290
+
291
+ // Select the appropriate floating-point ABI
292
+ if features. contains ( "+d" ) {
293
+ e_flags |= elf:: EF_LARCH_ABI_DOUBLE_FLOAT ;
294
+ } else if features. contains ( "+f" ) {
295
+ e_flags |= elf:: EF_LARCH_ABI_SINGLE_FLOAT ;
296
+ } else {
297
+ e_flags |= elf:: EF_LARCH_ABI_SOFT_FLOAT ;
298
+ }
299
+ e_flags
289
300
}
290
301
_ => 0 ,
291
302
} ;
You can’t perform that action at this time.
0 commit comments